From patchwork Fri Mar 29 13:06:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 232398 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 63BB72C00BC for ; Sat, 30 Mar 2013 00:08:59 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:in-reply-to:subject:mime-version:content-type:message-id :date; q=dns; s=default; b=hae3FpfcxiHhjmMeGcv5KvLcaaPj9mNHYuCSK rIiPuHVXlYTzVqCBTfSrdF5gwAjBNwFD1cwgs8sB12QWsI8pfkbpI/gCT2yCdhjR h9ltStzkcDQyt5FdG5QWdU2XRojILkyBf+hvTdkk5mLW0gpxGfuMnejGe1gtKn+K bJVvag= 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:from :to:cc:in-reply-to:subject:mime-version:content-type:message-id :date; s=default; bh=ROwxGYs3cbNadL7d32isGP3lKZs=; b=vHKluwet9eW SextsIbaZCr+nX+OJR/+X1YkVV84i905WSDPJ4MklhKBM4AsL/OJj3hDjc6qiAGU pGZYv+5DCsizAsapuNhIXuVpd20MulDrIUNGvvZZd5S553DbRpr9TGRMTW3w9EKB HXF91/p/YEmB0VisvWcD/2zJn4Z+cOKI= Received: (qmail 23969 invoked by alias); 29 Mar 2013 13:06:26 -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 23549 invoked by uid 89); 29 Mar 2013 13:06:18 -0000 X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_THREADED, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, TW_TM autolearn=ham version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 29 Mar 2013 13:06:11 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1ULZ0T-0000Gd-Vc from Tom_deVries@mentor.com ; Fri, 29 Mar 2013 06:06:10 -0700 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 29 Mar 2013 06:06:09 -0700 Received: from build1-lucid-cs (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.1.289.1; Fri, 29 Mar 2013 06:06:09 -0700 Received: by build1-lucid-cs (Postfix, from userid 49877) id 2E0FA4213AB; Fri, 29 Mar 2013 06:06:08 -0700 (PDT) From: Tom de Vries To: Richard Earnshaw CC: gcc-patches In-Reply-To: <51558EF4.1030106@mentor.com> Subject: [PATCH][05/10] -fuse-caller-save - Implement TARGET_FN_OTHER_HARD_REG_USAGE hook for ARM MIME-Version: 1.0 Message-ID: <20130329130609.2E0FA4213AB@build1-lucid-cs> Date: Fri, 29 Mar 2013 06:06:09 -0700 X-Virus-Found: No Richard, This patch series adds analysis of register usage of functions for usage by IRA. The original post is here ( http://gcc.gnu.org/ml/gcc-patches/2013-01/msg01234.html ). This patch implements the target hook TARGET_FN_OTHER_HARD_REG_USAGE for ARM. The target hook TARGET_FN_OTHER_HARD_REG_USAGE was introduced in the previous patch in this patch series. Build and reg-tested on ARM. OK for trunk? Thanks, -Tom 2013-03-29 Radovan Obradovic Tom de Vries * config/arm/arm.c (TARGET_FN_OTHER_HARD_REG_USAGE): Redefine as arm_fn_other_hard_reg_usage. (arm_fn_other_hard_reg_usage): New function. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 5f63a2e..341fa86 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -280,6 +280,7 @@ static unsigned arm_add_stmt_cost (void *data, int count, static void arm_canonicalize_comparison (int *code, rtx *op0, rtx *op1, bool op0_preserve_value); +static void arm_fn_other_hard_reg_usage (struct hard_reg_set_container *); /* Table of machine attributes. */ static const struct attribute_spec arm_attribute_table[] = @@ -649,6 +650,10 @@ static const struct attribute_spec arm_attribute_table[] = #define TARGET_CANONICALIZE_COMPARISON \ arm_canonicalize_comparison +#undef TARGET_FN_OTHER_HARD_REG_USAGE +#define TARGET_FN_OTHER_HARD_REG_USAGE \ + arm_fn_other_hard_reg_usage + struct gcc_target targetm = TARGET_INITIALIZER; /* Obstack for minipool constant handling. */ @@ -3762,6 +3767,19 @@ arm_canonicalize_comparison (int *code, rtx *op0, rtx *op1, } } +/* Implement TARGET_FN_OTHER_HARD_REG_USAGE. */ + +static void +arm_fn_other_hard_reg_usage (struct hard_reg_set_container *regs) +{ + if (TARGET_AAPCS_BASED) + { + /* For AAPCS, IP and CC can be clobbered by veneers inserted by the + linker. */ + SET_HARD_REG_BIT (regs->set, IP_REGNUM); + SET_HARD_REG_BIT (regs->set, CC_REGNUM); + } +} /* Define how to find the value returned by a function. */