From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 441283858D1E; Thu, 8 Sep 2022 09:52:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 441283858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662630730; bh=4LxWaSYVolOF9FfM95y/4UGyIqQhbxYwKUeLkFGA02o=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UUvfEGalv+8dpofeJmFQdBcO+akwgYTX4KMsmETIxyVbFWrPKAPbuorfOd1xRgiPN dt1/cSGAcTOEv6bP6zQ4UhloGlBOv92owmxriB0UJiAX+J38AnE2fqvYc7Fpm51QrJ wgqP6jgHkvUYGoAOqbBclddJA6dzT/sI4icvyU8w= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/106884] ifcombine may move shift so it shifts more than bitwidth Date: Thu, 08 Sep 2022 09:52:09 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc keywords bug_status everconfirmed cf_reconfirmed_on dependson 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=3D106884 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rguenth at gcc dot gnu.org Keywords| |wrong-code Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed| |2022-09-08 Depends on| |106811 --- Comment #1 from Richard Biener --- Confirmed. r13-131-gc2a0d2e6f636c6 addressed some issues, but leaves others such as shifts seen here. It's not clear if (int)1 << 33 is undefined beha= vior in GIMPLE, see PR106811. Note that ifcombine doesn't simply transform this to (x & c) & (x & (1 << b)), thus removing the short-circuiting, instead it computes tem =3D c | (1<