[Bug target/103882] Register corruption in ASM only functions when optization is -O2/-Os/-O3

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Jan 1 16:37:30 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103882

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That is just a total misunderstanding why the compiler needs to know (be told)
the observable side-effects of the inline asm.  Interprocedural optimizations
are just one of the many reasons, much more important is that it needs to know
what the inline asm does for code generation within the function, it needs to
know in which registers or memory it can spill values live across the inline
asm etc.
Don't use inline asm if you are unable or not willing to tell the compiler how
it behaves.


More information about the Gcc-bugs mailing list