From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8384F3853808; Tue, 22 Jun 2021 13:55:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8384F3853808 From: "amacleod at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/101014] [12 Regression] Big compile time hog with -O3 since r12-1268-g9858cd1a6827ee7a Date: Tue, 22 Jun 2021 13:55:26 +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, needs-reduction X-Bugzilla-Severity: normal X-Bugzilla-Who: amacleod at redhat dot com X-Bugzilla-Status: REOPENED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: amacleod at redhat dot com X-Bugzilla-Target-Milestone: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created 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: Tue, 22 Jun 2021 13:55:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101014 --- Comment #17 from Andrew Macleod --- Created attachment 51050 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D51050&action=3Dedit patch to fix the issue The gift that keeps on giving eh. OK, this should solve the infinite loop. Give it a try, I'm running it thro= ugh testing now. When I introduced the sparse on-entry cache, it is limited to 15 unique ran= ges for any given ssa-name, then it reverts to varying for any additional valu= es to be safe. The cache propagation engine works by combining incoming ranges and if that= is different than that current on-entry range, stores that and proceeds to pu= sh this new value on outgoing edges. What was happening here is this new value that was calculated was beyond th= e 15 allowed. When it was stored, it was stored as VARYING. This block was in a cycle feeding back to itself, so when it calculated the on-enty value again= and compared, it though it needed to update again. Which of course failed agai= n... and the endless loop of trying to propagate was born. This patch checks that the value being stored to the cache is the same as t= he value when it is immediately reloaded. If that fails, we stop trying to propagate that value. Please check that it solves both this problam, and likely the 101148 proble= m=