Subject: PROBLEMS WITH GCC 2.7.2/I386 ON APPLICATIONS
To: None <current-users@NetBSD.ORG>
From: Brian Buhrow <buhrow@cats.ucsc.edu>
List: current-users
Date: 04/10/1996 15:48:24
	Hello folks.  There has been quite a bit of talk about the optimization
code in gcc 2.7.2 and its guilt in a number of problems compiling and using
the kernel.  I am having problems, which appear to be gcc related, and am
wondering if this gcc 2.7.2 bug is more serious than we first thought.  
	I have an application which works fine if all optimization is turned 
off, but which gets its function return values screwed up if -O or -O and
-fstrength-reduce are turned on.  The problem seems to be some code in the
cleanup routine which stomps on %ax when a function is returning.  Not
being a compiler expert, I'm not sure what's going on here, but
instruction-by-instruction traces show that values are getting corrupted
when functions are returning.  Things aren't consistent, but it appears
as if things go south when ever the stack crosses a page boundary.
	I believe I'm also having trouble with this in the libc code as well.  
Ordinary wel-tested functions like: getpwent are bombing when compiled with
-O and working just fine, with -o turned off.
	I'm running -current of about February 27, or so, just before the 
bus changes went into the code.  Oh, yes, this is on the i386 port, though
I don't know if this bug is machine specific.
	Perhaps it would be useful either to change the default compilation
flags, or to look at backing up several revs of gcc in the distribution.

-Brian