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

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

https://gcc.gnu.org/g:9d09d474b84bb93fea153ea0195800d550185496

commit r17-5111-g9d09d474b84bb93fea153ea0195800d550185496
Author: Yongqiang Tian <[email protected]>
Date:   Tue Oct 13 06:39:38 2026 -0600

    [PATCH 1/2] reorg: Ignore debug insns in BARRIER checks [PR127808]

    relax_delay_slots checks whether a BARRIER immediately precedes a jump
    target at two sites.  pass_cleanup_barriers can place a DEBUG_INSN
    between the BARRIER and CODE_LABEL, so prev_nonnote_insn makes both
    decisions depend on whether debug information is present.

    Use prev_nonnote_nondebug_insn for both queries.  Add two SPARC tests
    covering the separate decisions.

    This follows up Jeff Law's review of the patch for PR127795, which
    pointed out that these BARRIER queries could potentially depend on
    DEBUG_INSN placement.  I initially replied that I had not seen GCC put
    a DEBUG_INSN in that position.  Further investigation showed that
    pass_cleanup_barriers can create exactly that sequence, so this patch
    corrects that earlier conclusion.

    Tested at GCC revision a02e2004cb707155d5b9b0a82dd428ded0ee2f6f:

    * Instrumented baseline runs confirm that the first and second SPARC
      tests reach the first and second modified queries, respectively.
      Both fail without this patch and pass with it.
    * A complete sparc-elf `make -k -j8 check-gcc` comparison has no
      regressions.
    * Native x86_64-pc-linux-gnu `make -j24 bootstrap` and
      `make -k -j24 check` completed with and without the two-patch series.
      After normalizing build paths, both produced the same outcomes:
      621579 PASS, 6 FAIL, 1 XPASS, 4872 XFAIL, and 8114 UNSUPPORTED.
    * `contrib/check_GNU_style.sh` and `git diff --check` pass.

    Assisted-by: OpenAI Codex 5.6 Sol, co-reviewed by Claude and Yongqiang
Tian.

            PR rtl-optimization/127808

    gcc/ChangeLog:

            * reorg.cc (relax_delay_slots): Ignore debug insns when looking for
            a BARRIER before a jump target.

    gcc/testsuite/ChangeLog:

            * gcc.target/sparc/reorg-relax-barrier-debug-1.c: New test.
            * gcc.target/sparc/reorg-relax-barrier-debug-2.c: New test.

    Signed-off-by: Yongqiang Tian <[email protected]>

Reply via email to