summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-im.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-02-01 16:15:56 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-02-01 16:15:56 +0000
commit9939e416ee0866f95c7300f25e45fae6d9beb6eb (patch)
tree8d74b657ddb7abcb4ce8827ac122b630da6feef5 /gcc/tree-ssa-loop-im.c
parent4a3c9687cf64bce76107b63a31241a851c8ae119 (diff)
downloadgcc-9939e416ee0866f95c7300f25e45fae6d9beb6eb.tar.gz
re PR tree-optimization/47559 (ICE: verify_stmts failed: statement marked for throw, but doesn't with -fnon-call-exceptions and noexcept)
2011-02-01 Richard Guenther <rguenther@suse.de> PR tree-optimization/47559 * tree-ssa-loop-im.c (can_sm_ref_p): Do not perform store-motion on references that can throw. * g++.dg/torture/pr47559.C: New testcase. From-SVN: r169487
Diffstat (limited to 'gcc/tree-ssa-loop-im.c')
-rw-r--r--gcc/tree-ssa-loop-im.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index 30faeb9319d..57f98978223 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -2318,6 +2318,10 @@ can_sm_ref_p (struct loop *loop, mem_ref_p ref)
|| !for_each_index (&ref->mem, may_move_till, loop))
return false;
+ /* If it can throw fail, we do not properly update EH info. */
+ if (tree_could_throw_p (ref->mem))
+ return false;
+
/* If it can trap, it must be always executed in LOOP.
Readonly memory locations may trap when storing to them, but
tree_could_trap_p is a predicate for rvalues, so check that