This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: CVS Update: www.netwinder.org: pub


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]