Hi gcc-patches mailing list,
Richard Earnshaw <[email protected]> has requested that the following 
forgejo pull request
be published on the mailing list.

Created on: 2025-11-26 14:33:28+00:00
Latest update: 2025-11-26 14:45:26+00:00
Changes: 3 changed files, 146 additions, 17 deletions
Head revision: rearnsha/gcc-TEST ref cbz-range commit 
e97550a7d0e1a8b31a76b0877c0e90a0163da7ee
Base revision: gcc/gcc-TEST ref trunk commit 
b7942104794a754f9927916dfc8931d4bd515648 r16-5630-gb7942104794a75
Merge base: b7942104794a754f9927916dfc8931d4bd515648
Full diff url: https://forge.sourceware.org/gcc/gcc-TEST/pulls/126.diff
Discussion:  https://forge.sourceware.org/gcc/gcc-TEST/pulls/126
Requested Reviewers:

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.

Thanks for taking the time to contribute to GCC!

Please be advised that https://forge.sourceware.org/ is currently a trial
that is being used by the GCC community to experiment with a new workflow
based on pull requests.

Pull requests sent here may be forgotten or ignored. Patches that you want to
propose for inclusion in GCC should use the existing email-based workflow,
see https://gcc.gnu.org/contribute.html


Changed files:
- A: gcc/testsuite/gcc.target/arm/cbz-range.c
- M: gcc/config/arm/arm.cc
- M: gcc/config/arm/thumb2.md


Richard Earnshaw (1):
  arm: handle long-range CBZ/CBNZ patterns [PR122867]

 gcc/config/arm/arm.cc                    |  11 ++-
 gcc/config/arm/thumb2.md                 |  38 +++++---
 gcc/testsuite/gcc.target/arm/cbz-range.c | 114 +++++++++++++++++++++++
 3 files changed, 146 insertions(+), 17 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/arm/cbz-range.c

-- 
2.52.0

Reply via email to