From patchwork Mon Mar 20 11:43:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Zissulescu X-Patchwork-Id: 740970 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 3vmvMb67Jwz9s3w for ; Mon, 20 Mar 2017 22:47:55 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="tCakVbkW"; dkim-atps=neutral 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:subject:date:message-id:in-reply-to:references :mime-version:content-type; q=dns; s=default; b=cScT046ucrR3Z4fi BZPS+qhyxIn2ktkg4thi2dLQrIY4FAx1eUdvJCQCi2LoPsg7hPZU7qoXSByTENf5 BqKwDwz0B1ulgdRf91kXgZgMyNcVwliiy++1BWR4Dd57L5XtEZ83HY4tFDlxLzgQ cll+oKyMR1zvouqSwcisvasRd7U= 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:subject:date:message-id:in-reply-to:references :mime-version:content-type; s=default; bh=Yopz+1mjU5P0ida8Uif4Wf bW98Q=; b=tCakVbkWketu9XxFSBvmdQCWAywsHmwcwn48xyAX0k5+IyBBUQhYtF a6VTYFJHhE893l7X9c+ygKkg+qPQrxLXvCZfjEMl1gMg/Fso5OUfa9YPQERgeYO1 5FyDtU1zX7b8UQi8Mjkn6BqZHkVFJU8FxmF6GTN59Dc9puUCET0Do= Received: (qmail 122866 invoked by alias); 20 Mar 2017 11:47:47 -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 122381 invoked by uid 89); 20 Mar 2017 11:47:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=metal X-HELO: smtprelay.synopsys.com Received: from us01smtprelay-2.synopsys.com (HELO smtprelay.synopsys.com) (198.182.47.9) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 20 Mar 2017 11:47:44 +0000 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id A4AAC24E1725; Mon, 20 Mar 2017 04:47:43 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 91F69FCC; Mon, 20 Mar 2017 04:47:43 -0700 (PDT) Received: from US01WEHTC2.internal.synopsys.com (us01wehtc2.internal.synopsys.com [10.12.239.237]) by mailhost.synopsys.com (Postfix) with ESMTP id 89054FC9; Mon, 20 Mar 2017 04:47:43 -0700 (PDT) Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.106) by US01WEHTC2.internal.synopsys.com (10.12.239.237) with Microsoft SMTP Server (TLS) id 14.3.266.1; Mon, 20 Mar 2017 04:46:04 -0700 Received: from IN01WEHTCA.internal.synopsys.com (10.144.199.103) by IN01WEHTCB.internal.synopsys.com (10.144.199.105) with Microsoft SMTP Server (TLS) id 14.3.266.1; Mon, 20 Mar 2017 17:16:02 +0530 Received: from nl20droid1.internal.synopsys.com (10.100.24.228) by IN01WEHTCA.internal.synopsys.com (10.144.199.243) with Microsoft SMTP Server (TLS) id 14.3.266.1; Mon, 20 Mar 2017 17:16:02 +0530 From: Claudiu Zissulescu To: CC: , , Subject: [PATCH 3/5] [ARC] Disable TP register when building for bare metal. Date: Mon, 20 Mar 2017 12:43:28 +0100 Message-ID: <1490010210-9489-4-git-send-email-claziss@synopsys.com> In-Reply-To: <1490010210-9489-1-git-send-email-claziss@synopsys.com> References: <1490010210-9489-1-git-send-email-claziss@synopsys.com> MIME-Version: 1.0 No need for thread pointer in bare metal toolchain. Use TP register normally. gcc/ 2016-09-29 Claudiu Zissulescu * config/arc/elf.h (ARGET_ARC_TP_REGNO_DEFAULT): Define. * config/arc/linux.h (ARGET_ARC_TP_REGNO_DEFAULT): Likewise. * config/arc/arc.opt (mtp-regno): Use ARGET_ARC_TP_REGNO_DEFAULT. --- gcc/config/arc/arc.opt | 2 +- gcc/config/arc/elf.h | 5 +++++ gcc/config/arc/linux.h | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gcc/config/arc/arc.opt b/gcc/config/arc/arc.opt index 17af736..6060ded 100644 --- a/gcc/config/arc/arc.opt +++ b/gcc/config/arc/arc.opt @@ -469,7 +469,7 @@ EnumValue Enum(arc_fpu) String(fpud_all) Value(FPU_FPUD_ALL) mtp-regno= -Target RejectNegative Joined UInteger Var(arc_tp_regno) Init(25) +Target RejectNegative Joined UInteger Var(arc_tp_regno) Init(TARGET_ARC_TP_REGNO_DEFAULT) Specify thread pointer register number. mtp-regno=none diff --git a/gcc/config/arc/elf.h b/gcc/config/arc/elf.h index d2106c5..a6d6c05 100644 --- a/gcc/config/arc/elf.h +++ b/gcc/config/arc/elf.h @@ -53,3 +53,8 @@ along with GCC; see the file COPYING3. If not see # define MULTILIB_DEFAULTS { "mcpu=" ARC_MULTILIB_CPU_DEFAULT } # endif #endif + +/* Bare-metal toolchains are not having a thread pointer register + set. */ +#undef TARGET_ARC_TP_REGNO_DEFAULT +#define TARGET_ARC_TP_REGNO_DEFAULT -1 diff --git a/gcc/config/arc/linux.h b/gcc/config/arc/linux.h index 10c291c..1d10357 100644 --- a/gcc/config/arc/linux.h +++ b/gcc/config/arc/linux.h @@ -74,3 +74,7 @@ along with GCC; see the file COPYING3. If not see /* We do not have any MULTILIB_OPTIONS specified, so there are no MULTILIB_DEFAULTS. */ #undef MULTILIB_DEFAULTS + +/* Linux toolchains are using r25 as TLS register. */ +#undef TARGET_ARC_TP_REGNO_DEFAULT +#define TARGET_ARC_TP_REGNO_DEFAULT 25