https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104243
Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|WAITING |RESOLVED --- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> --- Simpler reproducer: $ cat repro.cc int __attribute__((pure)) foo(int *x); int main() { int a; int r = foo (&a); if (a != 123) __builtin_abort (); } $ cat repro2.cc int __attribute__((pure)) foo(int *x) { *x = 123; return 0; } $ gcc repro*.cc -O2 && ./a.out Aborted (core dumped)