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

            Bug ID: 113533
           Summary: [14 Regression] Code generation regression after
                    change for pr111267
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: law at gcc dot gnu.org
  Target Milestone: ---

sh3-linux-gnu or sh3eb-linux-gnu is showing a code generation regression after
the changes for pr111267.

test_01 with -O1 shows the problem nicely:

int
test_01 (unsigned char* a)
{
  /* 1x cmp/pz, 1x addc  */
  return a[0] + (a[0] < 128);
}

Before:

test_01:
        mov.b   @r4,r1
        extu.b  r1,r0
        cmp/pz  r1
        mov     #0,r1
        rts
        addc    r1,r0


After:

test_01:
        mov.b   @r4,r0
        extu.b  r0,r0
        mov.b   @r4,r1
        cmp/pz  r1
        mov     #0,r1
        rts
        addc    r1,r0


Note the extra memory load.

I'm not actively working on this.

Reply via email to