From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 70F633858404; Fri, 26 Aug 2022 11:33:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 70F633858404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661513636; bh=tNfC95MfOYvs1eFU7mh6um/mooJ2FP3AkhCaTrBSTjE=; h=From:To:Subject:Date:From; b=QfzzJxGCyXN3fg3drnqVFPbTYrgCldg4xQXlVaDMSsPXJ+31wfZqkZbna1U0/5Rjq AdSLLv50QGL+wQbkWDfaiOf4HMILrQgrOFV60CMvZtNnNncLP59pedikKgwBGBBf4V AIH0r/jkojHe34r9CugB6FqTU0NFAEph3+NCqkRo= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/106754] New: compute_control_dep_chain over-estimates domain Date: Fri, 26 Aug 2022 11:33:56 +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=3D106754 Bug ID: 106754 Summary: compute_control_dep_chain over-estimates domain 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: --- The following testcase shows compute_control_dep_chain for init_use_preds of the 'return u' uninitialized use compute a path with w !=3D 0 && v !=3D = 1, leaving out the !(i < 10) loop exit predicate because of how the iteration terminating condition on the post-dominator walk works. While there's a special case for the loop exit edge itself, the following if (y) z =3D 1; intermediate post-dominator will still make the iteration terminate early before reaching if (v !=3D 1) and eventually the target block. The parent iteration which entered the loop will proceed to find that but the loop exit condition will be lost. extern unsigned bar (void); extern void quux (void); int z; unsigned foo (unsigned v, int y, int w) { unsigned u; if (v !=3D 1) u =3D bar (); // This variantion from uninit-pred-11.c causes compute_control_dep_chain // to run into a defect, producing z !=3D 0 && v !=3D 1, omitting !(i<10) // from the path predicate if (w) { for (int i =3D 0; i < 10; i++) quux (); if (y) z =3D 1; if (v !=3D 1) return u; } return 0; }=