https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113293
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Keywords| |inline-asm Resolution|--- |INVALID --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- The inline-asm is not marking as clobbering memory. In this case since you just pass the address of the variable, gcc does not know the inline-asm will read memory at all, it deletes the store. Anyways adding "memory" as a clobber to the inline-asm, fixes the issue.