On Tue, Jan 13, 2015 at 05:18:19PM +0100, Jakub Jelinek wrote: > 3) on request from Richard (which Segher on IRC argues against), "memory" > clobber also prevents CSE;
As extend.texi used to say: " If your assembler instructions access memory in an unpredictable fashion, add @samp{memory} to the list of clobbered registers. This causes GCC to not keep memory values cached in registers across the assembler instruction and not optimize stores or loads to that memory. You also should add the @code{volatile} keyword if the memory affected is not listed in the inputs or outputs of the @code{asm}, as the @samp{memory} clobber does not count as a side-effect of the @code{asm}. " so a "memory" clobber in a non-volatile asm should not prevent CSE. Segher