From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EC2043858C52; Tue, 27 Feb 2024 22:40:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC2043858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709073608; bh=pAKDR+eOoId4ieAJ9SkBxY332xjAbtJ9y9Lqmq7PNIk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UK+LG3xytMOXmXBRbeIO1NTdMN31Zww3+vznLwi9XVJgziJRvrC1i5W4B+eIuTnHj k3KFyCmiiQ/JaH4EiOicUNbrOSu8L/V5JMf9sY8QnZ80xNPNVHShaOn3yOVjcDlzHV K54YW+v2J2M0t26lOiCWPcAX9K82D1xq37XJ8D/I= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/114140] fmin/fmax with signaling_NaN not work Date: Tue, 27 Feb 2024 22:40:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org 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: short_desc 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114140 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|quadmath fminq/fmaxq with |fmin/fmax with |signaling_NaN not work |signaling_NaN not work --- Comment #4 from Andrew Pinski --- With `-fsignaling-nans` added, then we get the : inf inf nan nan so ... Even using float instead also cause the same output: ``` #include #include #include #include #include int main() { { using T =3D float; using L =3D std::numeric_limits; const T a =3D L::infinity(), b =3D L::quiet_NaN(), c =3D L::signaling_NaN(); std::cout << "float\n"; std::cout << std::fmin(a, b) << std::endl; std::cout << std::fmax(a, b) << std::endl; std::cout << std::fmin(a, c) << std::endl; std::cout << std::fmax(a, c) << std::endl; } } ``` So Looks like we convert sNaN to qNan if `-fsignaling-nans` is not supplied= ...=