From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12560 invoked by alias); 24 Dec 2010 08:23:18 -0000 Received: (qmail 12548 invoked by uid 22791); 24 Dec 2010 08:23:17 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 24 Dec 2010 08:23:13 +0000 From: "abel at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/45352] ICE: in reset_sched_cycles_in_current_ebb, at sel-sched.c:7058 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: abel at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: abel at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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 Date: Fri, 24 Dec 2010 08:23:00 -0000 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: 2010-12/txt/msg02593.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45352 --- Comment #25 from Andrey Belevantsev 2010-12-24 08:23:07 UTC --- Zdenek, please don't worry about the set of flags, it does not make fixing the problem any harder, and your work on finding these is invaluable for us. Sigh, in this case I forgot that we now also stall when we have issued exactly issue_rate instructions, so in this case we also need to recheck the DFA, not only after the data dependency stall. So the last patch should be amended like below. diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c index edd6cb9..2f721fb 100644 --- a/gcc/sel-sched.c +++ b/gcc/sel-sched.c @@ -6990,7 +6990,7 @@ reset_sched_cycles_in_current_ebb (void) { int cost, haifa_cost; int sort_p; - bool asm_p, real_insn, after_stall; + bool asm_p, real_insn, after_stall, all_issued; int clock; if (!INSN_P (insn)) @@ -7026,8 +7026,8 @@ reset_sched_cycles_in_current_ebb (void) haifa_cost = cost; after_stall = 1; } - if (haifa_cost == 0 - && issued_insns == issue_rate) + all_issued = issued_insns == issue_rate; + if (haifa_cost == 0 && all_issued) haifa_cost = 1; if (haifa_cost > 0) { @@ -7059,7 +7059,7 @@ reset_sched_cycles_in_current_ebb (void) become unavailable to the DFA restrictions. Looks strange but happens e.g. on x86-64. So recheck DFA on the last iteration. */ - if (after_stall + if ((after_stall || all_issued) && real_insn && haifa_cost == 0) haifa_cost = estimate_insn_cost (insn, curr_state);