From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 76C403AAB4AC; Thu, 29 Apr 2021 16:25:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 76C403AAB4AC From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/100303] [11/12 Regression] -fcompare-debug failure (length) with -O -fno-dce -ftracer Date: Thu, 29 Apr 2021 16:25:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rsandifo at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.2 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: Thu, 29 Apr 2021 16:25:10 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100303 --- Comment #3 from CVS Commits --- The master branch has been updated by Richard Sandiford : https://gcc.gnu.org/g:c97351c0cf4872cc0e99e73ed17fb16659fd38b3 commit r12-292-gc97351c0cf4872cc0e99e73ed17fb16659fd38b3 Author: Richard Sandiford Date: Thu Apr 29 17:24:57 2021 +0100 rtl-ssa: Fix -fcompare-debug failure [PR100303] This patch fixes an oversight in the handling of debug instructions in rtl-ssa. At the moment (and whether this is a good idea or not remains to be seen), we maintain a linear RPO sequence of definitions and non-debug uses. If a register is defined more than once, we use a degenerate phi to reestablish a previous definition where necessary. However, debug instructions shouldn't of course affect codegen, so we can't create a new definition just for them. In those situations we instead hang the debug use off the real definition (meaning that debug uses do not follow a linear order wrt definitions). Again, it remains to be seen whether that's a good idea. The problem in the PR was that we weren't taking this into account when increasing (or potentially increasing) the live range of an existing definition. We'd create the phi even if it would only be used by debug instructions. The patch goes for the simple but inelegant approach of passing a bool to say whether the use is a debug use or not. I imagine this area will need some tweaking based on experience in future. gcc/ PR rtl-optimization/100303 * rtl-ssa/accesses.cc (function_info::make_use_available): Take= a boolean that indicates whether the use will only be used in debug instructions. Treat it in the same way that existing cross-EBB debug references would be handled if so. (function_info::make_uses_available): Likewise. * rtl-ssa/functions.h (function_info::make_uses_available): Upd= ate prototype accordingly. (function_info::make_uses_available): Likewise. * fwprop.c (try_fwprop_subst): Update call accordingly.=