aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgcleanup.c
diff options
context:
space:
mode:
authorSteven Bosscher <stevenb@suse.de>2005-11-27 12:42:33 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2005-11-27 12:42:33 +0000
commitb604fe9b84e41f387222758a300dce02a39a6b1b (patch)
tree3275a36b973741ba9113ada9078449fb83e19c2a /gcc/cfgcleanup.c
parentb87ff3358b240c0438c8a7428d1e4b5d2b25eec7 (diff)
downloadgcc-b604fe9b84e41f387222758a300dce02a39a6b1b.zip
gcc-b604fe9b84e41f387222758a300dce02a39a6b1b.tar.gz
gcc-b604fe9b84e41f387222758a300dce02a39a6b1b.tar.bz2
cfgcleanup.c (try_crossjump_to_edge): Always split SRC2 if it has EH predecessor edges.
* cfgcleanup.c (try_crossjump_to_edge): Always split SRC2 if it has EH predecessor edges. From-SVN: r107565
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r--gcc/cfgcleanup.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 66a0dec..7e3cb0e 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -1572,11 +1572,23 @@ try_crossjump_to_edge (int mode, edge e1, edge e2)
}
}
- /* Avoid splitting if possible. */
- if (newpos2 == BB_HEAD (src2))
+ /* Avoid splitting if possible. We must always split when SRC2 has
+ EH predecessor edges, or we may end up with basic blocks with both
+ normal and EH predecessor edges. */
+ if (newpos2 == BB_HEAD (src2)
+ && !(EDGE_PRED (src2, 0)->flags & EDGE_EH))
redirect_to = src2;
else
{
+ if (newpos2 == BB_HEAD (src2))
+ {
+ /* Skip possible basic block header. */
+ if (LABEL_P (newpos2))
+ newpos2 = NEXT_INSN (newpos2);
+ if (NOTE_P (newpos2))
+ newpos2 = NEXT_INSN (newpos2);
+ }
+
if (dump_file)
fprintf (dump_file, "Splitting bb %i before %i insns\n",
src2->index, nmatch);