From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 47BC43858C41; Wed, 17 May 2023 18:49:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 47BC43858C41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684349344; bh=VSjW95YEbj2xexcJL3LLREoXvDqhflJ6psnxktchSFs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rTAk22rv0krH29Xqzm1tHfMIHV8NN7v+dXXxD7vzWuJrFAHgjKAksPOIUSWxcVW7c cpt0TnaT362EZXCbPwe/hFUVsX7qHs9mexieqd8lqsAL6BUfihxlsVzzztNDc7gujy EOtNM6YzycErNqXjH2Kx1vg9LHKWBv3re1qOrlqk= From: "amonakov 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: Wed, 17 May 2023 18:49:02 +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: amonakov 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: attachments.created 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 #22 from Alexander Monakov --- Created attachment 55105 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D55105&action=3Dedit patch 1/3 (In reply to Richard Biener from comment #21) >=20 > 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". Agreed, thank you. I'm working on it. The attached patch implements this via c_gimplify_expr and passes bootstrap+regtest under 'configure --with-cpu=3Dznver2' (i.e. with fma available by default).=