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

Jeremy Fitzhardinge
2007-05-08T22:04:53Z

David Rientjes wrote:
> Now if all such output operands are to specify that the input operands
> were "modified", 'volatile' is required to ensure the side-effects are
> preserved or, otherwise, gcc is free optimize the entire asm construct
> away since it appears to be unused.
>

Yup.

>> Yeah, they're completely different. They're not even analogous, really,
>> which was my point. People confer more meaning to "asm volatile" than
>> it actually has, because of the analogy with volatile variables/types.
>> They would have been better off with something like "asm static", which
>> isn't much more meaningful, but at least it doesn't mislead the reader
>> into thinking it has anything to do with the other volatile.
>>
>>
>
> You're point about reordering "asm volatile" constructs differs depending
> on -mvolatile-asm-stop or -mno-volatile-asm-stop, however.
>

Erm, that seems to be ia64 specific, and I have no idea what adding a
"stop bit" implies. Can you set even or odd parity too?

J