https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127692
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-15 branch has been updated by Stefan Schulze Frielinghaus <[email protected]>: https://gcc.gnu.org/g:5520d9015271436846f9a66a9f3a2ace9bcf8f39 commit r15-11678-g5520d9015271436846f9a66a9f3a2ace9bcf8f39 Author: Stefan Schulze Frielinghaus <[email protected]> Date: Fri Oct 23 20:02:22 2026 +0200 s390: Fix bswap:HI reg-reg splitter [PR127692] The splitter could fire before register allocation for which the attached test ICEs. There we end up for operands[1] with (subreg:HI (reg:HF 70) 0) for which simplify_gen_subreg tries to fold two subregs into (subreg:SI (reg:HF 70) 0) which is invalid. For an invalid simplification NULL_RTX is returned which is just propagated and dereferenced later on leading to an ICE. The splitter is supposed to fire only after register allocation once we decided to go for the GPR alternative in bswaphi2. This also solves the initial problem since after RA we should only deal with hard registers and simplify_gen_subreg folds subregs of GPRs (additionally this solves the problem of using a paradoxical subreg as a left-hand side operand). As a safety net, still test for NULL_RTX which would lead to more descriptive ICEs. PR target/127692 gcc/ChangeLog: * config/s390/s390.md: Fix bswap:HI reg-reg splitter. Co-authored-by: Jakub Jelinek <[email protected]> (cherry picked from commit 1de4393ddec6ce2980184f32b0fd428c54d82a20)
