Re: On(c)e more: optimizer failure

2021-08-21 Thread Gabriel Ravier via Gcc
On 8/21/21 10:19 PM, Stefan Kanthak wrote: Jakub Jelinek wrote: On Sat, Aug 21, 2021 at 09:40:16PM +0200, Stefan Kanthak wrote: I believe your example doesn't take into account that the values can be NaN which compares false in all situations. That's a misbelief! Please notice the first if-c

gcc-11-20210821 is now available

2021-08-21 Thread GCC Administrator via Gcc
Snapshot gcc-11-20210821 is now available on https://gcc.gnu.org/pub/gcc/snapshots/11-20210821/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 11 git branch with the following options: git://gcc.gnu.org/git/gcc.git branch

Re: On(c)e more: optimizer failure

2021-08-21 Thread Stefan Kanthak
Jakub Jelinek wrote: > On Sat, Aug 21, 2021 at 09:40:16PM +0200, Stefan Kanthak wrote: >> > I believe your example doesn't take into account that the values can be NaN >> > which compares false in all situations. >> >> That's a misbelief! >> Please notice the first if-clause, which rules out NaN

Re: On(c)e more: optimizer failure

2021-08-21 Thread Jakub Jelinek via Gcc
On Sat, Aug 21, 2021 at 09:40:16PM +0200, Stefan Kanthak wrote: > > I believe your example doesn't take into account that the values can be NaN > > which compares false in all situations. > > That's a misbelief! > Please notice the first if-clause, which rules out NaNs for both arguments. > Also n

Re: On(c)e more: optimizer failure

2021-08-21 Thread Matt Godbolt
Ok! Thanks; sorry for the misunderstanding on my side. --matt On Sat, Aug 21, 2021 at 2:53 PM Stefan Kanthak wrote: > Matt Godbolt wrote: > > > I believe your example doesn't take into account that the values can be > NaN > > which compares false in all situations. > > That's a misbelief! > Pl

Re: On(c)e more: optimizer failure

2021-08-21 Thread Stefan Kanthak
Matt Godbolt wrote: > I believe your example doesn't take into account that the values can be NaN > which compares false in all situations. That's a misbelief! Please notice the first if-clause, which rules out NaNs for both arguments. Also notice that GCC did NOT generate JP after the 4 COMISD

Re: On(c)e more: optimizer failure

2021-08-21 Thread Matt Godbolt
I believe your example doesn't take into account that the values can be NaN which compares false in all situations. If you allow the compiler to optimize without supporting NaN (-ffast-math), I think it generates the code you want: https://godbolt.org/z/1ra7zcsnd --matt On Sat, Aug 21, 2021 at 1:

On(c)e more: optimizer failure

2021-08-21 Thread Stefan Kanthak
Hi, the following snippet is from the nextafter() function of --- repro.c --- #define Zero 0.0 double nextafter(double argx, double argy) { double z = argx; if (isnan(argx) || isnan(argy)) return argx + argy; if (argx == argy) return argx;

Re: GCC [RFC] Whole Program Devirtualization

2021-08-21 Thread Jonathan Wakely via Gcc
On Fri, 20 Aug 2021, 13:37 Basile Starynkevitch, wrote: > > *computed gotos* or *labels as values* (see > https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html > for more) are > making this difficult. But they do exist, and probably co