From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F1AEC3858C78; Fri, 4 Feb 2022 09:38:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F1AEC3858C78 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/101885] [10/11/12 Regression] wrong code at -O3 on x86_64-linux-gnu Date: Fri, 04 Feb 2022 09:38:31 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 11.2.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: roger at nextmovesoftware dot com X-Bugzilla-Target-Milestone: 10.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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Feb 2022 09:38:32 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101885 --- Comment #13 from CVS Commits --- The master branch has been updated by Roger Sayle : https://gcc.gnu.org/g:49365d511ac9b64009b1de11ef8a941f59407f67 commit r12-7046-g49365d511ac9b64009b1de11ef8a941f59407f67 Author: Roger Sayle Date: Fri Feb 4 09:32:21 2022 +0000 [PATCH] PR rtl-optimization/101885: Prevent combine from clobbering fla= gs This patch addresses PR rtl-optimization/101885 which is a P2 wrong code regression. In combine, if the resulting fused instruction is a parall= el of two sets which fails to be recognized by the backend, combine tries = to emit these as two sequential set instructions (known as split_i2i3). As each set is recognized the backend may add any necessary "clobbers". The code currently checks that any clobbers added to the first "set" don't interfere with the second set, but doesn't currently handle the case that clobbers added to the second set may interfere/kill the destination of the first set (which must be live at this point). The solution is to cut'n'paste the "clobber" logic from just a few lines earlier, suitably adjusted for the second instruction. One minor nit that may confuse a reviewer is that at this point in the code we've lost track of which set was first and which was second (combine chooses dynamically, and the recog processes that adds the clobbers may have obfuscated the original SET_DEST) so the actual test below is to confirm that any newly added clobbers (on the second set instruction) don't overlap either set0's or set1's destination. 2022-02-04 Roger Sayle gcc/ChangeLog PR rtl-optimization/101885 * combine.cc (try_combine): When splitting a parallel into two sequential sets, check not only that the first doesn't clobber the second but also that the second doesn't clobber the first. gcc/testsuite/ChangeLog PR rtl-optimization/101885 * gcc.dg/pr101885.c: New test case.=