https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127153
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-16 branch has been updated by Xi Ruoyao <[email protected]>: https://gcc.gnu.org/g:3c902c5144ff29f5d92f2d5924bb38ec3c882983 commit r16-9648-g3c902c5144ff29f5d92f2d5924bb38ec3c882983 Author: Xi Ruoyao <[email protected]> Date: Mon Aug 31 16:18:12 2026 +0800 LoongArch: fix miscompile of both_non_zero{,_subreg} when operands[0] == operands[2] [PR 127153] Here operands[0] is written before the instruction is finished using operands[2] so it cannot lie in a register that is read by the instruction. Thus it should be an earlyclobber operand. As operands[1] is only used before the early result is written, it can be tied to the earlyclobber operand so explicitly allow doing so. Defer the split after reload as constrants do not apply to pseudos. PR target/127153 gcc/ * config/loongarch/loongarch.md (both_non_zero): Defer the split post reload and add constraint to ensure operands[0] and operands[2] are in different hard registers. (both_non_zero_subreg): Likewise. gcc/testsuite/ * c-c++-common/pr127153.c: New test. (cherry picked from commit 85c39785487e242162cdc28675b334ad23951edb)
