From patchwork Thu Oct 7 11:15:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 67035 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id EFAAFB6F10 for ; Thu, 7 Oct 2010 22:15:42 +1100 (EST) Received: (qmail 24872 invoked by alias); 7 Oct 2010 11:15:41 -0000 Received: (qmail 24862 invoked by uid 22791); 7 Oct 2010 11:15:40 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nikam-dmz.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Oct 2010 11:15:36 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id B61B29ACF67; Thu, 7 Oct 2010 13:15:33 +0200 (CEST) Date: Thu, 7 Oct 2010 13:15:33 +0200 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Fix -fwhopr testsuite failures Message-ID: <20101007111533.GB5152@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi, this fixes the whopr partitioning problems. With updated visibility that got into mainline in meantime we now get into situation where we decide to end partition just at the last node. This makes us to create empty extra partition and because there is sanity check in streaming that partitions are not empty, we get an ICE. Fixed thus, bootstrapped/regtested x86_64-linux, will commit it shortly as obvious. Honza * lto.c (lto_balanced_map): Do not produce empty partitions. Index: lto/lto.c =================================================================== --- lto/lto.c (revision 165087) +++ lto/lto.c (working copy) @@ -1212,6 +1208,9 @@ undo_partition (partition, best_n_nodes, best_n_varpool_nodes); } i = best_i; + /* When we are finished, avoid creating empty partition. */ + if (i == n_nodes - 1) + break; partition = new_partition (""); last_visited_cgraph_node = 0; last_visited_varpool_node = 0;