https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102441
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Known to fail| |10.3.1, 11.2.1 Target| |x86_64-*-* Status|UNCONFIRMED |NEW Known to work| |7.5.0 Summary|Incorrect location list in |[10/11/12 Regression] |debug info |Incorrect location list in | |debug info Component|debug |rtl-optimization Target Milestone|--- |10.4 Last reconfirmed| |2021-09-22 Keywords| |wrong-debug Priority|P3 |P2 Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- probably a var-tracking issue. Works with GCC 7 and (noipa doesn't exist): void __attribute__((noinline,noclone)) not_opt_this(int *r) { __asm__ volatile ("" : : :"memory"); } int __attribute__((noinline)) foo(int x) { int r = 0; not_opt_this(&r); return r; } int main (void) { return foo (10); } GCC 7 prints the correct value, GCC 9 prints <optimized out>