Andrew Haley <a...@redhat.com> writes: > Over the years there has been a great deal of traffic on these lists > caused by misunderstandings of GCC's inline assembler. That's partly > because it's inherently tricky, but the existing documentation needs > to be improved. > > dw <limegreenso...@yahoo.com> has done a fairly thorough reworking of > the documentation. I've helped a bit.
It would be nice if you could include some discussion of the LTO reference problems. Something like: It is not legal to reference a static variable or function symbol from the assembler code, as the compiler may optimize unused symbols away. For inline asm in functions these should be referred as "m" input arguments. For top level asm the referenced symbol should be made global and marked with __attribute__((externally_visible)) . And another common problem: For top level asm there is no guarantee the compiler outputs the statements in order. [unless -fno-toplevel-reorder is specified, but I'm not should mention that] -Andi -- a...@linux.intel.com -- Speaking for myself only