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

--- Comment #1 from Zhendong Su <zhendong.su at inf dot ethz.ch> ---
Another related test that triggers the miscompilation at -Os, but not -O1: 

[621] % gcctk -O1 small.c; ./a.out
[622] % 
[622] % gcctk -Os small.c; ./a.out
Aborted
[623] % 
[623] % cat small.c
int a;

int b(int c) { return 0; }

static int *d(int *e) {
  if (a) {
    a = a && b(*e);
  }
  return e;
}

int main() {
  int f;
  if (d(&f) != &f)
    __builtin_abort();
  return 0;
}

Reply via email to