From patchwork Tue Apr 4 09:59:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Zissulescu X-Patchwork-Id: 746725 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 3vy4M94YtZz9s8F for ; Tue, 4 Apr 2017 20:04:21 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="jFpN2cST"; 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=f0kyqmx9tgaKDYvL nEtAkZUU1iMQzaIll/LufMIsFXeF/oArzdBY4GFCUigSKzbyNZTIcbsFEVrQIlDI oy0jbOHu1SMziVFlZWhGcgC5fcxWu61EEitE7u98r4xTRZA4gR3kpyeXHecb+LB8 L6b7jmrEm8C3ra3BfpJMqmOJGnY= 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=m4SpRnnT0PgZ6BrWB9YBBu aXUjY=; b=jFpN2cSTqieWzsVdsIsKqrt/ad1N9Wnrwyc8ttl+cxgPh5y/ViduFt oJxV+h4cvCF1jWGO0vRftuJROZcSp2uoXfPQddi5Q4MuFzsFOen0m7xaVT270ixz 6ujxF+29fRb9Yyl7LI+KuYYD4Vi8T2EyYIXPbAiD+TBIuq9+nOjdQ= Received: (qmail 19064 invoked by alias); 4 Apr 2017 10:02: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 18656 invoked by uid 89); 4 Apr 2017 10:02:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.6 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=expands X-HELO: smtprelay.synopsys.com Received: from smtprelay4.synopsys.com (HELO smtprelay.synopsys.com) (198.182.47.9) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 04 Apr 2017 10:02:13 +0000 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id 111B824E1283; Tue, 4 Apr 2017 03:02:14 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id E853BDFD; Tue, 4 Apr 2017 03:02:13 -0700 (PDT) Received: from us01wehtc1.internal.synopsys.com (us01wehtc1.internal.synopsys.com [10.12.239.235]) by mailhost.synopsys.com (Postfix) with ESMTP id C1AAADF8; Tue, 4 Apr 2017 03:02:13 -0700 (PDT) Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.106) by us01wehtc1.internal.synopsys.com (10.12.239.235) with Microsoft SMTP Server (TLS) id 14.3.266.1; Tue, 4 Apr 2017 03:01:43 -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; Tue, 4 Apr 2017 15:31:41 +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; Tue, 4 Apr 2017 15:31:40 +0530 From: Claudiu Zissulescu To: CC: , , Subject: [PATCH 3/3] [ARC] Use long jumps for CRT calls Date: Tue, 4 Apr 2017 11:59:01 +0200 Message-ID: <1491299941-3908-4-git-send-email-claziss@synopsys.com> In-Reply-To: <1491299941-3908-1-git-send-email-claziss@synopsys.com> References: <1491299941-3908-1-git-send-email-claziss@synopsys.com> MIME-Version: 1.0 There are situations when the range offered by the bl instruction is not sufficient to reach CRT routines. Thus, use a long jump construction. gcc/ 2016-04-21 Claudiu Zissulescu * config/arc/arc.h (CRT_CALL_STATIC_FUNCTION): Use long calls. --- gcc/config/arc/arc.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h index 0237e66..0c7e561 100644 --- a/gcc/config/arc/arc.h +++ b/gcc/config/arc/arc.h @@ -1518,10 +1518,11 @@ extern enum arc_function_type arc_compute_function_type (struct function *); /* Called by crtstuff.c to make calls to function FUNCTION that are defined in SECTION_OP, and then to switch back to text section. */ #undef CRT_CALL_STATIC_FUNCTION -#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ - asm (SECTION_OP "\n\t" \ - "bl @" USER_LABEL_PREFIX #FUNC "\n" \ - TEXT_SECTION_ASM_OP); +#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ + asm (SECTION_OP "\n\t" \ + "add r12,pcl,@" USER_LABEL_PREFIX #FUNC "@pcl\n\t" \ + "jl [r12]\n" \ + TEXT_SECTION_ASM_OP); /* This macro expands to the name of the scratch register r12, used for temporary calculations according to the ABI. */