asm load/store
Dale Johannesen
dalej@apple.com
Fri Aug 2 15:34:00 GMT 2002
Is it true that an asm() that is actually a load or store, and
for which it's impossible to figure out exactly which memory it
touches by examining the arguments, must be declared "volatile"
to work correctly? It would be nice to have something that
doesn't disable the optimizer so completely yet gets the semantics
right. I suppose the declaration to clobber "memory" started out
as an attempt to model a store, but it doesn't work, and from the
current docs is apparently not expected to work:
asm (clobbers memory)
store (non-asm)
asm (clobbers memory, identical to above)
cse removes the 2nd asm (sharing it with the first). If it
thought that clobbering memory==store, it could not do that.
More information about the Gcc-help
mailing list