This is the mail archive of the
mailing list for the GCC project.
Re: Third Draft "Unsafe fp optimizations" project description.
- To: lucier at math dot purdue dot edu, toon at moene dot indiv dot nluug dot nl
- Subject: Re: Third Draft "Unsafe fp optimizations" project description.
- From: dewar at gnat dot com
- Date: Thu, 9 Aug 2001 15:46:24 -0400 (EDT)
- Cc: gcc at gcc dot gnu dot org
<<Finally, I suggest that the document say explicity that gcc
reserves the right to apply any transformation that does not change
the value of an expression or the settings of the exception flags
under IEEE 754 arithmetic.
I would state this differently as a note. The point here is that the
notion of transformation is confusing and misleading. The code generator
can always generate any sequence of instructions that has the same effect.
For example, it is just fine to replace a floating-point object with an
integer object if the semantics of the program is unchanged.
Note: this document is discussing transformations that potentially affect
the behavior of the program from a formal semantic point of view. The
code generator may always make transformations that have no formal semantic
effect. For example, if we write:
x := x / 2.0;
then the code generator might generate a division instruction which divides
by two, or a halve instruction if one is present, or a multiplication by
0.5. All of these generate exactly the same result in x, and so the code
generator is free to pick which ever sequence it deems most efficient.