This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Optimizing GCC
- From: Pop Sébastian <pop at gauvain dot u-strasbg dot fr>
- To: Dag Bakke <cheapisp at sensewave dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 4 Mar 2003 16:28:05 +0100
- Subject: Re: Optimizing GCC
- References: <20030304142207.GB23880@dagb>
On Tue, Mar 04, 2003 at 03:22:07PM +0100, Dag Bakke wrote:
> 1. Can you expect a custom-optimized gcc binary and a default-optimized
> gcc binary to produce the same output, if fed the same source and the
> same options?
>
Yes.
> I guess the answer is: "depends on how gcc was optimized", so the
In part this is false: it depends only on whether the optimization flag
you add to build gcc is safe or not.
If the optimization doesn't introduce junks, in other words if the
optimization is valid, then the optimized GCC is semantically equivalent
to the non-optimized GCC. Thus you'll get the same output for the same
input on both versions of GCC.
Otherwise it is an error in the optimization you used to optimize GCC.
Sebastian