Subject: GCC Optimization flags -> errors
To: None <netbsd-help@netbsd.org>
From: Gary Thorpe <gathorpe79@yahoo.com>
List: netbsd-help
Date: 06/19/2006 17:47:02
Hi,

I have noticed that when I compiled NetBSD 2.0's kernel and now the 3.0
kernel, errors crop up when using certain optimization flags (-Os in my
case).

Specifically, the compiler produces warnings/errors about uninitialized
variables when using the optimization flag and no errors when the flag
is excluded.

On 3.0, I encountered this with pckbc_pnpbios.c: I ended up using the
ISA attachment just for this device (the rest of pnpbios attachments
had no problems).

Is this a general problem with GCC or a problem with the source code?
From working with another project, it seems that optimization can make
the compiler think that code has problems such as uninitialized
variables while it is fine without optimization (I cannot remember if a
_different_ optimization level also eliminated the problem e.g. -O2
instead of -Os).

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com