From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 26B90385E02D; Tue, 10 Oct 2023 13:44:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 26B90385E02D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696945490; bh=4CCb0txZVKI9Vg50fuVpS8d8G+Zewiq8LljnbUTU4H8=; h=From:To:Subject:Date:From; b=yFvhoybv8GtwaHOx676gGZQxKFv4nWcWrKzFp0yxDg9dVp0q+khKoEAMI8TId6anG jwQAIPZNZLLfsG5T3gB01HSWcbscTJIAo0uI35K32Vxc/cNSwrGTTeYtv08R0bmKHM 21a9KDRB6r1BB7LfV+cX+5Pble8lQ7lLevs2zDx8= From: "Zahira.Ammarguellat at intel dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/111759] New: __FLT_HAS_INFINITY__ has value 1 even when -ffinite-math-only is used. Date: Tue, 10 Oct 2023 13:44:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: Zahira.Ammarguellat at intel 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D111759 Bug ID: 111759 Summary: __FLT_HAS_INFINITY__ has value 1 even when -ffinite-math-only is used. Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: Zahira.Ammarguellat at intel dot com Target Milestone: --- Not sure if this is a bug but would like community feedback.=20 In https://godbolt.org/z/fqMdqfM7n we see that __FLT_HAS_INFINITY__ is set = to 1 even when -ffast-math and -ffinite-math-only are used. Shouldn't this be se= t to 0 in presence of these options? In limits header: static _GLIBCXX_USE_CONSTEXPR bool has_infinity =3D __FLT_HAS_INFINITY__; That means the value of std::numeric_limits::has_infinity will alway= s be 1 even with -ffast-math and -ffinite-math-only. See https://godbolt.org/z/M6W6Ejc7W Is this acceptable? Any feedback appreciated. Thanks.=