This is the mail archive of the 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: Third Draft "Unsafe fp optimizations" project description.

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

Something like:

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.

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