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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-05-08
     Ever confirmed|0                           |1
           Keywords|                            |wrong-code
          Component|c                           |tree-optimization
             Status|UNCONFIRMED                 |NEW
            Summary|Wrong code at -O3 on        |[12/13/14 Regression] Wrong
                   |x86_64-linux-gnu since      |code at -O1 and above on
                   |GCC-12.2                    |x86_64-linux-gnu since
                   |                            |GCC-12.2

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
ccp2:
Visiting statement:
_16 = (unsigned intD.9) g_15;
which is likely CONSTANT
Lattice value changed to CONSTANT 0xdb (0x20).  Adding SSA edges to worklist.
marking stmt to be not simulated again

Visiting statement:
_17 = _16 + 4294967210;
which is likely CONSTANT
Lattice value changed to CONSTANT 0x85 (0x20).  Adding SSA edges to worklist.
marking stmt to be not simulated again

Visiting statement:
_18 = _17 <= 7;
which is likely CONSTANT
Lattice value changed to CONSTANT 0.  Adding SSA edges to worklist.
marking stmt to be not simulated again


Note this is with -O1 with:
```

int printf(const char *, ...);
int a, b, c, d;
int *e = &c;
static inline unsigned f(unsigned char g) {
  g = 1 | g << 1;
  g = g >> 4 | g << 4;
  return g;
}
static inline void h(unsigned g) { *e = 8 > f(g + 86) - 86; }
int main() {
  d = a && b;
  h(d + 4);
  printf("%d\n", c);
}
```

Reply via email to