[tree-ssa] RFC: Never gimplify ASM_EXPRs

Linus Torvalds torvalds@transmeta.com
Fri Jun 6 15:35:00 GMT 2003


On Fri, 6 Jun 2003, Richard Henderson wrote:
> 
> The struct thing I always placed in a different class of workaround.
> You had a read from a "large" object in memory.  At least for some
> version of the compiler, this may have been interpreted as a read 
> from ALL memory, resulting in a memory write barrier that didn't
> affect cached reads.  I.e. possibly a bit better optimization-wise
> than the normal "memory" clobber.

That too. It's not a hugely common problem, but it does occur, and it
would be good to have a separate "read memory" clobber for those things
that want memory to be stable, but don't need the compiler to reload all
memory objects afterwards. Something like

	#define wmb() \
		asm("sfence": : :"readmem")

might be a good thing to have one day. But I don't worry too much about 
it.

		Linus



More information about the Gcc mailing list