This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Should -fcross-jumping be part of -O1?


Gareth McCaughan wrote:
There are several different axes along which the kind
of code a compiler generates can vary:

  - execution speed
  - code size
  - debuggability
  - compilation speed[1]
  - robustness[2]
  - simplicity of generated code[3]

Add


- accuracy

To your list. My current Acovea tests are investigating the effects of various options on floating-point accuracy.

and so on. It seems to me that rather than having a single
"how much optimization?" parameter and a bunch of flags
requesting special emphasis on execution speed or code size
or whatever, it makes more sense to let users specify how
important each axis is to them.

So, for instance, you could say

gcc ..... -Ospeed=3 -Ospace=1 -Odebug=0 -Ocompiletime=0

A good ideas, but likely too complex for the average user. At the very least, we'd need continued support for the general -O0/1/2/3/s options, especially given how many Makefiles rely on them.


Prior art: Common Lisp does almost exactly this, and it
seems to work very well.

Good point. And I do think you have a good idea, if it can be implemented in a sane fashion such that people understand how their choices affect compilation.


In my experience, most programmers blindly slap -O2 or -O3 in their Makefiles, never rethinking their choice. You can lead a programmer to optimization, but you can't make them think.

--
Scott Robert Ladd
Coyote Gulch Productions (http://www.coyotegulch.com)
Software Invention for High-Performance Computing



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]