On 30 Dec, 2014, at 12:52 , David Laight <da...@l8s.co.uk> wrote: > Is that the correct fix? > Unless the rdpr actually accesses memory (don't think it does) then > then problem is probably a missing 'volatile' instead. > > Certainly the way those asm functions are defined looks to be > rather more obfuscated than necessary.
Or maybe just get rid of the __constfunc? I think that, plus the (void) argument list to the inline, is explicitly telling the compiler it should feel free to move the call absolutely anywhere it feels like placing it. I'm a bit surprised the "memory" clobber by itself changed anything at all since I thought a "memory" clobber without a 'volatile' is supposed to refer only to memory-based input and output arguments to the asm(), of which there are none. Dennis Ferguson