Re: [RFC/PATCH] doc: volatile considered evil

David Rientjes
2007-05-08T22:36:46Z

On Tue, 8 May 2007, Jeremy Fitzhardinge wrote:

> Sounds like it's referring to micro-architectural reordering, which is
> distinct from compiler reordering. In other words, even if you
> specified "-mvolatile-asm-stop" I would assume that the compiler could
> still reorder the asm statements. Am I right, or should I read more
> into the manual description than it actually says?
>

The ia64 architecture does not include any interlocks for asm constructs
and allow them to be executed in parallel without stop bits (although it
should emit a diagnostic message from gcc, although that is not a
constraint that was introduced in C99). Adding -mvolatile-asm-stops will
add these stop bits for any asm volatile construct that does not already
have them so that gcc is aware that it is unsafe to execute such
constructs in parallel.

[ This is a tangent because we currently don't have -mvolatile-asm-stop
support and it's ia64-specific. If they ever request such support,
then this will simply alter your warning about reordering asm
volatile constructs to exclude the ia64 case. ]

David