From 662592e1bac8b26f51e4b3c3e694b7d909487d3b Mon Sep 17 00:00:00 2001 From: Bernd Schmidt Date: Fri, 24 Sep 2010 11:29:59 +0000 Subject: [PATCH] cfgcleanup.c (flow_find_head_matching_sequence): Terminate when reaching the end of a block if it occurs at a DEBUG_INSN. * cfgcleanup.c (flow_find_head_matching_sequence): Terminate when reaching the end of a block if it occurs at a DEBUG_INSN. From-SVN: r164589 --- gcc/ChangeLog | 5 +++++ gcc/cfgcleanup.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 619461df4914..7d85ec51f496 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2010-09-24 Bernd Schmidt + + * cfgcleanup.c (flow_find_head_matching_sequence): Terminate when + reaching the end of a block if it occurs at a DEBUG_INSN. + 2010-09-09 Tristan Gingold PR target/44242 diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 6b128ebe549e..9f3e68ee082a 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -1184,7 +1184,6 @@ flow_find_head_matching_sequence (basic_block bb1, basic_block bb2, rtx *f1, while (true) { - /* Ignore notes. */ while (!NONDEBUG_INSN_P (i1) && i1 != BB_END (bb1)) i1 = NEXT_INSN (i1); @@ -1192,6 +1191,10 @@ flow_find_head_matching_sequence (basic_block bb1, basic_block bb2, rtx *f1, while (!NONDEBUG_INSN_P (i2) && i2 != BB_END (bb2)) i2 = NEXT_INSN (i2); + if ((i1 == BB_END (bb1) && !NONDEBUG_INSN_P (i1)) + || (i2 == BB_END (bb2) && !NONDEBUG_INSN_P (i2))) + break; + if (NOTE_P (i1) || NOTE_P (i2) || JUMP_P (i1) || JUMP_P (i2)) break;