Inline assembly and compiler optimizations?
I read several times that using inline assembly is considered as a bad practice, since it will interfere with the compiler optimization.
And recently, I read this:
How it's possible?
Q: How can I reference C variables from my inline assembly code?
A: GCC has extensive inline assembly facilities. They allow you to specify everything other compilers let you (like the registers where GCC will put specific results), but in a way that doesn't interfere with the compiler's optimizations of the C code that includes inline assembly
. Because of this flexibility, the syntax of the inline assembly code is very different from the other DOS-based compilers. DJGPP FAQ -- Inline Assembly code with GCC