From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A13AE3858C50; Thu, 9 Feb 2023 16:19:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A13AE3858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675959588; bh=5GKdLCYCBVtYTPvCtGB9nk+ggS73WVmtvchrX3qoTMQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=J0dHxXMtltizXaXBloZDsn2jcJiaxvZ+8aeklCesTdmNhYOgoPGVftkYWPxuiagYN A60T8Tzi/oR/4Jnyab/7U3h4lWTSomWL8VMhCvK6h/YytswpV5MD8pH+luKSvLj5JW 3JY94NHAowAp/qLOl8LjKbh+17LsXUSHy9diyTOU= From: "matz at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/108742] Incorrect constant folding with (or exposed by) -fexcess-precision=standard Date: Thu, 09 Feb 2023 16:19:48 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: matz at gcc dot gnu.org X-Bugzilla-Status: NEW 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108742 --- Comment #3 from Michael Matz --- (In reply to Jakub Jelinek from comment #2) > Note, internally in standard excess precision, 4.2 seen by the lexer is > actually > EXCESS_PRECISION , Then _that_ is the problem. The literal "4.2" simply is not a long double literal "4.2L". > when it is assigned to a double variable or > cast > to double (i.e. in places where C/C++ require the excess precision to be > converted to the narrower one) it is rounded to double, > but when used as (long double)4.2 it is the same as 4.2L I disagree. As "4.2" is "(double)4.2" then therefore "(long double)4.2" sh= ould be the same as "(long double)(double)4.2". > and even (long double)d =3D=3D (long double)4.2 should behave > the same as (long double)d =3D=3D 4.2 and d =3D=3D 4.2. On this we agree, all these expressions should behave the same. But I say = they should _not_ behave the same as "(long double)d =3D=3D 4.2L".=