From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 359FE3858D37; Thu, 29 Jun 2023 07:28:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 359FE3858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688023720; bh=TgDy3cB7sx0ZESPME13jNUsMjzFoFZg6MU7904MWdiM=; h=From:To:Subject:Date:From; b=hEFSttQv1wTj9oT5AoFElni57DFcvvxEvlrg32mxV05tKI/G/85LlJpejTRdod7Gl JuLpUxyLR8xqHqFGv5PFxNEFPMu29bv8+5eb7AVzv2/b+OvhpT7XSuUVE+RZeakqPq MiBIjqDeH+J6D46Dt9KTa11GwPEwY6pIpmQFCjeg= From: "pdimov at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/110477] New: -fexcess-precision=standard not applied consistently Date: Thu, 29 Jun 2023 07:28:39 +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: 13.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pdimov at gmail 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=3D110477 Bug ID: 110477 Summary: -fexcess-precision=3Dstandard not applied consistently Product: gcc Version: 13.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: pdimov at gmail dot com Target Milestone: --- The following program float f( float x, int y ) { return x + y; } int main() { return f( 3.14f, 1 ) =3D=3D 3.14f + 1; } returns different values with -std=3Dc++XX (https://godbolt.org/z/8dK98ondM= ) and -std=3Dgnu++XX (https://godbolt.org/z/4Y4qfsKzM) under GCC 13/14 -m32, beca= use -fexcess-precision=3Dstandard is not consistently applied to both sides of = the comparison. Under -fexcess-precision=3Dfast (and hence under previous GCC versions), the comparison always succeeds because both sides use excess precision (https://godbolt.org/z/dzdoxdnM9). This is the runtime equivalent of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110476.=