diff options
author | Daniel Berlin <dberlin@dberlin.org> | 2005-03-30 22:10:47 +0000 |
---|---|---|
committer | Daniel Berlin <dberlin@gcc.gnu.org> | 2005-03-30 22:10:47 +0000 |
commit | d19e9499fc4f7cf1bbcc48a8c7947d5818827a7f (patch) | |
tree | f6eaaa98001b2da1eb839c4603dc4bf351b73e15 /gcc | |
parent | 12527dcee33276926ce75f6117544205982291e9 (diff) | |
download | gcc-d19e9499fc4f7cf1bbcc48a8c7947d5818827a7f.zip gcc-d19e9499fc4f7cf1bbcc48a8c7947d5818827a7f.tar.gz gcc-d19e9499fc4f7cf1bbcc48a8c7947d5818827a7f.tar.bz2 |
tree-ssa-alias.c (compute_flow_insensitive_aliasing): Make sure subvars get marked properly in tags for grouping.
2005-03-30 Daniel Berlin <dberlin@dberlin.org>
* tree-ssa-alias.c (compute_flow_insensitive_aliasing): Make sure
subvars get marked properly in tags for grouping.
(add_pointed_to_var): Mark only actual pointed to
variables/subvars in addresses needed.
(create_overlap_variables_for): Clear call clobbered on original
variable.
* tree-ssa-operands.c (get_asm_expr_operands): Don't let regular
addresable vars with subvars into list.
* tree-ssa.c (verify_ssa_name): Verify original is not used where
subvar should be.
From-SVN: r97285
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/tree-ssa-alias.c | 41 | ||||
-rw-r--r-- | gcc/tree-ssa-operands.c | 11 | ||||
-rw-r--r-- | gcc/tree-ssa.c | 7 |
4 files changed, 62 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index be4f8c2..9fac180 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2005-03-30 Daniel Berlin <dberlin@dberlin.org> + + * tree-ssa-alias.c (compute_flow_insensitive_aliasing): Make sure + subvars get marked properly in tags for grouping. + (add_pointed_to_var): Mark only actual pointed to + variables/subvars in addresses needed. + (create_overlap_variables_for): Clear call clobbered on original + variable. + * tree-ssa-operands.c (get_asm_expr_operands): Don't let regular + addresable vars with subvars into list. + * tree-ssa.c (verify_ssa_name): Verify original is not used where + subvar should be. + 2005-03-30 Richard Henderson <rth@redhat.com> * cgraph.h (struct cgraph_node): Add alias. diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index 12a432b..c08cf3b 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -1006,11 +1006,19 @@ compute_flow_insensitive_aliasing (struct alias_info *ai) subvar_t sv; for (sv = svars; sv; sv = sv->next) - add_may_alias (tag, sv->var); + { + add_may_alias (tag, sv->var); + /* Update the bitmap used to represent TAG's alias set + in case we need to group aliases. */ + SET_BIT (p_map->may_aliases, var_ann (sv->var)->uid); + } } else { add_may_alias (tag, var); + /* Update the bitmap used to represent TAG's alias set + in case we need to group aliases. */ + SET_BIT (p_map->may_aliases, var_ann (var)->uid); } /* Update the total number of virtual operands due to @@ -1022,9 +1030,7 @@ compute_flow_insensitive_aliasing (struct alias_info *ai) ai->total_alias_vops += (num_var_refs + num_tag_refs); p_map->total_alias_vops += (num_var_refs + num_tag_refs); - /* Update the bitmap used to represent TAG's alias set - in case we need to group aliases. */ - SET_BIT (p_map->may_aliases, var_ann (var)->uid); + } } } @@ -1982,7 +1988,7 @@ add_pointed_to_var (struct alias_info *ai, tree ptr, tree value) svars = get_subvars_for_var (ref); uid = var_ann (pt_var)->uid; - bitmap_set_bit (ai->addresses_needed, uid); + if (pi->pt_vars == NULL) pi->pt_vars = BITMAP_GGC_ALLOC (); /* If the variable is a global, mark the pointer as pointing to @@ -1993,15 +1999,17 @@ add_pointed_to_var (struct alias_info *ai, tree ptr, tree value) for (sv = svars; sv; sv = sv->next) { if (overlap_subvar (offset, size, sv, NULL)) - bitmap_set_bit (pi->pt_vars, var_ann (sv->var)->uid); + { + bitmap_set_bit (pi->pt_vars, var_ann (sv->var)->uid); + bitmap_set_bit (ai->addresses_needed, var_ann (sv->var)->uid); + } } } else if (pt_var && SSA_VAR_P (pt_var)) { uid = var_ann (pt_var)->uid; - bitmap_set_bit (ai->addresses_needed, uid); - + if (pi->pt_vars == NULL) pi->pt_vars = BITMAP_GGC_ALLOC (); @@ -2019,7 +2027,10 @@ add_pointed_to_var (struct alias_info *ai, tree ptr, tree value) } } else - bitmap_set_bit (pi->pt_vars, uid); + { + bitmap_set_bit (ai->addresses_needed, uid); + bitmap_set_bit (pi->pt_vars, uid); + } /* If the variable is a global, mark the pointer as pointing to global memory (which will make its tag a global variable). */ @@ -2894,8 +2905,18 @@ create_overlap_variables_for (tree var) *subvars = sv; free (fo); } + + /* Once we have created subvars, the original is no longer call + clobbered on its own. Its call clobbered status depends + completely on the call clobbered status of the subvars. + + add_referenced_var in the above loop will take care of + marking subvars of global variables as call clobbered for us + to start, since they are global as well. */ + clear_call_clobbered (var); + } - + VEC_free (fieldoff_t, fieldstack); } diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index 1ef06db..916814d 100644 --- a/gcc/tree-ssa-operands.c +++ b/gcc/tree-ssa-operands.c @@ -1370,6 +1370,17 @@ get_asm_expr_operands (tree stmt) EXECUTE_IF_SET_IN_BITMAP (addressable_vars, 0, i, bi) { tree var = referenced_var (i); + + /* Subvars are explicitly represented in this list, so + we don't need the original to be added to the clobber + ops, but the original *will* be in this list because + we keep the addressability of the original + variable up-to-date so we don't screw up the rest of + the backend. */ + if (var_can_have_subvars (var) + && get_subvars_for_var (var) != NULL) + continue; + add_stmt_operand (&var, s_ann, opf_is_def); } diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index b3fda97..899594d 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -136,6 +136,13 @@ verify_ssa_name (tree ssa_name, bool is_virtual) return true; } + if (is_virtual && var_ann (SSA_NAME_VAR (ssa_name)) + && get_subvars_for_var (SSA_NAME_VAR (ssa_name)) != NULL) + { + error ("Found real variable when subvariables should have appeared"); + return true; + } + return false; } |