From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 258E9385841C; Tue, 14 Dec 2021 00:05:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 258E9385841C From: "joseph at codesourcery dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/103683] Redundant !__builtin_isnan not removed with -fno-signaling-nans Date: Tue, 14 Dec 2021 00:05:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 11.2.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: joseph at codesourcery dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2021 00:05:12 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103683 --- Comment #1 from joseph at codesourcery dot com --- (x > 1) is expected to raise invalid for a quiet NaN, so the two functions= =20 are different in the absence of -fno-trapping-math, whether or not=20 signaling NaNs are enabled. ((!__builtin_isnan (x)) && x > 1) is equivalent to __builtin_isgreater (x,= =20 1.0) and could be optimized accordingly for -fno-signaling-nans, however.= =20=20 (With signaling NaNs, you have the issue that the first expression doesn't= =20 raise invalid for a signaling NaN but the second does.)=