diff options
author | Richard Guenther <rguenther@suse.de> | 2011-02-01 16:15:56 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-02-01 16:15:56 +0000 |
commit | 9939e416ee0866f95c7300f25e45fae6d9beb6eb (patch) | |
tree | 8d74b657ddb7abcb4ce8827ac122b630da6feef5 | |
parent | 4a3c9687cf64bce76107b63a31241a851c8ae119 (diff) | |
download | gcc-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
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/torture/pr47559.C | 8 | ||||
-rw-r--r-- | gcc/tree-ssa-loop-im.c | 4 |
4 files changed, 23 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index baf4d945285..fc3482ccd65 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +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. + 2011-02-01 Bernd Schmidt <bernds@codesourcery.com> * tree-dump.c (dump_option_value_info): Add entry for TDF_CSELIB. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8773238cda3..26b7e3e0f3c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-02-01 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/47559 + * g++.dg/torture/pr47559.C: New testcase. + 2011-02-01 Janus Weil <janus@gcc.gnu.org> PR fortran/47565 diff --git a/gcc/testsuite/g++.dg/torture/pr47559.C b/gcc/testsuite/g++.dg/torture/pr47559.C new file mode 100644 index 00000000000..42dedee291c --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr47559.C @@ -0,0 +1,8 @@ +// { dg-do compile } +// { dg-options "-std=c++0x -fnon-call-exceptions" } + +void foo (int *k) noexcept +{ + for (;;) + *k = 0; +} 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 |