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

            Bug ID: 122675
           Summary: BB reordering for optimizing jump fallthrough is not
                    working
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dimitar at gcc dot gnu.org
  Target Milestone: ---

Created attachment 62787
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62787&action=edit
test.c

Starting with r16-4438-ga93f80feeef744, the attached test case does not
optimize the likely jump as a fallthrough BB edge.

The following code for x86 is expected:
test:
        testl   %edi, %edi
        je      .L3
        subq    $8, %rsp
        call    f1
        addq    $8, %rsp
        ret
.L3:
        movl    %esi, %eax
        ret

Instead this code is generated, with unwanted jump for the likely edge (call to
f1):
test:
.LFB0:
        testl   %edi, %edi
        jne     .L8
        movl    %esi, %eax
        ret
.L8:
        subq    $8, %rsp
        call    f1
        addq    $8, %rsp
        ret

Reply via email to