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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|wrong code at -O2 and -O3   |[12 Regression] wrong code
                   |on x86_64-linux-gnu         |at -O1 -ftree-vrp
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-10-13

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Take:

int a, b = -1, c;
int d = 1;
static inline char e(char f, int g) { return g ? f : 0; }
static inline char h(char f) { return f < a ? f : f < a; }
static inline unsigned char i(unsigned char f, int g) { return g ? f : f > g; }
void j() {
L:
  c = e(1, i(h(b), d));
  if (b)
    return;
  goto L;
}
int main() {
  j();
  if (c != 1)
    __builtin_abort ();
  return 0;
}
---- CUT ----
This fails at -O1 -ftree-vrp or -O2 and above.

Reply via email to