From patchwork Fri Apr 14 12:14:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Zissulescu X-Patchwork-Id: 750832 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 3w4GwW3K70z9ryr for ; Fri, 14 Apr 2017 22:21:15 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="uPcbLqlN"; 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=E94WihObr7HR5aKb jrgFMZCUkqXXPXdWvIyyljKbZlBwVZkavOPjkrRXQtCTqhpK1WK75dkoHvaGNSm6 u0i1pwuFPwXvf/K3gTT3OA/0Ect1gQBaU2Ma3bDFbrkmWfTh2++IYsxZpDjME3iY tuk0PHtwAjvy69K2mHTCLrk2Omk= 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=LTPW30BKS2rQ3Cj6s7JQ7y voCXI=; b=uPcbLqlNarItDGTbeodpZweajULnvPc4y/pgVYZwzU/Joc6sDb68vB GDeYoScbzyX+eDnCFkEfV2dv0cWadoDyDRwI2NaSqUPQU2m+dfx5WoODRC2/3wZ+ EA3WPZte1SvxJIgJWV+HZAReG7P29XwilquKP6FAf1UE6oLnXcGng= Received: (qmail 20741 invoked by alias); 14 Apr 2017 12:20:39 -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 20582 invoked by uid 89); 14 Apr 2017 12:20:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.7 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= 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; Fri, 14 Apr 2017 12:20:35 +0000 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id 0B4FD24E16B7; Fri, 14 Apr 2017 05:20:36 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id F197AF4E; Fri, 14 Apr 2017 05:20:35 -0700 (PDT) Received: from us01wehtc1.internal.synopsys.com (us01wehtc1.internal.synopsys.com [10.12.239.235]) by mailhost.synopsys.com (Postfix) with ESMTP id E8080F4B; Fri, 14 Apr 2017 05:20:35 -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; Fri, 14 Apr 2017 05:17:36 -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; Fri, 14 Apr 2017 17:47:33 +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; Fri, 14 Apr 2017 17:47:33 +0530 From: Claudiu Zissulescu To: CC: , , Subject: [PATCH 6/7] [ARC] [Cxx] Fix calling multiple inheritances. Date: Fri, 14 Apr 2017 14:14:43 +0200 Message-ID: <1492172084-3921-7-git-send-email-claziss@synopsys.com> In-Reply-To: <1492172084-3921-1-git-send-email-claziss@synopsys.com> References: <1492172084-3921-1-git-send-email-claziss@synopsys.com> MIME-Version: 1.0 The TARGET_ASM_OUTPUT_MI_THUNK hook doesn't take into account the variant when we compile for PIC. gcc/ 2016-12-13 Claudiu Zissulescu * config/arc/arc.c (arc_output_mi_thunk): Emit PIC calls. --- gcc/config/arc/arc.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index 73d72c68..36582d2 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -6434,10 +6434,28 @@ arc_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, fnaddr = XEXP (DECL_RTL (function), 0); if (arc_is_longcall_p (fnaddr)) - fputs ("\tj\t", file); + { + if (flag_pic) + { + asm_fprintf (file, "\tld\t%s, [pcl, @", + ARC_TEMP_SCRATCH_REG); + assemble_name (file, XSTR (fnaddr, 0)); + fputs ("@gotpc]\n", file); + asm_fprintf (file, "\tj\t[%s]", ARC_TEMP_SCRATCH_REG); + } + else + { + fputs ("\tj\t@", file); + assemble_name (file, XSTR (fnaddr, 0)); + } + } else - fputs ("\tb\t", file); - assemble_name (file, XSTR (fnaddr, 0)); + { + fputs ("\tb\t@", file); + assemble_name (file, XSTR (fnaddr, 0)); + if (flag_pic) + fputs ("@plt\n", file); + } fputc ('\n', file); }