On 7/27/2026 2:44 AM, Roger Sayle wrote:
This patch resolves PR rtl-optimization/126276 which is a target-specific
regression on CRIS, triggered by a recent RTL simplification improvement.
The underlying problem is that cris.md's *cbranch<mode>4_btstrq1_<CC>
accepts more machines modes than the define_insn it is lowering to.
Fixed by adding the necessary modes to the *btst<mode> define_insn.
This change restores the ability to build a cross-compiler to cris-elf,
and generates the same code for Jeff's reduced test case as previously.
Tested by building an uber-tree to cris-elf from x86_64-pc-linux-gnu,
with make and make -k check, with no new failures relative to a baseline
that has the triggering simplify-rtx.cc change reverted. Ok for mainline?
2026-07-27 Roger Sayle <[email protected]>
gcc/ChangeLog
PR target/126276
* config/cris/cris.md (*btst<BWD><ZnNNZSET): Handle BWD modes,
not just SImode.
(*cbranch<mode>4_btstrq1_<CC>): Likewise.
(*cbranch<mode>4_btstqb0_<CC>): Likewise.
Thanks in advance and sorry for the inconvenience.
Thanks. Threw that into my tester, the build succeeds, so that's
progress. However, I am seeing regressions relative to the prior good
run. I can't trivially cut-and-paste them over, but I bet if you
started with either gcc.dg/constructor-1 or gcc.dg/ipa/pr70306 you'd
likely cover the initpri tests over in c-c++-common that have also
regressed. These were execution failures, so hoping there'd be a diff
in the generated assembly code, else it could be in the library. Also
note, it's been a week or two with no results, so it's even possible
there's some other bug that's snuck into the tree affecting cris.
jeff