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

            Bug ID: 122867
           Summary: thumb cbz/cbnz patterns cannot handle large branch
                    ranges
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rearnsha at gcc dot gnu.org
  Target Milestone: ---

Created attachment 62919
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62919&action=edit
testcase to demonstrate failure

The CBZ and CBNZ in thumb can fall back to a compare and conditional branch if
the range of CBZ is exceeded, but are unable to handle cases where a
conditional branch range is also exceeded; this sequence requires a conditional
branch around another non-conditional branch.

Not a regression since this has been the case since thumb2 support was first
added, but it does cause an assembly failure (for example the attached test
results in:

cc9K8P6I.s: Assembler messages:
cc9K8P6I.s:122: Error: conditional branch out of range
cc9K8P6I.s:147: Error: conditional branch out of range
cc9K8P6I.s:268: Error: conditional branch out of range
cc9K8P6I.s:293: Error: conditional branch out of range

Reply via email to