From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4FFF33858CDA; Fri, 12 May 2023 06:27:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4FFF33858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683872847; bh=eeH2hDXvwQSrZSpHSVb0N3VOrEJdNvVzqKhJVa5ShY8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Ncr9aZXdf+nxbQTvoVZJxg+x1gu6D76Arm1KNRhzs9iSTD2QoIyOw+0yBRfyRVYU3 fdjJZCje+lguR/Fhv+SdHcAZus68sStgV1UF43ldAJFSGxI5S5t2SIQP8sMHySpPTW yjbhDbwtx2n9mAQiVeoluhnVeB3SZlyWItvjehXc= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/106902] [11/12/13/14 Regression] Program compiled with -O3 -mfma produces different result Date: Fri, 12 May 2023 06:27:26 +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.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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: 11.4 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=3D106902 --- Comment #21 from Richard Biener --- (In reply to Alexander Monakov from comment #20) > I missed it the first time around, but placing PAREN_EXPR around the > complete expression won't work: nothing will prevent GCC from duplicating > evaluations of the sub-expressions, and then randomly forming FMAs like > here. It would just bury this class of bugs deeper. Hmm, true. > Now that we are in stage1, can we make some kind of progress here? Is the= re > any buy-in for: >=20 > 1. Implementing fp-contract=3Don via GENERIC folding? > 2. Defaulting to fp-contract=3Don instead of fp-contract=3Dfast under -st= d=3Dgnu*? > 3. Enabling fp-contract=3Dfast under -ffast-math? Sounds reasonable. Though I wouldn't use GENERIC folding but instead some folding-like code in c-family/ that for example would get invoked by genericization or via the gimplification hook? If we'd add GENERIC folding in fold-const.cc or match.pd the chance is that it will pick up FMAs "late".=