From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AD05E3888C75; Wed, 3 May 2023 15:21:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AD05E3888C75 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683127269; bh=GfFEb078/3qKLiEbbIFATYcC8THiTZpDZ4yycdm2+bI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nTp37j2ZzApfIZvUgOWp6+tBGRYmBe2YVrA1lW9R0+JTeSkvPCzSjNqHIoXuEte3o V0Jv3DsxKQQly4E++Gt2hz80gp/DcrHuBVI5wmpXyeDRtq21MMIZCKYTDCTVg+agGo G6jMJKS9deG6GCgJcXnJYcH9ITh1tDTFpnOs4kD8= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/108573] [13 Regression] '-fcompare-debug' failure (length) at -O2 Date: Wed, 03 May 2023 15:21:09 +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: 13.0 X-Bugzilla-Keywords: compare-debug-failure X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 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=3D108573 --- Comment #8 from CVS Commits --- The releases/gcc-10 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:d868dd64ccd176cbd2829aa6175b40323f937b20 commit r10-11361-gd868dd64ccd176cbd2829aa6175b40323f937b20 Author: Jakub Jelinek Date: Wed Feb 1 12:52:52 2023 +0100 ree: Fix -fcompare-debug issues in combine_reaching_defs [PR108573] The PR78437 r7-4871 changes made combine_reaching_defs punt on WORD_REGISTER_OPERATIONS targets if a setter of smaller than word register has wider uses. This unfortunately breaks -fcompare-debug, because if such a use appears only in DEBUG_INSN(s), while all other uses aren't wider than the setter, we can REE optimize it without -g and not with -g. Such decisions shouldn't be based on debug instructions. We could try to reset them or adjust in some other way after we decide to perform the change, but at least on the testcase which used to fail on riscv64-linux the (debug_insn 8 7 9 2 (var_location:HI s (minus:HI (subreg:HI (and:DI (re= g:DI 10 a0 [160]) (const_int 1 [0x1])) 0) (subreg:HI (ashiftrt:DI (reg/v:DI 9 s1 [orig:151 l ] [151]) (debug_expr:SI D#1)) 0))) "pr108573.c":12:5 -1 (nil)) clearly doesn't care about the upper bits and I have hard time imaging = how could one end up with DEBUG_INSN which actually cares about those upper bits. So, the following patch just ignores uses on DEBUG_INSNs in this case, if we run into something where we'd need to do something further later = on, let's deal with it when we have a testcase for it. 2023-02-01 Jakub Jelinek PR debug/108573 * ree.c (combine_reaching_defs): Don't return false for paradox= ical subregs in DEBUG_INSNs. * gcc.dg/pr108573.c: New test. (cherry picked from commit e4473d7cf871c8ddf8f22d105c5af6375ebe37bf)=