From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 648A13858400; Sun, 16 Jan 2022 15:57:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 648A13858400 From: "amacleod at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/104038] ranger infinite loop on a PHI statement while building Clang Date: Sun, 16 Jan 2022 15:57:08 +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: 12.0 X-Bugzilla-Keywords: compile-time-hog, memory-hog X-Bugzilla-Severity: normal X-Bugzilla-Who: amacleod at redhat dot com 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: 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: Sun, 16 Jan 2022 15:57:08 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104038 --- Comment #8 from Andrew Macleod --- The issue is transitive relations are being registered in an unbounded way. SymCount_369 =3D SymCount_368 + 1; SymCount_370 =3D SymCount_369 + 1; SymCount_371 =3D SymCount_370 + 1; _370 > _369, and _369 is > _368, so it registers a transitive relation betw= een _370 > _368 Then we register _371 > 370 and transitive relations_371 > 369 as well as _= 371 > 368 This cascades as the chain gets longer and would be quadratic in nature. This is then compounded by the currently linear nature of looking up a rela= tion within the current basic block. On monday, I will introduce a capping heuristic to transitivity and/or limi= ting the number of relations we can add to a block, preventing either situation = from being an issue going forward.=