Commit 406eab99 by Richard Kenner Committed by Richard Kenner

tree-ssa-alias.c (compute_points_to_and_addr_escapes): Remove special code for…

tree-ssa-alias.c (compute_points_to_and_addr_escapes): Remove special code for assigning to non-pointer.

	* tree-ssa-alias.c (compute_points_to_and_addr_escapes): Remove
	special code for assigning to non-pointer.
	(is_escape_site): If RHS is a conversion between pointer and integer
	types,	this is an escape site.

From-SVN: r91448
parent b16aa8a5
2004-11-28 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* tree-ssa-alias.c (compute_points_to_and_addr_escapes): Remove
special code for assigning to non-pointer.
(is_escape_site): If RHS is a conversion between pointer and integer
types, this is an escape site.
* gcse.c (insert_store): Error if try to insert store on abnormal edge.
(store_motion): Don't move store if any edge we'd want to move it
to is abnormal.
......
......@@ -195,7 +195,8 @@ tree global_var;
The concept of 'escaping' is the same one used in the Java world. When
a pointer or an ADDR_EXPR escapes, it means that it has been exposed
outside of the current function. So, assignment to global variables,
function arguments and returning a pointer are all escape sites.
function arguments and returning a pointer are all escape sites, as are
conversions between pointers and integers.
This is where we are currently limited. Since not everything is renamed
into SSA, we lose track of escape properties when a pointer is stashed
......@@ -662,22 +663,6 @@ compute_points_to_and_addr_escape (struct alias_info *ai)
if (stmt_escapes_p)
block_ann->has_escape_site = 1;
/* Special case for silly ADDR_EXPR tricks
(gcc.c-torture/unsorted/pass.c). If this statement is an
assignment to a non-pointer variable and the RHS takes the
address of a variable, assume that the variable on the RHS is
call-clobbered. We could add the LHS to the list of
"pointers" and follow it to see if it really escapes, but it's
not worth the pain. */
if (addr_taken
&& TREE_CODE (stmt) == MODIFY_EXPR
&& !POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (stmt, 0))))
EXECUTE_IF_SET_IN_BITMAP (addr_taken, 0, i, bi)
{
tree var = referenced_var (i);
mark_call_clobbered (var);
}
FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_USE)
{
var_ann_t v_ann = var_ann (SSA_NAME_VAR (op));
......@@ -2049,6 +2034,16 @@ is_escape_site (tree stmt, size_t *num_calls_p)
if (lhs == NULL_TREE)
return true;
/* If the RHS is a conversion between a pointer and an integer, the
pointer escapes since we can't track the integer. */
if ((TREE_CODE (TREE_OPERAND (stmt, 1)) == NOP_EXPR
|| TREE_CODE (TREE_OPERAND (stmt, 1)) == CONVERT_EXPR
|| TREE_CODE (TREE_OPERAND (stmt, 1)) == VIEW_CONVERT_EXPR)
&& POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND
(TREE_OPERAND (stmt, 1), 0)))
&& !POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (stmt, 1))))
return true;
/* If the LHS is an SSA name, it can't possibly represent a non-local
memory store. */
if (TREE_CODE (lhs) == SSA_NAME)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment