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

            Bug ID: 118755
           Summary: [15 Regression] ccmp_3.c fails on aarch64
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: missed-optimization, testsuite-fail
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: pinskia at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64

FAIL: gcc.target/aarch64/ccmp_3.c scan-assembler-not \tcbnz\t

This one is not recorded and it is different from the other issues that were
caused by the fix from PR 101523.

The IR before combine:
```
(insn 11 8 13 2 (set (reg:SI 108)
        (eq:SI (reg:CC 66 cc)
            (const_int 0 [0]))) "/app/example.cpp":7:18 443 {aarch64_cstoresi}
     (expr_list:REG_DEAD (reg:CC 66 cc)
        (nil)))
(insn 13 11 15 2 (set (reg/v:SI 104 [ <retval> ])
        (zero_extend:SI (subreg:QI (reg:SI 108) 0))) "/app/example.cpp":7:18
114 {*zero_extendqisi2_aarch64}
     (expr_list:REG_DEAD (reg:SI 108)
        (nil)))
(insn 15 13 16 2 (set (reg:SI 109)
        (and:SI (reg/v:SI 104 [ <retval> ])
            (const_int 1 [0x1]))) "/app/example.cpp":8:6 504 {andsi3}
     (nil))
(insn 16 15 17 2 (set (reg:CC 66 cc)
        (compare:CC (reg:SI 109)
            (const_int 0 [0]))) "/app/example.cpp":8:6 405 {cmpsi}
     (expr_list:REG_DEAD (reg:SI 109)
        (nil)))
```

Notice 109 is used again later on for the return value.


The testcase:
```
void foo(void);
int f1(int a, int b)
{
  int c = a == 0 || b == 0;
  if (c) foo();
  return c;
}
```

One thing to note here is that the trunk does shrink wrap now too.

Reply via email to