This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: volatile [was: GCC warnings for unused global variables]
On May 3, 2003, Michael Eager <eager@eagercon.com> wrote:
> It can also be described in more practical terms:
> -- each read or write of a volatile must be exactly as specified by the
> abstract machine
> -- the ordering and number of reads or writes to a volatile must be
> exactly as specified
Which brings an interesting point. GCC won't translate <op>= into a
single machine instruction that loads, operands then stores if the
variable being operated on is volatile. Why is that? Wouldn't it be
just as correct to translate say `i |= 1' into `or i,1' on a machine
that supports such an instruction?
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer