From abd433a73a0d509e9769dfb35dd2af57edc1ca48 Mon Sep 17 00:00:00 2001 From: dberlin Date: Mon, 20 Feb 2006 13:38:01 +0000 Subject: 2006-02-20 Daniel Berlin * 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 --- gcc/tree-ssa-operands.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'gcc/tree-ssa-operands.c') 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 { -- cgit v1.2.1