diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-24 02:54:06 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-24 02:54:06 +0000 |
commit | f2fae51fba2928d03271b3d73408b90947832974 (patch) | |
tree | 83e8422ca8c90a302030075b4f2619a0b55f42df /gcc/tree-ssa-propagate.c | |
parent | 22bcc29fa42a74e3669b6997e29b8b584f4fd25b (diff) | |
download | gcc-f2fae51fba2928d03271b3d73408b90947832974.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100092 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-propagate.c')
-rw-r--r-- | gcc/tree-ssa-propagate.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c index ee8b1652627..865853df1e1 100644 --- a/gcc/tree-ssa-propagate.c +++ b/gcc/tree-ssa-propagate.c @@ -1052,8 +1052,10 @@ substitute_and_fold (prop_value_t *prop_value) if (did_replace) { tree old_stmt = stmt; + tree rhs; + fold_stmt (bsi_stmt_ptr (i)); - stmt = bsi_stmt(i); + stmt = bsi_stmt (i); /* If we folded a builtin function, we'll likely need to rename VDEFs. */ @@ -1063,6 +1065,10 @@ substitute_and_fold (prop_value_t *prop_value) remove EH edges. */ if (maybe_clean_or_replace_eh_stmt (old_stmt, stmt)) tree_purge_dead_eh_edges (bb); + + rhs = get_rhs (stmt); + if (TREE_CODE (rhs) == ADDR_EXPR) + recompute_tree_invarant_for_addr_expr (rhs); } if (dump_file && (dump_flags & TDF_DETAILS)) |