aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dom.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2005-05-23 20:54:06 -0600
committerJeff Law <law@gcc.gnu.org>2005-05-23 20:54:06 -0600
commit6cedb4acda3240c6a7914834f812aa2e86fa7687 (patch)
tree83e8422ca8c90a302030075b4f2619a0b55f42df /gcc/tree-ssa-dom.c
parent0d14c01130fe9b1712c0933a30ed14be8c42c469 (diff)
downloadgcc-6cedb4acda3240c6a7914834f812aa2e86fa7687.zip
gcc-6cedb4acda3240c6a7914834f812aa2e86fa7687.tar.gz
gcc-6cedb4acda3240c6a7914834f812aa2e86fa7687.tar.bz2
tree-ssa-dom.c (cprop_into_stmt): Do not call recompute_tree_invariant_for_addr_expr here.
* tree-ssa-dom.c (cprop_into_stmt): Do not call recompute_tree_invariant_for_addr_expr here. (optimize_stmt): Call it here instead and do so if anything at all has changed in the statement and the RHS is an ADDR_EXPR. * tree-ssa-forwprop.c (tidy_after_forward_propagate_addr): If needed, call recompute_tree_invariant_for_addr_expr. * tree-ssa-propagate.c (substitute_and_fold): Call recompute_tree_invariant_for_addr_expr as needed. * gcc.c-torture/compile/pr21638.c: New test. * gcc.c-torture/compile/20050520-1.c: New test. From-SVN: r100092
Diffstat (limited to 'gcc/tree-ssa-dom.c')
-rw-r--r--gcc/tree-ssa-dom.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 692dd70..278d27a 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -2908,7 +2908,6 @@ cprop_into_stmt (tree stmt)
bool may_have_exposed_new_symbols = false;
use_operand_p op_p;
ssa_op_iter iter;
- tree rhs;
FOR_EACH_SSA_USE_OPERAND (op_p, stmt, iter, SSA_OP_ALL_USES)
{
@@ -2916,13 +2915,6 @@ cprop_into_stmt (tree stmt)
may_have_exposed_new_symbols |= cprop_operand (stmt, op_p);
}
- if (may_have_exposed_new_symbols)
- {
- rhs = get_rhs (stmt);
- if (rhs && TREE_CODE (rhs) == ADDR_EXPR)
- recompute_tree_invarant_for_addr_expr (rhs);
- }
-
return may_have_exposed_new_symbols;
}
@@ -2971,6 +2963,8 @@ optimize_stmt (struct dom_walk_data *walk_data, basic_block bb,
fold its RHS before checking for redundant computations. */
if (ann->modified)
{
+ tree rhs;
+
/* Try to fold the statement making sure that STMT is kept
up to date. */
if (fold_stmt (bsi_stmt_ptr (si)))
@@ -2985,6 +2979,10 @@ optimize_stmt (struct dom_walk_data *walk_data, basic_block bb,
}
}
+ rhs = get_rhs (stmt);
+ if (rhs && TREE_CODE (rhs) == ADDR_EXPR)
+ recompute_tree_invarant_for_addr_expr (rhs);
+
/* Constant/copy propagation above may change the set of
virtual operands associated with this statement. Folding
may remove the need for some virtual operands.