Jakub Jelinek <ja...@redhat.com> 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 NaNs for both arguments. >> Also notice that GCC did NOT generate JP after the 4 COMISD instructions >> in question, i.e. it knew that NaNs had been ruled out. > > GCC doesn't do value range propagation of floating point values, not even > the special ones like NaNs, infinities, +/- zeros etc., and without that the > earlier ifs aren't taken into account for the earlier code.
Ouch, to bad! That was but the very least expectation I had. And indeed, removing the 3 other if-clauses doesn't change how the final if-clause gets translated. Sorry Matt, we were both wrong with our assumptions. > Also, as you have been told already, sending these mails to gcc mailing list > is a very bad idea, unless somebody jumps on it immediately and implements > it, they will be effectively forgotten. You should file missed > optimizations into gcc bugzilla where they can be seen any time. I don't have a bugzilla account, and I don't use GCC for anything serious. Stefan