diff options
author | Richard Guenther <rguenther@suse.de> | 2007-05-12 17:21:43 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2007-05-12 17:21:43 +0000 |
commit | c4160806e1a116b18498c97b969cc45e453104ce (patch) | |
tree | f25032dcb72bc99b2224beb492c056771db89662 /gcc/tree-ssa-forwprop.c | |
parent | a747170836486ab3bbe8d16ec5f0c26566a0a0ff (diff) | |
download | gcc-c4160806e1a116b18498c97b969cc45e453104ce.zip gcc-c4160806e1a116b18498c97b969cc45e453104ce.tar.gz gcc-c4160806e1a116b18498c97b969cc45e453104ce.tar.bz2 |
re PR tree-optimization/31797 (infinite loop in tree-ssa-pre or ICE)
2007-05-12 Richard Guenther <rguenther@suse.de>
PR tree-optimization/31797
* tree-ssa-forwprop.c (forward_propagate_addr_expr): Do not
propagate into a stmt that has volatile ops.
* gcc.c-torture/compile/pr31797.c: New testcase.
From-SVN: r124637
Diffstat (limited to 'gcc/tree-ssa-forwprop.c')
-rw-r--r-- | gcc/tree-ssa-forwprop.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c index d91aa89..2afdd9a 100644 --- a/gcc/tree-ssa-forwprop.c +++ b/gcc/tree-ssa-forwprop.c @@ -727,7 +727,7 @@ forward_propagate_addr_expr (tree name, tree rhs) continue; } - /* If the use is in a deeper loop nest, then we do not want + /* If the use is in a deeper loop nest, then we do not want to propagate the ADDR_EXPR into the loop as that is likely adding expression evaluations into the loop. */ if (bb_for_stmt (use_stmt)->loop_depth > stmt_loop_depth) @@ -735,7 +735,14 @@ forward_propagate_addr_expr (tree name, tree rhs) all = false; continue; } - + + /* If the use_stmt has side-effects, don't propagate into it. */ + if (stmt_ann (use_stmt)->has_volatile_ops) + { + all = false; + continue; + } + push_stmt_changes (&use_stmt); result = forward_propagate_addr_expr_1 (name, rhs, use_stmt, |