This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: CVS Update: www.netwinder.org: pub
- To: Andreas Schwab <schwab at suse dot de>
- Subject: Re: CVS Update: www.netwinder.org: pub
- From: Philip Blundell <pb at nexus dot co dot uk>
- Date: Thu, 02 Sep 1999 09:52:18 +0100
- Cc: gcc at gcc dot gnu dot org
In message <jehfld4sbn.fsf@hawking.suse.de>, Andreas Schwab writes:
>In other words, IMHO both accesses must actually be carried out, and due
>to the volatile nature of the value this condition can well be true.
Thanks, that's what I thought. (I just realised my original message was a bit
ambiguous; the thing I thought was valid was the source code, not the
compiler's behaviour.)
The case this actually turned up in was some probe code in the Linux kernel
that was doing something like:
outb(1, 0x34); outb(2, 0x34); /* trigger magic ID mode */
if (inb(0x34) == 0xab && inb(0x34) == 0xdc) {
... initialise the device ...
}
With gcc 2.95 this doesn't work because both the condition and the body of the
"if" statement are optimized away.
Do you have any suggestions for where to start looking for the bug?
p.