summaryrefslogtreecommitdiff
path: root/gcc/cfgrtl.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-29 09:30:50 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-29 09:30:50 +0000
commit8c7be932d4c52e939f3cbc5d234c28e9c52f9371 (patch)
treecee46ce3c49ae7d35611696938d3ec097d9852cb /gcc/cfgrtl.c
parent2a4ecd19dcccde445ee059728ccef3520ed772e4 (diff)
downloadgcc-8c7be932d4c52e939f3cbc5d234c28e9c52f9371.tar.gz
2012-03-29 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 185951 using svnmerge git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@185952 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfgrtl.c')
-rw-r--r--gcc/cfgrtl.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index b86cc74b6a4..ea293933704 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -727,6 +727,10 @@ rtl_can_merge_blocks (basic_block a, basic_block b)
if (BB_PARTITION (a) != BB_PARTITION (b))
return false;
+ /* Protect the loop latches. */
+ if (current_loops && b->loop_father->latch == b)
+ return false;
+
/* There must be exactly one edge in between the blocks. */
return (single_succ_p (a)
&& single_succ (a) == b
@@ -2786,6 +2790,10 @@ cfg_layout_can_merge_blocks_p (basic_block a, basic_block b)
if (BB_PARTITION (a) != BB_PARTITION (b))
return false;
+ /* Protect the loop latches. */
+ if (current_loops && b->loop_father->latch == 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. */