You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see, the generated code clearly expects the rbp to not be clobbered after the inline assembly.
Godbolt link: https://godbolt.org/z/osMEb1Kcj
This resulted in an actual bug in tinygo-org/tinygo#3103 (comment) where I try to call functions with a custom ABI via inline assembly.
Ideally the X86 backend should save the rbp register somewhere else (for example, on the stack: rsp is not clobbered) or just throw an error. Silently miscompiling results in bugs.
The text was updated successfully, but these errors were encountered:
The
rbp
register can be clobbered by inline assembly, like so:This results in the following expected assembly:
However, when a frame pointer is forced, this clobber constraint is not respected:
As you can see, the generated code clearly expects the
rbp
to not be clobbered after the inline assembly.Godbolt link: https://godbolt.org/z/osMEb1Kcj
This resulted in an actual bug in tinygo-org/tinygo#3103 (comment) where I try to call functions with a custom ABI via inline assembly.
Ideally the X86 backend should save the
rbp
register somewhere else (for example, on the stack:rsp
is not clobbered) or just throw an error. Silently miscompiling results in bugs.The text was updated successfully, but these errors were encountered: