From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 815B2385840F; Fri, 31 Mar 2023 14:23:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 815B2385840F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680272636; bh=yRLh5jwmgLF9WDUKHFHB5eUBodZQfvh4FJYc50BsPeg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JBe4mTxlq6QHKryOyrT5hsi2iDf6yUQpP4RePCDQ2McY4TPTeSzbJp+ZE0N7v0xrp Mk9snwZmI+ny8tMvHCSI5NYFqvBB2svZyOAgAJRwwkAce+g5ElOUiIVaeKjYI5diLH +gs6Xu5SgPkBKr1eiY/f/+hSaiyrzqoo1Te/s0tc= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109359] [12/13 Regression] Compile-time rounding of double literal to float is incorrect with -frounding-math Date: Fri, 31 Mar 2023 14:23:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: priority cc 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=3D109359 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P3 |P2 CC| |jason at gcc dot gnu.org --- Comment #3 from Jakub Jelinek --- I think the fold-const.cc change is right though. I wonder if for constant evaluation (constexpr, constinit) we shouldn't arr= ange for those to be evaluated with temporarily -fno-rounding-math, I think C us= es fold_init and its START_FOLD_INIT ... END_FOLD_INIT for this purpose.. And otherwise perhaps we want dynamic initialization and do the conversion = at runtime? Or disable the -frounding-math for all initializer folding? What we emit is definitely wrong, Variable which claims to have 8 bytes in size but actually has 16 under the hood, with constants in different mode.=