From patchwork Mon Aug 22 07:46:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikael Pettersson X-Patchwork-Id: 110863 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 554F7B6F6F for ; Mon, 22 Aug 2011 17:46:52 +1000 (EST) Received: (qmail 14042 invoked by alias); 22 Aug 2011 07:46:48 -0000 Received: (qmail 13824 invoked by uid 22791); 22 Aug 2011 07:46:47 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, TW_SV X-Spam-Check-By: sourceware.org Received: from fanny.its.uu.se (HELO fanny.its.uu.se) (130.238.4.241) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 22 Aug 2011 07:46:19 +0000 Received: from fanny.its.uu.se (localhost [127.0.0.1]) by fanny.its.uu.se (Postfix) with ESMTP id 2DD226251 for ; Mon, 22 Aug 2011 09:46:18 +0200 (MSZ) Received: from pilspetsen.it.uu.se (pilspetsen.it.uu.se [130.238.18.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by fanny.its.uu.se (Postfix) with ESMTP id DE5BF61F7 for ; Mon, 22 Aug 2011 09:46:17 +0200 (MSZ) Received: (from mikpe@localhost) by pilspetsen.it.uu.se (8.14.4+Sun/8.14.4) id p7M7kHLS013918; Mon, 22 Aug 2011 09:46:17 +0200 (MEST) MIME-Version: 1.0 Message-ID: <20050.2377.468194.552162@pilspetsen.it.uu.se> Date: Mon, 22 Aug 2011 09:46:17 +0200 From: Mikael Pettersson To: gcc-patches@gcc.gnu.org Subject: [PATCH] make assign_hard_reg's saved_nregs conditional to unbreak ARM bootstrap (PR50146) 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 As described in PR50146, a recent change to ira-color.c caused trunk to fail to bootstrap on ARM. The issue is that a new variable saved_nregs is declared unconditionally but used #ifndef HONOR_REG_ALLOC_ORDER. Since the ARM backend defines HONOR_REG_ALLOC_ORDER, an 'unused variable' warning results, which becomes a hard error in stage 2. Fixed by moving the declaration to the #ifndef HONOR_REG_ALLOC_ORDER block of variable declarations. With this in place bootstrap succeeds on armv5tel-linux-gnueabi. Patch was pre-approved by Vladimir Makarov in the PR trail, but I don't have svn write access so I'll need help to commit it. /Mikael gcc/ 2011-08-22 Mikael Pettersson PR bootstrap/50146 * ira-color.c (assign_hard_reg): Move saved_nregs declaration to #ifndef HONOR_REG_ALLOC_ORDER block. --- gcc-4.7-20110820/gcc/ira-color.c.~1~ 2011-08-18 16:56:36.000000000 +0200 +++ gcc-4.7-20110820/gcc/ira-color.c 2011-08-21 19:11:00.000000000 +0200 @@ -1567,13 +1567,14 @@ static bool assign_hard_reg (ira_allocno_t a, bool retry_p) { HARD_REG_SET conflicting_regs[2], profitable_hard_regs[2]; - int i, j, hard_regno, best_hard_regno, class_size, saved_nregs; + int i, j, hard_regno, best_hard_regno, class_size; int cost, mem_cost, min_cost, full_cost, min_full_cost, nwords, word; int *a_costs; enum reg_class aclass; enum machine_mode mode; static int costs[FIRST_PSEUDO_REGISTER], full_costs[FIRST_PSEUDO_REGISTER]; #ifndef HONOR_REG_ALLOC_ORDER + int saved_nregs; enum reg_class rclass; int add_cost; #endif