Re: Is it Okay for GCC to do the following simplifications with "-ffast-math" flag

2015-05-07 Thread Renlin Li
On 05/05/15 22:47, Jeff Law wrote: On 05/05/2015 07: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 si

Re: Is it Okay for GCC to do the following simplifications with "-ffast-math" flag

2015-05-06 Thread Richard Biener
On May 6, 2015 5:56:10 PM GMT+02:00, Michael Matz wrote: >Hi, > >On Wed, 6 May 2015, Richard Biener wrote: > >> >> 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

Re: Is it Okay for GCC to do the following simplifications with "-ffast-math" flag

2015-05-06 Thread Michael Matz
Hi, On Wed, 6 May 2015, Richard Biener wrote: > >> 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? > > >

Re: Is it Okay for GCC to do the following simplifications with "-ffast-math" flag

2015-05-06 Thread Jeff Law
On 05/06/2015 05:11 AM, Richard Biener wrote: On Wed, May 6, 2015 at 2:56 AM, 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; } --> retu

Re: Is it Okay for GCC to do the following simplifications with "-ffast-math" flag

2015-05-06 Thread Richard Biener
On Wed, May 6, 2015 at 2:56 AM, 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 fo

Re: Is it Okay for GCC to do the following simplifications with "-ffast-math" flag

2015-05-05 Thread msebor
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-ma

Re: Is it Okay for GCC to do the following simplifications with "-ffast-math" flag

2015-05-05 Thread Jeff Law
On 05/05/2015 07: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-ma

Is it Okay for GCC to do the following simplifications with "-ffast-math" flag

2015-05-05 Thread Renlin Li
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? Regards, Renlin Li