diff options
author | Richard Kenner <kenner@vlsi1.ultra.nyu.edu> | 2004-11-29 00:59:25 +0000 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 2004-11-28 19:59:25 -0500 |
commit | 406eab994a2da3bb54b959901acc1ddf9826eccf (patch) | |
tree | f2a50aeaf9e314f376464708965b246331bd2f9e /gcc | |
parent | b16aa8a5d930f7247ab56facac3adc67f7aebfa3 (diff) | |
download | gcc-406eab994a2da3bb54b959901acc1ddf9826eccf.zip gcc-406eab994a2da3bb54b959901acc1ddf9826eccf.tar.gz gcc-406eab994a2da3bb54b959901acc1ddf9826eccf.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/tree-ssa-alias.c | 29 |
2 files changed, 17 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8724e4c..87d29bc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 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. diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index d6391db..3fce93a 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -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) |