diff options
author | Bernd Schmidt <bernds@codesourcery.com> | 2011-11-14 23:31:13 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@gcc.gnu.org> | 2011-11-14 23:31:13 +0000 |
commit | 894a84b5ed98b1fcf565f462f364db0e3d769831 (patch) | |
tree | 077e15975c6c73524eb38086ddfaaaa17a163d7b /gcc/cfgrtl.c | |
parent | 2747a04662929c37d3bcc96c36adc861a4611710 (diff) | |
download | gcc-894a84b5ed98b1fcf565f462f364db0e3d769831.zip gcc-894a84b5ed98b1fcf565f462f364db0e3d769831.tar.gz gcc-894a84b5ed98b1fcf565f462f364db0e3d769831.tar.bz2 |
re PR rtl-optimization/51051 (build fails on cris-elf building libstdc++-v3)
PR rtl-optimization/51051
* cfgrtl.c (cfg_layout_can_merge_blocks_p): Return FALSE if the
move would cause fallthrough into the exit block.
From-SVN: r181371
Diffstat (limited to 'gcc/cfgrtl.c')
-rw-r--r-- | gcc/cfgrtl.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 16e2eb3..aeb4ba1 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -2735,6 +2735,16 @@ cfg_layout_can_merge_blocks_p (basic_block a, basic_block b) if (BB_PARTITION (a) != BB_PARTITION (b)) return false; + /* If we would end up moving B's instructions, make sure it doesn't fall + through into the exit block, since we cannot recover from a fallthrough + edge into the exit block occurring in the middle of a function. */ + if (NEXT_INSN (BB_END (a)) != BB_HEAD (b)) + { + edge e = find_fallthru_edge (b->succs); + if (e && e->dest == EXIT_BLOCK_PTR) + return false; + } + /* There must be exactly one edge in between the blocks. */ return (single_succ_p (a) && single_succ (a) == b |