From patchwork Sun Sep 5 13:06:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [PR,debug/45531] skip debug insns in cfglayout:fixup_reorder_chain Date: Sun, 05 Sep 2010 03:06:11 -0000 From: Alexandre Oliva X-Patchwork-Id: 63827 Message-Id: To: gcc-patches@gcc.gnu.org We don't hit this very often because debug insns aren't emitted without optimization unless explicitly requested, and with optimization this seems not to arise. Anyhow, it's easy enough to fix the code so that, even if it arises, we don't misbehave. Regstrapping on x86_64-linux-gnu. Ok to install? for gcc/ChangeLog from Alexandre Oliva PR debug/45531 * cfglayout.c (fixup_reorder_chain): Skip debug insns. Index: gcc/cfglayout.c =================================================================== --- gcc/cfglayout.c.orig 2010-09-05 09:42:08.000000000 -0300 +++ gcc/cfglayout.c 2010-09-05 09:46:10.000000000 -0300 @@ -955,7 +955,7 @@ fixup_reorder_chain (void) insn = BB_END (e->src); end = PREV_INSN (BB_HEAD (e->src)); while (insn != end - && (!INSN_P (insn) || INSN_LOCATOR (insn) == 0)) + && (!NONDEBUG_INSN_P (insn) || INSN_LOCATOR (insn) == 0)) insn = PREV_INSN (insn); if (insn != end && locator_eq (INSN_LOCATOR (insn), (int) e->goto_locus)) @@ -970,7 +970,7 @@ fixup_reorder_chain (void) { insn = BB_HEAD (e->dest); end = NEXT_INSN (BB_END (e->dest)); - while (insn != end && !INSN_P (insn)) + while (insn != end && !NONDEBUG_INSN_P (insn)) insn = NEXT_INSN (insn); if (insn != end && INSN_LOCATOR (insn) && locator_eq (INSN_LOCATOR (insn), (int) e->goto_locus))