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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Richard Earnshaw
<[email protected]>:

https://gcc.gnu.org/g:5de80e305c82dc113b24de152671bf3b572a9f7c

commit r14-12179-g5de80e305c82dc113b24de152671bf3b572a9f7c
Author: Richard Earnshaw <[email protected]>
Date:   Tue Nov 25 15:47:05 2025 +0000

    arm: handle long-range CBZ/CBNZ patterns [PR122867]

    The CBN?Z instructions have a very small range (just 128 bytes
    forwards).  The compiler knows how to handle cases where we
    exceed that, but only if the range remains within that which
    a condition branch can support.  When compiling some machine
    generated code it is not too difficult to exceed this limit,
    so arrange to fall back to a conditional branch over an
    unconditional one in this extreme case.

    gcc/ChangeLog:
            PR target/122867
            * config/arm/arm.cc (arm_print_operand): Use %- to
            emit LOCAL_LABEL_PREFIX.
            (arm_print_operand_punct_valid_p): Allow %- for punct
            and make %_ valid for all compilation variants.
            * config/arm/thumb2.md (*thumb2_cbz): Handle very
            large branch ranges that exceed the limit of b<cond>.
            (*thumb2_cbnz): Likewise.

    gcc/testsuite/ChangeLog:
            PR target/122867
            * gcc.target/arm/cbz-range.c: New test.

    (cherry picked from commit e97550a7d0e1a8b31a76b0877c0e90a0163da7ee)

Reply via email to