diff options
author | Michael Matz <matz@suse.de> | 2009-11-26 15:54:07 +0000 |
---|---|---|
committer | Michael Matz <matz@gcc.gnu.org> | 2009-11-26 15:54:07 +0000 |
commit | 87cd42599c846abbaf7a4ea063e594e68a175a5a (patch) | |
tree | cd15fcca6d3d4e5c519f24b570af912dd9b6ea69 /gcc/tree-eh.c | |
parent | 6dc3bf569b32983d2c2322d32458f8b28564d8b3 (diff) | |
download | gcc-87cd42599c846abbaf7a4ea063e594e68a175a5a.zip gcc-87cd42599c846abbaf7a4ea063e594e68a175a5a.tar.gz gcc-87cd42599c846abbaf7a4ea063e594e68a175a5a.tar.bz2 |
tree-eh.c (lower_eh_constructs_2): Don't add assignments below statements that can't fall thru.
* tree-eh.c (lower_eh_constructs_2): Don't add assignments
below statements that can't fall thru.
testsuite/
* g++.dg/tree-ssa/pr41905.C: New testcase.
From-SVN: r154674
Diffstat (limited to 'gcc/tree-eh.c')
-rw-r--r-- | gcc/tree-eh.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c index 21da534..dde343c 100644 --- a/gcc/tree-eh.c +++ b/gcc/tree-eh.c @@ -1868,9 +1868,12 @@ lower_eh_constructs_2 (struct leh_state *state, gimple_stmt_iterator *gsi) case GIMPLE_ASSIGN: /* If the stmt can throw use a new temporary for the assignment to a LHS. This makes sure the old value of the LHS is - available on the EH edge. */ + available on the EH edge. Only do so for statements that + potentially fall thru (no noreturn calls e.g.), otherwise + this new assignment might create fake fallthru regions. */ if (stmt_could_throw_p (stmt) && gimple_has_lhs (stmt) + && gimple_stmt_may_fallthru (stmt) && !tree_could_throw_p (gimple_get_lhs (stmt)) && is_gimple_reg_type (TREE_TYPE (gimple_get_lhs (stmt)))) { |