https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114437
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |DUPLICATE --- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to xog4nar4 from comment #3) > Just to confirm, is this an incorrect constraint for the intended goal of > convincing the compiler that the value is used and modified, without > actually doing either and preserving the value, or am I just using it wrong > in this particular example? I'm somewhat surprised since this inline asm > snippet is used in multiple well-known micro-benchmarking libraries. > > > Is the following version correct? > ``` > asm volatile("" : "=m,r"(arg) : "0,0"(arg) : "memory"); > ``` The correct way of implementing this inline-asm is don't. Oh and the above does not work either because a constraint of `"=m":"0"` is also not going to work. Inline-asm is really NOT designed for this purpose at all and abusing it this way is just going to run into these issues. *** This bug has been marked as a duplicate of bug 92597 ***