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]

Re: Draft "Unsafe fp optimizations" project description.


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;
>
>
>




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