From: Richard Earnshaw <[email protected]>
This has presumably been an issue since the minipool code was first
added, since the recent changes haven't altered the way we skip insns.
However, we need to ignore both note- and debug-insns 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.
---
This is a forge pull request published on the gcc-patches mailing list mailing
list
as requested by Richard Earnshaw via Sourceware Forge
<[email protected]>.
Forge discussion: https://forge.sourceware.org/gcc/gcc/pulls/255
Get it locally using:
```
git fetch forge-upstream "+refs/versioned_pull/255/*:refs/versioned_pull/255/*"
git switch -c "pr-255-v1" "refs/versioned_pull/255/1/head"
```
Or, download the patch at: https://forge.sourceware.org/gcc/gcc/pulls/255.diff
Created on: 2026-10-23 14:45:16+00:00
Latest update: 2026-10-23 14:45:19+00:00
Changes: 1 changed files, 5 additions, 5 deletions
Head revision: rearnsha/gcc ref minipool-debug commit
10956a1fe687e4d5a00f1f554f2c8bffb27cf1ad
Base revision: gcc/gcc ref trunk commit
5b40bde87b479ae1c3968a1fb019ee4029d397d7 r17-5492-g5b40bde87b479a
Merge base: 5b40bde87b479ae1c3968a1fb019ee4029d397d7
Requested Reviewers:
Changed files:
- M: gcc/config/arm/minipool.cc
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 0a95ae378a273..8780120afd107 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);
--
2.54.0