From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110068 invoked by alias); 13 Apr 2015 17:26:48 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 109803 invoked by uid 55); 13 Apr 2015 17:26:44 -0000 From: "joseph at codesourcery dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug other/63387] Optimize pairs of isnan() calls into a single isunordered() Date: Mon, 13 Apr 2015 17:26:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: other X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: joseph at codesourcery dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-04/txt/msg01041.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63387 --- Comment #5 from joseph at codesourcery dot com --- On Mon, 13 Apr 2015, burnus at gcc dot gnu.org wrote: > I am not sure about signalling NAN issues, but doesn't it otherwise also apply > to code like the following? At least in terms of generated assembler, the > result looks the same. > > _Bool foo(float x, float y) { return x != x || y != y; } That's also equivalent in the absence of signaling NaNs (but it won't raise invalid if x is a quiet NaN and y signaling, whereas isunordered should do so if either is signaling, and the pair of isnan tests shouldn't raise invalid at all). If a non-short-circuit OR were used, it would be exactly equivalent to the isunordered call in all cases.