From patchwork Thu Sep 11 13:27:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schmidt X-Patchwork-Id: 388244 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 7D9E41400EA for ; Thu, 11 Sep 2014 23:28:23 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=cagvUWxL1ejW6ztM6FgL4y29UG6tM2P9tT2tkj1W9X1ZaN ls2aFyaksxFjKV7gsGHbaRLxdPUaWLQy882ave1B2dD5NEJ6Xo1VS4Z3lGBBzyLS gc5Cdju8SbASo+PmhN9QQHwk8GnlrDog/KjOAKSYioPWJpU71Ai8nPHux84rE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=/LkHxByZXHzXyJjQoOHtp50ilBQ=; b=hDmAcNLIny5Aeuwzxl09 cDZVKMXybXGZui5Pfdc8PpsrPzyn6P6ClshPHliiZVi54OxzH4kZ9FunYE5LV8Jw dDH105EoSsv6tTmRGqJnD4eywxW88tVR3Rpu+HezRQskFrkssJApycpnqMJhrdhO Di0oFXE2rnvHTF1U3mteFrM= Received: (qmail 32725 invoked by alias); 11 Sep 2014 13:28:16 -0000 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 Received: (qmail 32712 invoked by uid 89); 11 Sep 2014 13:28:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, T_FROM_12LTRDOM autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 11 Sep 2014 13:28:14 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1XS4Pz-00071N-FU from Bernd_Schmidt@mentor.com for gcc-patches@gcc.gnu.org; Thu, 11 Sep 2014 06:28:11 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.3.181.6; Thu, 11 Sep 2014 14:28:10 +0100 Message-ID: <5411A337.7000302@codesourcery.com> Date: Thu, 11 Sep 2014 15:27:19 +0200 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.8.0 MIME-Version: 1.0 To: GCC Patches Subject: ptx preliminary rtl patches [4/4] It turns out that we're calling eliminate_regs for global variables which can't possibly have eliminable regs in their decl. At that point, reg_eliminate can be NULL. This patch avoids unnecessary work, and allows us to add an assert to eliminate_regs later. Bootstrapped and tested on x86_64-linux, together with the other patches. Ok? Bernd * dbxout.c (dbxout_symbol): Don't call eliminate_regs on TREE_STATIC decls. diff --git a/gcc/dbxout.c b/gcc/dbxout.c index d856bdd..ffef1f5 100644 --- a/gcc/dbxout.c +++ b/gcc/dbxout.c @@ -2887,7 +2887,8 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED) if (!decl_rtl) DBXOUT_DECR_NESTING_AND_RETURN (0); - decl_rtl = eliminate_regs (decl_rtl, VOIDmode, NULL_RTX); + if (!TREE_STATIC (decl)) + decl_rtl = eliminate_regs (decl_rtl, VOIDmode, NULL_RTX); #ifdef LEAF_REG_REMAP if (crtl->uses_only_leaf_regs) leaf_renumber_regs_insn (decl_rtl);