From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4245B383FBBC; Thu, 15 Sep 2022 12:45:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4245B383FBBC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663245911; bh=q+lLdXN/W8cTBDNxp47YfW6HyPaqEhd/tCYg+kbQZuc=; h=From:To:Subject:Date:From; b=wk779AvhD/ac61sxeeqFkERUasuZ4vtP3wxi3A9x5DvLZU5r5o8Oq4H+qS+LTOf7w DI/zGZtRV10vAWSzxhUhVykQhAmoF6eIqz6B6VC/1fUbslnHY8TQwY4goeDWLgLgUR VijOzU3l0kZdn/Efw2z54rIswCNGK/9MlJzkPKNU= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/106950] New: Missed PRE full redundancy without post-loop use Date: Thu, 15 Sep 2022 12:45:11 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D106950 Bug ID: 106950 Summary: Missed PRE full redundancy without post-loop use Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: rguenth at gcc dot gnu.org Target Milestone: --- when we have the situation of PR106922, aka g++.dg/tree-ssa/pr106922.C whic= h is XFAILed on !lp64 because of this there's mem =3D 0; do { if (mem) mem =3D 0; if (mem) // as 'char' instead of 'bool', maybe relevant bar (); if (i++ !=3D n) break; } while (1); .. =3D mem; with the use of 'mem' after the loop we get that antic-in in the loop exit condition block and eventually figure the full redundancy in the conditional redundant set to zero during PRE insertion. When that 'mem' after the loop is _not_ there this isn't triggered (possibly because of the 'char' vs. 'bool' here, but then one can eventually elide the whole if (mem) bar () code).=