diff options
author | Richard Guenther <rguenther@suse.de> | 2010-09-07 12:27:45 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-09-07 12:27:45 +0000 |
commit | f5e5b46c4b1720ef7ad0971df215885e2429e41c (patch) | |
tree | bcb021abf33e8bd3d7b7ec7509c879a30427df66 | |
parent | c9d6130e06b8c702faa07071737afa081c008c69 (diff) | |
download | gcc-f5e5b46c4b1720ef7ad0971df215885e2429e41c.zip gcc-f5e5b46c4b1720ef7ad0971df215885e2429e41c.tar.gz gcc-f5e5b46c4b1720ef7ad0971df215885e2429e41c.tar.bz2 |
re PR middle-end/45569 (ICE: verify_stmts failed: statement marked for throw in middle of block with -fnon-call-exceptions)
2010-09-07 Richard Guenther <rguenther@suse.de>
PR middle-end/45569
* tree-eh.c (operation_could_trap_helper_p): Neither COMPLEX_EXPR
nor CONSTRUCTOR can trap.
* tree-complex.c (update_complex_assignment): Update EH info.
* g++.dg/eh/pr45569.C: New testcase.
From-SVN: r163947
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/eh/pr45569.C | 23 | ||||
-rw-r--r-- | gcc/tree-complex.c | 6 | ||||
-rw-r--r-- | gcc/tree-eh.c | 5 |
5 files changed, 45 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6bad390..200f11f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,13 @@ 2010-09-07 Richard Guenther <rguenther@suse.de> PR middle-end/45569 + * tree-eh.c (operation_could_trap_helper_p): Neither COMPLEX_EXPR + nor CONSTRUCTOR can trap. + * tree-complex.c (update_complex_assignment): Update EH info. + +2010-09-07 Richard Guenther <rguenther@suse.de> + + PR middle-end/45569 * tree-cfg.c (build_gimple_cfg): Remove redundant stmt verification. * passes.c (execute_function_todo): Do not verify anything if we saw errors. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 99c91b4..3771742 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-09-07 Richard Guenther <rguenther@suse.de> + + PR middle-end/45569 + * g++.dg/eh/pr45569.C: New testcase. + 2010-09-07 Bernd Schmidt <bernds@codesourcery.com> PR target/43137 diff --git a/gcc/testsuite/g++.dg/eh/pr45569.C b/gcc/testsuite/g++.dg/eh/pr45569.C new file mode 100644 index 0000000..2c100d2 --- /dev/null +++ b/gcc/testsuite/g++.dg/eh/pr45569.C @@ -0,0 +1,23 @@ +// { dg-do compile } +// { dg-options "-O -fnon-call-exceptions" } + +float f (); +_Complex float g (); + +void +i (_Complex float); + +float j () +{ + _Complex float x = 0; + try + { + x = f (); + } + catch ( ...) + { + x += g (); + } + i (x); +} + diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c index 4916571..af85644 100644 --- a/gcc/tree-complex.c +++ b/gcc/tree-complex.c @@ -662,12 +662,16 @@ static void update_complex_assignment (gimple_stmt_iterator *gsi, tree r, tree i) { gimple_stmt_iterator orig_si = *gsi; + gimple stmt; if (gimple_in_ssa_p (cfun)) update_complex_components (gsi, gsi_stmt (*gsi), r, i); gimple_assign_set_rhs_with_ops (&orig_si, COMPLEX_EXPR, r, i); - update_stmt (gsi_stmt (orig_si)); + stmt = gsi_stmt (orig_si); + update_stmt (stmt); + if (maybe_clean_eh_stmt (stmt)) + gimple_purge_dead_eh_edges (gimple_bb (stmt)); } diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c index 66fee8e..2174276 100644 --- a/gcc/tree-eh.c +++ b/gcc/tree-eh.c @@ -2334,6 +2334,11 @@ operation_could_trap_helper_p (enum tree_code op, return true; return false; + case COMPLEX_EXPR: + case CONSTRUCTOR: + /* Constructing an object cannot trap. */ + return false; + default: /* Any floating arithmetic may trap. */ if (fp_operation && flag_trapping_math) |