https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127188

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Georg-Johann Lay <[email protected]>:

https://gcc.gnu.org/g:740716f3b13102b93489eec8f3238aa1f356fe0b

commit r17-3920-g740716f3b13102b93489eec8f3238aa1f356fe0b
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.

Reply via email to