From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 212D7385781D; Fri, 9 Apr 2021 19:10:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 212D7385781D From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/99830] [11 Regression] ICE: in lra_eliminate_regs_1, at lra-eliminations.c:659 with -O2 -fno-expensive-optimizations -fno-split-wide-types -g Date: Fri, 09 Apr 2021 19:10:03 +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: 11.0 X-Bugzilla-Keywords: ice-on-valid-code, ra X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: assigned_to 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, 09 Apr 2021 19:10:04 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99830 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|jakub at gcc dot gnu.org |unassigned at gcc d= ot gnu.org --- Comment #13 from Jakub Jelinek --- Seems the exact spot where the clobber is optimized away is e.g. when simplify_and_const_int_1 (SImode, (ashift:SI (subreg:SI (and:TI (clobber:TI (const_int 0 [0])) (const_int 255 [0xff])) 0) (const_int 16 [0x10])), 255); is called. It calls nonzero_bits, nonzero_bits sees VARYING << 16 and so returns 0xffff0000, /* Turn off all bits in the constant that are known to already be zero. Thus, if the AND isn't needed at all, we will have CONSTOP =3D=3D NONZ= ERO_BITS which is tested below. */ constop &=3D nonzero; /* If we don't have any bits left, return zero. */ if (constop =3D=3D 0) return const0_rtx; So, are you suggesting that in all such spots we need to test side_effects_p and punt? Note, simplify_and_const_int_1 already starts with: if (GET_CODE (varop) =3D=3D CLOBBER) return NULL_RTX; so it would need to use if (side_effects_p (varop)) return NULL_RTX; instead.=