https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103006
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[9/10/11/12 Regression] |[9/10/11/12 Regression]
|wrong code at -O2 (only) on |wrong code at -O1 or -O2 on
|x86_64-linux-gnu |x86_64-linux-gnu
Component|tree-optimization |middle-end
Known to fail| |8.1.0
Target Milestone|--- |9.5
Keywords| |wrong-code
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Since noipa does not work with GCC 7, the following fails all the back to GCC
7:
__attribute__((noipa,noinline,noclone)) void ff(void){asm("":::"memory");}
int a, *b, c, e, f;
__attribute__((always_inline))
static inline void g() {
int *d[7];
d[6] = b = (int *)d;
ff();
}
__attribute__((noinline))
int i() {
for (c = 0; c < 2; c++) {
long h[6][2];
for (e = 0; e < 6; e++)
for (f = 0; f < 2; f++)
h[e][f] = 1;
if (c) {
g();
return h[3][0];
}
}
return 0;
}
int main() {
if (i() != 1)
__builtin_abort ();
return 0;
}