From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21411 invoked by alias); 20 Feb 2014 11:59:31 -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 Received: (qmail 21356 invoked by uid 48); 20 Feb 2014 11:59:28 -0000 From: "abel at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/60268] [4.9 regression] ICE: in rank_for_schedule, at haifa-sched.c:2557 Date: Thu, 20 Feb 2014 11:59: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-Version: 4.9.0 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: 4.9.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-02/txt/msg02099.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60268 --- Comment #4 from Andrey Belevantsev --- (In reply to Jakub Jelinek from comment #2) I forgot the single block regions case, so the nr_regions_initial init should be moved to the bottom of sched_rgn_init. The check before free_global_sched_pressure_data can be moved before if() like in the below patch, this way we do not call it each time after we have reset sched_pressure to NONE for the new regions, or I can drop it altogether, as you prefer. diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c index 0573b6a..dc6fa16 100644 --- a/gcc/sched-rgn.c +++ b/gcc/sched-rgn.c @@ -1067,7 +1067,6 @@ haifa_find_rgns (void) BLOCK_TO_BB (bb->index) = 0; } - nr_regions_initial = nr_regions; free (max_hdr); free (degree); free (stack); @@ -2997,10 +2996,10 @@ schedule_region (int rgn) /* Do not support register pressure sensitive scheduling for the new regions as we don't update the liveness info for them. */ - if (rgn >= nr_regions_initial) + if (sched_pressure != SCHED_PRESSURE_NONE + && rgn >= nr_regions_initial) { - if (sched_pressure != SCHED_PRESSURE_NONE) - free_global_sched_pressure_data (); + free_global_sched_pressure_data (); sched_pressure = SCHED_PRESSURE_NONE; } @@ -3166,6 +3165,7 @@ sched_rgn_init (bool single_blocks_p) RGN_BLOCKS (nr_regions) = (RGN_BLOCKS (nr_regions - 1) + RGN_NR_BLOCKS (nr_regions - 1)); + nr_regions_initial = nr_regions; } /* Free data structures for region scheduling. */