https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127188
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-16 branch has been updated by Georg-Johann Lay <[email protected]>: https://gcc.gnu.org/g:f91449daed2c83ef4c0d69430216dc6bfddd56bc commit r16-9630-gf91449daed2c83ef4c0d69430216dc6bfddd56bc Author: Georg-Johann Lay <[email protected]> Date: Fri Sep 4 13:14:10 2026 +0200 AVR: target/127188 - Fix -fcompare-debug fail The transformations performed by the avr-2moves pass might depend on the presence of debug insns, which is fixed by this patch. It now uses next_nondebug_insn_bb() to traverses the insns in such a way that the seen insns don't depend on the presence of debug insns. Plus, it ignores debug insns when it traverses the DF_REG_USE_CHAIN of the considered register. The patch passes without new regression. It fixes gcc.dg/pr103837.c (test for excess errors) gcc.dg/pr45865.c (test for excess errors) which failed with -fcompare-debug. PR target/127188 gcc/ * config/avr/avr-passes.cc (avr_pass_2moves) <optimize_2moves_bb>: Use next_nondebug_insn_bb to traverse the insns. <optimize_2moves>: Ignore degug insns when traversing DF_REG_USE_CHAIN. gcc/testsuite/ * gcc.target/avr/pr127188.c: New test. (cherry picked from commit 740716f3b13102b93489eec8f3238aa1f356fe0b)
