[Bug c/121235] Local register variable constraints aren't respected in extended asm
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jul 24 18:02:06 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121235
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|UNCONFIRMED |RESOLVED
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
```
void* inner(unsigned value) {
unsigned t = value;
register void* ret asm("2");
register unsigned a0 asm("4") = t;
__asm__ volatile("\n"
"break; %0 %1\n"
: "=r"(ret) : "r"(a0));
return ret;
}
```
Fixes it for me.
Notice the use of a0 in inline-asm rather than value.
More information about the Gcc-bugs
mailing list