Re: -O vs -O2, revisited

From: Adrian Chadd <adrian@dont-contact.us>
Date: Mon, 7 May 2001 16:22:26 +0800

On Mon, May 07, 2001, Andres Kroonmaa wrote:
> On 5 May 2001, at 21:49, Adrian Chadd <adrian@creative.net.au> wrote:
>
> > gcc under FreeBSD 4.3 is still generating some invalid code
> > with -O2.
>
> btw, how do you identify invalid code?
>

The assembly makes no sense? :-)
Its difficult - you generally find a bug thats obvious, because something
subtle can result in a panic some time away.

> I can't see any problem under solaris with any -O options. Although
> we've been disabling -O for solaris for ages.
> This problem is specific to combinations of circumstances, imo.

Yup. Its rare, but it does happen.

> Can we add test code to configure that detects problems with -O?
> -O2 can make 2x more efficient code...

We'd have to identify the buggy code snippet and reproduce it
reliably. If you'd like to give this a shot, great. But
I have better things to do with my time than to chase down
a compiler bug. :-)

>
> At least, could we add configure option to override defaults?

You can do something to configure to change its idea of CFLAGS,
but I'd like it to default to -O rather than -O2. People can
bump it up to -O2 if they'd like.

Adrian

-- 
Adrian Chadd			"How could we possibly use sex to get
<adrian@creative.net.au>	  what we want?
			 	   Sex _IS_ what we want!" -- Fraser
Received on Mon May 07 2001 - 02:27:23 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:00 MST