mips64 target erroneously reorders "asm"
Jim Wilson
wilson@cygnus.com
Fri Oct 3 16:21:00 GMT 1997
asm("foo");
Note that `asm("foo")' and `asm("foo" : ...)' are rather different things.
The first one is an old-style K&R C asm. The second one in a GNU C extended
asm.
The optimizer can not do anything with old-style asms; they are always
treated as volatile.
GNU C extended asms were created to solve this problem. An extended asm is
not volatile unless you mark it as so. If an extended asm is not marked as
volatile, then all optimizations are allowed, including instruction scheduling,
and hence arbitrary reordering of extended asms may occur. If you don't
want this, then use volatile.
See the gcc info documentation (in particular the stuff in the extend.texi
file).
Jim
More information about the Gcc-bugs
mailing list