https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123295
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrew Pinski <[email protected]>: https://gcc.gnu.org/g:c93e74a838c93969ddecaae47b552f14f913f9fd commit r16-6425-gc93e74a838c93969ddecaae47b552f14f913f9fd Author: Andrew Pinski <[email protected]> Date: Fri Dec 26 14:30:22 2025 -0800 LRA: Fix eliminate regs into a subreg inside a debug insn [PR123295] So the problem here is during LRA we are eliminating argp and trying to simplify the RTL as we go but inside a debug insn, almost all subreg are valid due to gen_lowpart_for_debug done during debug insn simplification. So simplify_gen_subreg will fail on some subregs and return null. This causes problems later on. The solution is create a raw SUBREG like what is done in lra_substitute_pseudo for debug insns. Bootstrapped and tested on x86_64-linux-gnu. PR rtl-optimization/123295 gcc/ChangeLog: * lra-eliminations.cc (lra_eliminate_regs_1): For a debug insn, create a raw SUBREG if simplify_gen_subreg fails. gcc/testsuite/ChangeLog: * gcc.dg/pr123295-1.c: New test. Signed-off-by: Andrew Pinski <[email protected]>
