summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-operands.c
diff options
context:
space:
mode:
authordberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-20 13:38:01 +0000
committerdberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-20 13:38:01 +0000
commitabd433a73a0d509e9769dfb35dd2af57edc1ca48 (patch)
tree16d20e32d96535b3c2b5c91db8c2382c5b3fb541 /gcc/tree-ssa-operands.c
parent1ed004b714e2f2f646040e6fde2100dbe1f79e1d (diff)
downloadgcc-abd433a73a0d509e9769dfb35dd2af57edc1ca48.tar.gz
2006-02-20 Daniel Berlin <dberlin@dberlin.org>
* tree.h (struct tree_memory_tag): Add is_used_alone member. (TMT_USED_ALONE): New macro. * tree-pass.h (PROP_tmt_usage): New property. (TODO_update_tmt_usage): New todo. * tree-ssa-alias.c (updating_used_alone): New variable. (recalculate_used_alone): New function. (compute_may_aliases): Set updating_used_alone, call recalculate_used_alone. * tree-sra.c (pass_sra): Note that this pass destroys PROP_tmt_usage, and add TODO_update_tmt_usage. * tree-ssa-forwprop.c (pass_forwprop): Ditto. * tree-flow.h (updating_used_alone): Prototype. (recalculate_used_alone): Ditto. * passes.c (execute_todo): Add code to set updating_used_alone, and call recalculate. * tree-ssa-operands.c (add_virtual_operand): Only append bare def for clobber if used alone, and add assert to verify used_alone status. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111300 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-operands.c')
-rw-r--r--gcc/tree-ssa-operands.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index 748ff5d62f6..de578a74df1 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -1844,11 +1844,26 @@ add_virtual_operand (tree var, stmt_ann_t s_ann, int flags,
It is also necessary to add bare defs on clobbers for
TMT's, so that bare TMT uses caused by pruning all the
- aliases will link up properly with calls. */
+ aliases will link up properly with calls. In order to
+ keep the number of these bare defs we add down to the
+ minimum necessary, we keep track of which TMT's were used
+ alone in statement defs or vuses. */
+
if (v_ann->is_aliased
|| none_added
- || (TREE_CODE (var) == TYPE_MEMORY_TAG && for_clobber))
- append_v_may_def (var);
+ || (TREE_CODE (var) == TYPE_MEMORY_TAG && for_clobber
+ && TMT_USED_ALONE (var)))
+ {
+ /* Every bare tmt def we add should have TMT_USED_ALONE
+ set on it, or else we will get the wrong answer on
+ clobbers. */
+
+ if (none_added && !updating_used_alone && aliases_computed_p
+ && TREE_CODE (var) == TYPE_MEMORY_TAG)
+ gcc_assert (TMT_USED_ALONE (var));
+
+ append_v_may_def (var);
+ }
}
else
{