From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19866 invoked by alias); 26 Mar 2012 12:27:10 -0000 Received: (qmail 19850 invoked by uid 22791); 26 Mar 2012 12:27:07 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_CP 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; Mon, 26 Mar 2012 12:26:54 +0000 From: "abel at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/52715] [4.8 Regression] ICE: in reset_sched_cycles_in_current_ebb, at sel-sched.c:7140 with -fselective-scheduling2 -funroll-loops --param=max-average-unrolled-insns=406 Date: Mon, 26 Mar 2012 12:27:00 -0000 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: ice-on-valid-code 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: 4.8.0 X-Bugzilla-Changed-Fields: Status Last reconfirmed AssignedTo Ever Confirmed 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-03/txt/msg02227.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52715 Andrey Belevantsev changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2012-03-26 AssignedTo|unassigned at gcc dot |abel at gcc dot gnu.org |gnu.org | Ever Confirmed|0 |1 --- Comment #1 from Andrey Belevantsev 2012-03-26 12:26:53 UTC --- Sigh. Of course optimizing calculation of whether an insn change the state as in PR 52203 was wrong, one needs to calculate this right before actually scheduling the insn as the state may change. Thus, reverting the fix for 52203 and doing the below instead is not only safe but correct: diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c index 2829f60..f5ae9817 100644 --- a/gcc/sel-sched.c +++ b/gcc/sel-sched.c @@ -7127,8 +7124,14 @@ reset_sched_cycles_in_current_ebb (void) if (real_insn) { + static state_t temp = NULL; + + if (!temp) + temp = xmalloc (dfa_state_size); + memcpy (temp, curr_state, dfa_state_size); + cost = state_transition (curr_state, insn); - if (!empty) + if (memcmp (temp, curr_state, dfa_state_size)) issued_insns++; if (sched_verbose >= 2)