Mailing List Archive

optimization on sunos gcc -O
just curious - why is the default optimaization for gcc on sunos4_1 -O
instead of -O2 or something

-GSM
Re: optimization on sunos gcc -O [ In reply to ]
On Tue, 21 Nov 1995, Joe Marzot wrote:

> just curious - why is the default optimaization for gcc on sunos4_1 -O
> instead of -O2 or something

Threre's nothing special about gcc on sunos4_1 here. The default
optimization for everybody everywhere is -O, unless someone specifically
patched a hints file to do otherwise. '-O' is the only portable
way to specify optimization. Not all systems support the -O2
syntax.

If you want to propose something special for SunOS, you certainly may
submit a patch for the hint file. I'm not sure why you would want to
single out gcc and not do something similar with cc. Also, why stop at
-O2? Do you trust -O[3456]?

Beware, compiling toke.c with higher levels of optimization may give
smaller systems fits. You probably want to check this out before
proposing it for everyone.

Me, I just do
sh Configure -Doptimize='whatever'
if I don't want '-O'.

Andy Dougherty doughera@lafcol.lafayette.edu
Re: optimization on sunos gcc -O [ In reply to ]
> -O[3...] did not actually do anything more than -O2 (on SPARC)
> last time I looked (about a year ago).

Sure it does. On gcc1, it says "Invalid option `-O3'".


Regards,

Hallvard
Re: optimization on sunos gcc -O [ In reply to ]
In <Pine.3.89.9511211504.A25933-0100000@lafcol>
On Tue, 21 Nov 1995 15:24:00 -0500 (EST)
Andy Dougherty <doughera@lafcol.lafayette.edu> writes:
>On Tue, 21 Nov 1995, Joe Marzot wrote:
>
>> just curious - why is the default optimaization for gcc on sunos4_1 -O
>> instead of -O2 or something

>
>Threre's nothing special about gcc on sunos4_1 here. The default
>optimization for everybody everywhere is -O, unless someone specifically
>patched a hints file to do otherwise. '-O' is the only portable
>way to specify optimization. Not all systems support the -O2
>syntax.

But all gcc's do, and we already test for gcc.

There is some case for making
gcc's default -O2. -O2 enables instruction scheduling which on superscalar
machines is a major win. The snag is that you probably need a -msupersparc
to make scheduling correct.

>
>If you want to propose something special for SunOS, you certainly may
>submit a patch for the hint file. I'm not sure why you would want to
>single out gcc and not do something similar with cc. Also, why stop at
>-O2? Do you trust -O[3456]?

-O[3...] did not actually do anything more than -O2 (on SPARC)
last time I looked (about a year ago).

>
>Beware, compiling toke.c with higher levels of optimization may give
>smaller systems fits. You probably want to check this out before
>proposing it for everyone.

>Me, I just do
> sh Configure -Doptimize='whatever'
>if I don't want '-O'.

Same here. (It is always -g -O2 with gcc modified to do
-msupersparc -mno-v8 by default).