Re: Linux 2.0.3x & gcc 2.8 [better use egcs for now]

Wolfram Gloger (wmglo@dent.med.uni-muenchen.de)
9 Feb 1998 13:51:40 -0000


> > IMHO, a single assignment to *(&x) can _never_ be optimized away
> > (multiple such assignments could be folded into one possibly). I
> > can't see why a volatile specification or cast should make a
> > difference either, since the variable isn't written to by another
> > context of execution.
>
> It can be optimized away when x is dead and there are no aliases - and it is
> certainly dead when it is the last operation on a local variable or an argument.

OK, I have checked several other compilers now and they all optimize
away. I was under the (probably mistaken) impression that the
presence of &x in the source alone constitutes an alias. So, there is
absolutely no point in writing `*(&eflags) = ...' in the kernel
source; volatile really needs to be used.

Regards,
Wolfram.

-- 
`Surf the sea, not double-u three...'
wmglo@dent.med.uni-muenchen.de
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu