This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Draft "Unsafe fp optimizations" project description.
- To: dewar at gnat dot com
- Subject: Re: Draft "Unsafe fp optimizations" project description.
- From: Adam Schrotenboer <ajschrotenboer at lycosmail dot com>
- Date: Sun, 05 Aug 2001 12:20:23 -0400
- Cc: gcc at gcc dot gnu dot org
- References: <20010805155638.573C8F2B78@nile.gnat.com>
dewar@gnat.com wrote:
><<That's certainly interesting, but still, what if I want to know what the
>compiler did to my code (at least as much as can be), but I don't know
>RTL? (Or perhaps if I learn it, can I get that to be output so that I
>can improve my own coding practices?)
>
>
>A fair point .. but not one with an easy solution
>
>In GNAT, we have a very useful option to print out the optimized code in
>source form, it only covers front end optimizations, not gcc backend ones,
>but it is an interesting model. For example, you put in the source:
>
All well and good, but what of C or C++? Perhaps an almost unfair q, but
C is where most (at least UNIX) development is taking place.
>
>procedure p is
> a,b : float;
>begin
> a := b ** 4;
>end;
>
>and you compile with the -gnatG switch, and you get
>
>procedure p is
> a : float;
> b : float;
>begin
> E1b : constant float := b * b;
> a := E1b * E1b;
> return;
>end p;
>
>
>