diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-02-01 16:15:56 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-02-01 16:15:56 +0000 |
commit | 16d9b5d830f939df601f2e19e771505e81d1001c (patch) | |
tree | 8d74b657ddb7abcb4ce8827ac122b630da6feef5 /gcc/tree-ssa-loop-im.c | |
parent | 329b958852f169e22d7d2a4c645b5829eee6a478 (diff) |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169487 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop-im.c')
-rw-r--r-- | gcc/tree-ssa-loop-im.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c index 30faeb9319da..57f989782233 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 |