delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/01/13/19:13:46

Date: Fri, 13 Jan 95 16:14 MST
From: mat AT ardi DOT com (Mat Hostetter)
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: gcc = gcc -O2 ?
References: <9501131724 DOT AA09117 AT delorie> <Pine DOT 3 DOT 89 DOT 9501131313 DOT C1381-0100000 AT riverdale DOT declab DOT usu DOT edu>

>>>>> "sl5h9" == Sliced Bread <Calimath> writes:

    sl5h9> On Fri, 13 Jan 1995, DJ Delorie wrote:

    >>  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.

This strikes me as a bad idea.  Altering well-established gcc
semantics would be misleading and confusing.  The GNU cc documentation
would suddenly become inaccurate for this one environment.  If you
want better benchmark numbers, then enable optimization.  If you
really want a gcc that optimizes by default, write a batch script
called "cc" or something that invokes "gcc -O2 -Wall".  But please
don't change what "gcc foo.c -o foo" means.

    sl5h9>    That sounds like a good idea.  Are there very many times
    sl5h9> when you don't want to optimize, after all?

Of course; whenever you debug.  Or when you find that gcc generates
incorrect code at certain optimization levels.  Obviously it's not a
major hassle to turn optimization *off*, but it's not a hassle to turn
it *on*, either.  I vote to leave gcc's default behavior unchanged and
consistent on all platforms.

-Mat

- Raw text -


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