]> git.ipfire.org Git - thirdparty/gcc.git/commit
VAX: Fix ICE in fixup_reorder_chain when building gimple_match.cc [PR112400]
authorKalvis Duckmanton <kalvisd@gmail.com>
Sat, 14 Feb 2026 15:10:15 +0000 (15:10 +0000)
committerMaciej W. Rozycki <macro@orcam.me.uk>
Sat, 14 Feb 2026 15:10:15 +0000 (15:10 +0000)
commit8a9490979b97d6ce3498fde891b04597a48925ed
tree7dacc112aa7cc79eec565065924aee3af0567257
parentfeda1cfe152e2d74ddc66278448b2cb8ec1f6234
VAX: Fix ICE in fixup_reorder_chain when building gimple_match.cc [PR112400]

When cross-compiling itself for VAX, GCC terminates abruptly with an ICE
when compiling gimple_match.cc; the root cause seems to be an
incompletely removed computed jump instruction, which causes the
assertion in cfgrtl.cc around line 4083, to no longer hold.

I have verified that the problem is present in GCC 15.2.0 and believe
that it's also present in trunk (based on the fact that the patterns for
the "casesi1" and "*casesi1" instructions in 15.2.0 and trunk are the
same).

To fix this issue wrap the limit operand in a USE, to allow `single_set'
to identify it as an RTL expression setting PC.  This allows the
optimizer to optimize away case statements branching only to a basic
block, removing the ICE.

Include a test case reduced from gimple_match.cc, which demonstrates the
problem in GCC 15.2.0 on NetBSD/amd64 cross-compiling for VAX.

gcc/
PR target/112400
* config/vax/vax.md (casesi1): Wrap naked operand 1 with a USE
where used with the insn split to.
(*casesi1): Likewise naked incoming operand 1.

gcc/testsuite/
PR target/112400
* g++.dg/torture/pr112400.C: New file.
gcc/config/vax/vax.md
gcc/testsuite/g++.dg/torture/pr112400.C [new file with mode: 0644]