Re: [PATCH] middle-end/57245 - honor -frounding-math in real truncation

2021-12-17 Thread H.J. Lu via Gcc-patches
On Thu, Oct 28, 2021 at 2:23 AM Jakub Jelinek via Gcc-patches wrote: > > On Thu, Oct 28, 2021 at 10:11:36AM +0200, Richard Biener wrote: > > 2021-10-27 Richard Biener > > > > PR middle-end/57245 > > * fold-const.c (fold_convert_const_real_from_real): Honor > > -frounding-math

Re: [PATCH] middle-end/57245 - honor -frounding-math in real truncation

2021-10-28 Thread Jakub Jelinek via Gcc-patches
On Thu, Oct 28, 2021 at 10:11:36AM +0200, Richard Biener wrote: > 2021-10-27 Richard Biener > > PR middle-end/57245 > * fold-const.c (fold_convert_const_real_from_real): Honor > -frounding-math if the conversion is not exact. > * simplify-rtx.c (simplify_const_unary_oper

Re: [PATCH] middle-end/57245 - honor -frounding-math in real truncation

2021-10-28 Thread Richard Biener via Gcc-patches
onal-options "-frounding-math" } */ > >> > >> #include > >> #include > >> > >> int > >> main () > >> { > > > >Roughly yes. Some tests also do #ifdef FE_*, so in your case > >> #if __DBL_MANT_DIG__ == 53 && __FLT_MANT_DIG__ =

Re: [PATCH] middle-end/57245 - honor -frounding-math in real truncation

2021-10-27 Thread Richard Biener via Gcc-patches
On October 27, 2021 4:44:53 PM GMT+02:00, Jakub Jelinek wrote: >On Wed, Oct 27, 2021 at 04:29:38PM +0200, Richard Biener wrote: >> So something like the following below? Note I have to fix >> simplify_const_unary_operation to not perform the invalid constant >> folding with (not worrying about

Re: [PATCH] middle-end/57245 - honor -frounding-math in real truncation

2021-10-27 Thread Jakub Jelinek via Gcc-patches
On Wed, Oct 27, 2021 at 04:29:38PM +0200, Richard Biener wrote: > So something like the following below? Note I have to fix > simplify_const_unary_operation to not perform the invalid constant > folding with (not worrying about the exact conversion case - I doubt > any of the constant folding is

Re: [PATCH] middle-end/57245 - honor -frounding-math in real truncation

2021-10-27 Thread Richard Biener via Gcc-patches
On Wed, 27 Oct 2021, Jakub Jelinek wrote: > On Wed, Oct 27, 2021 at 03:20:29PM +0200, Richard Biener via Gcc-patches > wrote: > > The following honors -frounding-math when converting a FP constant > > to another FP type. > > > > Bootstrapped and tested on x86_64-unknown-linux-gnu, OK? > > > > I

Re: [PATCH] middle-end/57245 - honor -frounding-math in real truncation

2021-10-27 Thread Jakub Jelinek via Gcc-patches
On Wed, Oct 27, 2021 at 03:20:29PM +0200, Richard Biener via Gcc-patches wrote: > The following honors -frounding-math when converting a FP constant > to another FP type. > > Bootstrapped and tested on x86_64-unknown-linux-gnu, OK? > > I wonder what a good way to test this in a portable way, the

[PATCH] middle-end/57245 - honor -frounding-math in real truncation

2021-10-27 Thread Richard Biener via Gcc-patches
The following honors -frounding-math when converting a FP constant to another FP type. Bootstrapped and tested on x86_64-unknown-linux-gnu, OK? I wonder what a good way to test this in a portable way, the bugreport unfortunately didn't contain something executable and I don't see much -frounding-