From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19960 invoked by alias); 22 Oct 2012 09:26:47 -0000 Received: (qmail 19911 invoked by uid 48); 22 Oct 2012 09:26:27 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/55011] [4.8 Regression] GCC in an infinite loop at -O2 in VRP Date: Mon, 22 Oct 2012 09:26:00 -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-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-10/txt/msg01937.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55011 --- Comment #2 from Jakub Jelinek 2012-10-22 09:26:26 UTC --- I bet this regressed with http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189885 together with one of r188728, r188776 or r188780 (in between r188700 and r188800 it started to ICE, and with r189885 it started to loop infinitely instead of ICEing). If you want to iterate one more time, I think it would be better to ensure you iterate just one more time and not infinitely. Perhaps we could abuse for that the vr_phi_edge_counts array, if if (edges > 0 && gimple_phi_num_args (phi) > 1 && lhs_vr->type == VR_UNDEFINED) { if (edges == old_edges) /* Iterate one more time, but ensure next time we drop to varying instead of looping forever. */ vr_phi_edge_counts[SSA_NAME_VERSION (lhs)] = -edges; else if (edges == -old_edges) goto varying; } before the if (edges > 0 && gimple_phi_num_args (phi) > 1 && edges == old_edges && lhs_vr->type != VR_UNDEFINED)