From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9E85F3953074; Fri, 12 Jun 2020 07:33:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9E85F3953074 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1591947226; bh=2ir2FuBBeZo3LFsw5QgtUg8cFUFfJ1kUuquBScXo1T8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Brbq6ByrJKps9beJdAoJLwd53u7vHQSbNJha57LAkwozwhzaEprtD4zCw15n7OuUp pWmH4pvOnq/vmD4299oAs6BfkELxAmFvO/W94e8XFVy/VGYqlOYgGktf5SG5NIZZsV /UFsBxMlPhGA23p0vps1T9kaAwUFFYTvH3JVR3vY= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/95643] Optimizer fails to realize that a variable tested twice in a row is the same both times Date: Fri, 12 Jun 2020 07:33:46 +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: 10.1.0 X-Bugzilla-Keywords: easyhack, missed-optimization 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 everconfirmed cf_reconfirmed_on bug_status keywords 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, 12 Jun 2020 07:33:46 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95643 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rguenth at gcc dot gnu.org Ever confirmed|0 |1 Last reconfirmed| |2020-06-12 Status|UNCONFIRMED |NEW Keywords| |easyhack --- Comment #2 from Richard Biener --- Confirmed. value-numbering doesn't use the alternate assertion discovery code and thus for the partly simplified condition does not record the appropriate expressions. Likewise EVRP lacks simple forward-propagation during this assertion discovery (value-numbering would also need that) in register_edge_assert_for (where it tests for defs like a & b and a | b it needs to look for a simple boolean re-test/inversion as well). Should be easy to amend for this case.=