www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/01/13/18:43:28

Date: Fri, 13 Jan 1995 16:10:43 -0500 (CDT)
From: Aaron Ucko <UCKO AT VAX1 DOT ROCKHURST DOT EDU>
Subject: Re: gcc = gcc -O2 ?
To: dj AT stealth DOT ctron DOT com
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Organization: Rockhurst College; Kansas City, MO

>I've been asked whether it would be a Good Thing for "gcc" to default
>to "gcc -O2" rather than "gcc -O0", so that if you didn't specify
>anything, you would get optimization by default.  The reason is that
>so you would, by default, get faster programs and thus better
>benchmarks, at the cost of slower compiles.  You would still be able
>to use "gcc -O0" to shut off optimization.
This would also make inline functions behave as intended.  OTOH, opti-
mization (see wrh's message) doesn't always work perfectly...perhaps
it might be best to default to -O1.  Perhaps this could be set
by an environment var--but if it would be possible to chang only lib/specs,
perhaps documentation for that could be provided [is there a specs(5)
manpage anywhere?]

>This came up because someone thought that most PC compilers, by
>default, optimized, so gcc should also.
Not a bad thought...in this case, -O1 would definitely be aptest,
as most PC compilers don't default to full optimization.
>
>Should -g imply -O0 as the default?
Probably...people who want to debug optimized code presumably know
enough about what they're doing to manually select optimization.

--- Aaron Ucko (ucko AT vax1 DOT rockhurst DOT edu; finger for PGP public key) -=- httyp!
-=*=-Just because you're paranoid doesn't mean they aren't out to get you.-=*=-
Geek code 2.1 [finger hayden AT vax1 DOT mankato DOT msus DOT edu for explanation]: 
 GCS/M/S d(-) H s g+ p? !au a-- w+ v+ C++(+++)>++++ UL++(-)(S+)>++++ P++ 
 L+(++) 3(-) E-(----) !N>++ K- W-(---) M-(--) V(--) po-(--) Y+(++) t(+) !5 j R 
 G tv--(-) b+++ !D(--) B--(---) e>++++(*) u++(@) h!() f(+) r-(--)>+++ n+(-) y?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019