On 11/18/26 1:42 AM, Sebastian Huber wrote:
The GR712RC workaround for GRLIB-TN-0012 missed a floating-point
operation at the target of an integer branch if the epilogue started at
the target.  The zero-length frame blockage of the epilogue was the next
active insn after the label, so no NOP was inserted before the
floating-point operation.  Newlib ceilf() and floorf() compiled with
-mcpu=leon3 -mfix-gr712rc -O2 contained such a sequence.  The UT700
check for an atomic instruction at a branch target used the same lookup.

Use next_active_non_empty_insn() to find the instruction at the branch
target.

Assisted-by: Claude Opus 5.5

gcc/ChangeLog:

        * config/sparc/sparc.cc (sparc_do_work_around_errata): Use
        next_active_non_empty_insn to find the insn at a branch target.

gcc/testsuite/ChangeLog:

        * gcc.target/sparc/fix-gr712rc-1.c: New test.

Signed-off-by: Sebastian Huber <[email protected]>
LGTM and sashiko clean.  OK for the trunk.

jeff

Reply via email to