This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Should -fcross-jumping be part of -O1?
- From: Scott Robert Ladd <coyote at coyotegulch dot com>
- To: Gareth McCaughan <gmccaughan at synaptics-uk dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 02 Dec 2003 09:15:00 -0500
- Subject: Re: Should -fcross-jumping be part of -O1?
- References: <200312021138.36935.gmccaughan@synaptics-uk.com>
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