On 05/06/2015 05:11 AM, Richard Biener wrote:
On Wed, May 6, 2015 at 2:56 AM,  <mse...@redhat.com> wrote:
On 05/05/2015 08:27 AM, Renlin Li wrote:

Hi all,

For the following illustrative code,

double f1(int x) { return (double)(float)x; } --> return (double)x;
int f2(double x) { return (int)(float)x; } --> return (int)x;

Is it Okay for the compiler to do the simplifications shown above with
fast-match enabled?


Such a transformation would yield different results
for integers that are exactly representable in double
but not in float. For example, the smallest positive
integer with such a property in IEEE 754, 16,777,217,
converts to 16,777,216 in float. I'm not a math expert
but such a result would seem unexpected even with
-ffast-math.

Yeah, such changes would be not welcome with -ffast-math.
Agreed.

jeff

Reply via email to