https://gcc.gnu.org/g:1d1105eefe924996d277187a70b4e98602391e4f
commit r17-5634-g1d1105eefe924996d277187a70b4e98602391e4f Author: Richard Earnshaw <[email protected]> Date: Fri Oct 23 15:35:12 2026 +0100 arm: skip debug insns when processing minipool [PR128090] This has presumably been an issue since debug insns were first added, since the recent changes haven't altered the way we skip insns. However, we need to ignore debug insns as well as notes when building the minipool since neither is relevant to the process. The fix is to consistently use next_nonnote_nondebug_insn during this pass. gcc/ChangeLog: PR target/128090 * config/arm/minipool.cc (barrier_cost): Advance through the insn chain with next_nonnote_nondebug_insn. (minipool::create_fix_barrier): Likewise. (place_minipools): Likewise. Diff: --- gcc/config/arm/minipool.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/config/arm/minipool.cc b/gcc/config/arm/minipool.cc index 0a95ae378a27..8780120afd10 100644 --- a/gcc/config/arm/minipool.cc +++ b/gcc/config/arm/minipool.cc @@ -462,7 +462,7 @@ barrier_cost (rtx_insn *insn) the moment, the basic block information seems to be corrupt by this stage of the compilation. */ int base_cost = 50; - rtx_insn *next = next_nonnote_insn (insn); + rtx_insn *next = next_nonnote_nondebug_insn (insn); if (next != NULL && LABEL_P (next)) base_cost -= 20; @@ -1108,7 +1108,7 @@ minipool::create_fix_barrier (Mfix *fix, minipool_address max_address) } /* Continue after the dispatch table. */ - from = NEXT_INSN (tmp); + from = next_nonnote_nondebug_insn (tmp); continue; } @@ -1122,7 +1122,7 @@ minipool::create_fix_barrier (Mfix *fix, minipool_address max_address) selected_address = fix->address + count; } - from = NEXT_INSN (from); + from = next_nonnote_nondebug_insn (from); } /* Make sure that we found a place to insert the jump. */ @@ -1328,8 +1328,8 @@ place_minipools (void) gcc_assert (NOTE_P (insn)); /* Scan all the insns and record the operands that will need fixing. */ - for (insn = next_nonnote_insn (insn); insn; - insn = next_nonnote_insn (insn)) + for (insn = next_nonnote_nondebug_insn (insn); insn; + insn = next_nonnote_nondebug_insn (insn)) { if (BARRIER_P (insn)) push_minipool_barrier (insn, address);
