This is the mail archive of the
mailing list for the GCC project.
Re: -O2 versus -O1 (Was: Re: GCSE store motion)
- From: dewar at gnat dot com (Robert Dewar)
- To: degger at fhm dot edu, dewar at gnat dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 17 May 2002 06:32:24 -0400 (EDT)
- Subject: Re: -O2 versus -O1 (Was: Re: GCSE store motion)
<<What about simply disabling any problematic optimisation when -g is
supplied? It doesn't make sense to me to have another debugging flag
We never want -g to affect the generated code. Actually what I would like
to see (I mentioned this before is a -O.5 which would do all optimizations
that did not affect debugging). One of the problems with GCC is that -O0 is
really terrible, much worse than other compilers in "no optimize" mode. That's
a problem for two reasons.
A substantial set of users is permanently set against optimization, either
because they are doing safety critical work (where no optimization is one
religeon adhered to), or because they have been burned in the past. Or they
are doing benchmarks against another compiler where optimziation does not
work and they think this is the fair way to do it.
Losing debugging information is a problem, and the trouble with -O0 is not
just the speed, but more importantly the huge size of executables.