Subject: Re: Recent serial port lossage
To: None <port-i386@NetBSD.ORG>
From: Charles Hannum <Charles-Hannum@deshaw.com>
List: port-i386
Date: 01/07/1996 17:29:19
I've tracked this down to what I believe to be a bug in GCC 2.7.2.
Basically, if you have code of the form:

volatile int foo;

...

	foo |= 0x80000000;

...

in many (all?) cases, `gcc -O3' now compiles it as:

	movl _foo,%e??
	orl $0x80000000,%e??
	movl %e??,_foo

rather than the obvious:

	orl $0x80000000,_foo

This probably has something to do with pipeline scheduling on the
Pentium, but it's not clear to me that the new behaviour, regardless
of its relative performance, is *correct* for a `volatile' variable.
In particular, I don't see a way to make sig_atomic_t work correctly.
In general, it makes `volatile' nearly useless.

At any rate, I've worked around the problem in this case, but I
wouldn't be surprised if it causes other random bugs.

If you've been having problems, please update your kernel sources
after tonight's update, and let me know if your problems persist.