From patchwork Tue Jun 4 20:10:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evgeny Karpov X-Patchwork-Id: 1943560 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=microsoft.com header.i=@microsoft.com header.a=rsa-sha256 header.s=selector2 header.b=Xf2WEokS; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vv1tw3Cylz20WL for ; Wed, 5 Jun 2024 06:11:03 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9C7CE3819997 for ; Tue, 4 Jun 2024 20:11:01 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on20700.outbound.protection.outlook.com [IPv6:2a01:111:f403:2613::700]) by sourceware.org (Postfix) with ESMTPS id ACF4838845AF for ; Tue, 4 Jun 2024 20:10:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ACF4838845AF Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=microsoft.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=microsoft.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ACF4838845AF Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2613::700 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1717531841; cv=pass; b=N0vI1H+hWR1TeTPqWbh9oLDcekNeAUDYc+/HGS4zfXjxvh5DWLefLLHGiq+1ScV1OuZ06ubFYCyxF+SmF3p+HgEGZrrd+sKgX2mBFazOa/MW28dXww5GGYaiEQH+aUmgN42mwa32ka1kjAOOfdt12I42IEsJyHdWNhhP7qerpHQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1717531841; c=relaxed/simple; bh=HZKGiuZT1h6FlTCvetXMAyJn981MXY9wkOE97e7BjHE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Fq6bOrCjPENFnYAR5ZYG1z5kZbuXDgghJVXezCbJbKIk/L0q1KdiJaLfw+kYuadPDoaRpcTnWAaXp3s0A7QzfQ89OLUoGb3k38KlcZEvpStZA/aoBCzMsc5idzzyrVnocyHED0OwHq5VgbQaOOqv9oxi4P4pmlbP8DgSbRiTTCE= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hrMrOyBY1oZV9uVR/SeQq7ds84CRT5swEDunAvkTL4nfIJBg74ILibx7yBEPZqjisJp0mDiwxfTexc+4vmu14lla47ip+NYdboTD/O9dlYOqM6SDxuMiQdkIqLJ0vuCe7xu5iZHzSaScuXla5mKJeT16qaoIhypU5oMJIgnd5wLJZX/we9x+ShOR8jUh2UudLonmq/pNfcMZNXIHHdgtr7gwQJD8DiHYpIUbb9d/SITG32Ks01UdF+15lIpADrwqSShYn84IWnyyg2gVouBMZUjw48uzHigqQcxnZBVEF8upVmgcaQ1hOR3vPwkSRnQBLnxhY/AfYFi8/noTVCk6JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Q+6hyAXa/gygbq7k0aWm829pjkuM5y22kVwljXYPsEo=; b=ffbnEJENHDZZDbljQpVE48/wXN+0l33aTl/sSvIEYoMVSw/X92s+3UAXMDSRbUwrHxtcT7hEY26qnrfkWRSXIy4mbj75bjkX8Hw+OlNTgAXTvYou+oPWzdRObZVhwvi8nZJ1cd1DJcKIezorHyI9EUyjUedt1mBgpnWN6IA/mb7mUs8CnV/m5y34RBYaWEdqDPJWhue50QyLvi/+LUqA3MQsPesZ05cDRieA78Y8c+9oR2204ktRQ37mZFzO47eP6Uro9DQpAudweFL2SX2NXpVFPCVpd2zKvEmdfWW2sBzqAc/evxmgDI8ZACBJx1Q74FnAZgqVv1zr6pr//uqkVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q+6hyAXa/gygbq7k0aWm829pjkuM5y22kVwljXYPsEo=; b=Xf2WEokSrHT155XLe5SL5Am+M6icn6btIGPseVHQKbqaY6HR+RIPSFnBWOZnx+aTI172wrzIOpFuTXuUmN2OVehcsYKvcGN6u7Q8TPnEGuPPtbP2x9UWq9h/7gHBheUWisrhgguBgCT5+cqsL7VbSFHNWNo80vNhDcfWw9rbKlw= Received: from DBBPR83MB0613.EURPRD83.prod.outlook.com (2603:10a6:10:533::21) by VI0PR83MB0641.EURPRD83.prod.outlook.com (2603:10a6:800:212::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.6; Tue, 4 Jun 2024 20:10:31 +0000 Received: from DBBPR83MB0613.EURPRD83.prod.outlook.com ([fe80::399d:9bfc:1209:af10]) by DBBPR83MB0613.EURPRD83.prod.outlook.com ([fe80::399d:9bfc:1209:af10%7]) with mapi id 15.20.7677.001; Tue, 4 Jun 2024 20:10:31 +0000 From: Evgeny Karpov To: Evgeny Karpov , "gcc-patches@gcc.gnu.org" , "richard.sandiford@arm.com" , "ubizjak@gmail.com" CC: "richard.sandiford@arm.com" , "Richard Earnshaw (lists)" , Maxim Kuvyrkov , Radek Barton Subject: [PATCH v1 0/6] Add DLL import/export implementation to AArch64 Thread-Topic: [PATCH v1 0/6] Add DLL import/export implementation to AArch64 Thread-Index: AdqR1zLdB0RlE3SfRYWk1dD+nUW02gk4OKpg Date: Tue, 4 Jun 2024 20:10:30 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=7edbbdf7-0382-4215-8fdf-996305ff5b5e; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2024-04-18T21:26:39Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DBBPR83MB0613:EE_|VI0PR83MB0641:EE_ x-ms-office365-filtering-correlation-id: 66279774-6b9f-44e0-ffc8-08dc84d26225 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|1800799015|376005|366007|38070700009; x-microsoft-antispam-message-info: RrGFDNY0iDyF3Dl9L849OoUiSPjHO83OZixA0FrOjOqx9QZWlaT1zp7bPeBQJRp0pCkgX/kDbAc12QAvV+ib9co568KHsUf94JI+C5u9b2QLcDHSGlqj8jZcZZOGyPYYuAW+x3ue2AOeF4b3U2u96FqXtJ8NFSyxYrtMldC9usR9oWNg1TJjD71IvQUeHzbo3Xquum+ZA6oUlyzYIbKDONvo5GFyMFJ11qLvxPyWdCU7x4vI2TgI1/izrEIQkUcRNRr2b3yM9CbS/UbAFlb3VPUFuyLBDdLmka64nHd1KtCiHMAoD8MhKOLwTHwmANPRFYln+mrbi5okf/n8UeB1kcJN58/zra+TmSbuclLbpR3BJ7hx9WbhHWrwE+RXcUNoggqG6T6KEV2jT7ElGpslUS/lIKfwS+ZoZ3sFJepEXDEdZnKJVbD8SKkqaEYU43uXNrilCImVUWZORQfY3UJ430Qd4DKoBodaPgLCVVbB8Mwinb7yJRKpQ3HPQ/gqRBK6mexAV5BYetEztMX4xHyCEcb2j5/F6A2hUbUufVInx32O3LrSW7ulPnwfcOASpfnBtTvMEzC2i2A/k1Q8223D/HozBqDSlDyyaeSe2JlghAG1mh9Hg+74QEd/NTOy7r78vp4v/uKEzvZU28xf7c2p/adu+lveID39ZGw/LCT43FDb9OSbWYOMCZXHoLhsAZ8OLqdkCBr5XtOd79UEnW5g3t6ltVZQFwyc3ZsHNlx1/CMvx+ZwtpJB8x8sRU9/r78IZaamdwJ1x/DeMdZHE04LVZkf9oqrXtQaEKixPI2d1kby8PxqT3w+i+6VIyecsCZopvupjyIaklZOkIXwWnIdbWsz/duLvBgTHOfu9bIB9qr6MahCl44/4G1BnV9cw4KVVkPWj4MUyVbomZTNiNWMNxbyL6zckmkmn7g1EFpc5dyhhuVsqvxAh3LSVumisvFiNdRgAqLVzJr+43ywvlV2UfEhW0072Dtjvr01qBXwVcW+zEPs4BOSvFhDgsfCI8xV7eTIOWM7YInSiRmNl/zLf6UHLvQh9iwaTzddVBiJbK4u6XtfXENs2sXHIdQM8o/msR6zA+JHLG0TgX+DS+R+qLcFVi/5CxujFjn+SJgyIGv/PcarMQ5Mzm4WUzS5DQyYaRJiqNw7ub8GkVrPr4Wj2IsHXFgrbCdgATBFiBHCvWZ9PqeOQDORvRqC8s1lTAamOZuLtQLlNxG0Qvl0VxJZPutNJzj3a0lCoVMlSS31PGuRrzaFyfdK/hqOtx9rt2b9QaVzaWq/VeO2NDKHvE4XRIiRWavSU2bOG21JiwAwqh3h/Y2g2jJsGFgxcjRLmQFc1vKP3+VRRPCiFxOT3NZTr7o5WE2G5PUcdgSQicFVGAo= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBBPR83MB0613.EURPRD83.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(1800799015)(376005)(366007)(38070700009); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: UeX13uuF2JdI9az/bivgq2xltT+TFsM0npKxSVfo7iaQQQYhRkY2EJRej6DS6GRZc38RVktN2rSzuWSSF7aY8IHPdS2vdpobp0wyZZ4X5YnmzCEzKTchL7iCHa6H4N6sUAubEI+D/6TJ+alfyDc35eBdAagOfDphIylE2ZWFA+VpfOPyW3tuYBojD288UIep8awySpG1ZwtwvnyL2kaWhe5IkfBsro6DCtLa/FuzSMVxI/DpuUoAxDlMiXcOEKF9sEqoEDPH0+8nWr/Km0/AX8pEFCxEmrLVbNffbN6HsJIKvJ+Sy+4kaPTU3i9PbkzhY/LRmDt+gFu+VWl5CIYqgCupgipRNhLTeW6MGjBCiVMLavvUvx88c36ZKbn6hJBYoTKcuspZyvVOxsty5cfnmlrP0NKjYM2Fh6isB4XFsK/1ZAUzACSH8hhXL+f+qqwEttMPx1imTi0cD87jeM6tltKGkn1gILmwrCcjlTq/FviMU47LkcDoOegk2h+zJ8X1GVtXG+nAC+tUNm/PEmGUkXpmxGiopRzjpm74UNY5WM8L+hat29V17jZBSDowDno+ncOhchj6DW3LHpCYuZY8zdGiiDpKLIOlgZMTdjPAmEPXCrXvqjoOZCZPH8IjSGB9dUGY9ODKBWGWTj1z01RRp0q23zyHMZE3GhPKEyAm/ZR8w7WHLH8gUwDKRGbANBlZ8rOiKFzLhhmw4GkYQLqKXSPm3Zb++KeaiRrNKCg++OSyzASIThDbLazIWBQ/UDZzRzvRdM0WaspE8DzVbnHfxoesjZtHdf7HGTo5Nt5gNlBVgjsRhf1ywNSjYWUZVrIPe1qc31EkVGLTKkwE33OTejAgc1z1OEkN+gNN+pD60j1Bnzp2vUOWPI3m5qfqUSJiboB48pXLXArQvlKVcDkBTmdRiGpbeYdHn3OrnGYdgItq9x89W9JL7O2rHi9v4SHsgC20uu0gfUZk8jJLAQuOoNGMNE1WWS/oUjxkC/EpwcwSifMdh0UABquUwSgco7X5oHJcx/BQYrYwlkoyyWGwP//3AqkKdSyCntn8KXGOm57EXa2lUBlJBG9lYNa7qshc8IICKsZXLhF4RyhKMkKh/SYx2fiauTyPPe5QbJXg60RMLuhLlj/I/9eLch4tB2y2A+OM+lO6kYos+9XNk/NAWbHVxbftZO3/uKIwjN946Ma5bWzCN+mA9DesqZu+JPtMEbIyuafMH3mo8eVcE9KJel/ASanm8BmclIkPh5FWpC2dLNdjtH54FMEsGq3vbjGxJDh6566MctPTZOKI1iO/0aO+Sj/KmPA9tUaxVHA0UB3XMwpvINWTG9m6S72g0aREurs6/WcuEvBPeBDJLE8S65h04w7qM7QB/qtEw+ZCVRkemJkHcgq7tS3BCVrPZ/PwXMiOo4xibHWkTsned86n9P0e0CDpzBl98Q4oEZGjLFsGKr5jypDqmG8x3no/SPyTV2AWEx4ZCe+pdy8ozetLRvikiJnSq2lj64AfrX9dr9bmCe0aEwPIw4Ka/bbHq//9ua4IsCu1RX9+qC5nYCCa6TLDQo+/5zH16GjXHxb+O3pe1Ug8IqM94jdbt7UTkNJpEpx8DqflLy5rj7Y75eLx1S65o2S+9yhDvDFMY+l19XREaPTg7QPH5WLq7MWncTy2 MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DBBPR83MB0613.EURPRD83.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 66279774-6b9f-44e0-ffc8-08dc84d26225 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jun 2024 20:10:30.4380 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Z6Nx49nFVFZjSZE7/6TvCTwasGBEUGkBtSaUWjbl98t06kYPQC5hUtULDwNKNr4RIEetTORKeyZwHOnL/lJbzw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR83MB0641 X-Spam-Status: No, score=-8.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, KAM_NUMSUBJECT, KAM_STOCKGEN, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Richard and Uros, could you please review the changes for v2? Additionally, we have detected an issue with GCC GC in winnt-dll.cc. The fix will be included in v2. >> -ix86_handle_selectany_attribute (tree *node, tree name, tree, int, >> +mingw_handle_selectany_attribute (tree *node, tree name, tree, int, >> bool *no_add_attrs) > please reindent the parameters for the new name length. Richard, could you please clarify how it should be done? Thanks! Regards, Evgeny --- gcc/config/aarch64/cygming.h | 6 +++++ gcc/config/i386/cygming.h | 6 +++++ gcc/config/i386/i386-expand.cc | 6 +++-- gcc/config/i386/i386-expand.h | 2 -- gcc/config/i386/i386.cc | 42 ++++++++++------------------------ gcc/config/i386/i386.h | 2 ++ gcc/config/mingw/winnt-dll.cc | 8 ++----- gcc/config/mingw/winnt-dll.h | 2 +- 8 files changed, 33 insertions(+), 41 deletions(-) diff --git a/gcc/config/aarch64/cygming.h b/gcc/config/aarch64/cygming.h index 4beebf9e093..0ff475754e0 100644 --- a/gcc/config/aarch64/cygming.h +++ b/gcc/config/aarch64/cygming.h @@ -183,4 +183,10 @@ still needed for compilation. */ #undef MAX_OFILE_ALIGNMENT #define MAX_OFILE_ALIGNMENT (8192 * 8) +#define CMODEL_IS_NOT_LARGE_OR_MEDIUM_PIC 0 + +#define HAVE_64BIT_POINTERS 1 + +#define GOT_ALIAS_SET mingw_GOT_alias_set () + #endif diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h index ee01e6bb6ce..cd240533dbc 100644 --- a/gcc/config/i386/cygming.h +++ b/gcc/config/i386/cygming.h @@ -469,3 +469,9 @@ do { \ #ifndef HAVE_GAS_ALIGNED_COMM # define HAVE_GAS_ALIGNED_COMM 0 #endif + +#define CMODEL_IS_NOT_LARGE_OR_MEDIUM_PIC ix86_cmodel != CM_LARGE_PIC && ix86_cmodel != CM_MEDIUM_PIC + +#define HAVE_64BIT_POINTERS TARGET_64BIT_DEFAULT + +#define GOT_ALIAS_SET mingw_GOT_alias_set () diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc index fb460e30d0a..267d0ba257b 100644 --- a/gcc/config/i386/i386-expand.cc +++ b/gcc/config/i386/i386-expand.cc @@ -408,11 +408,12 @@ ix86_expand_move (machine_mode mode, rtx operands[]) : UNSPEC_GOT)); op1 = gen_rtx_CONST (Pmode, op1); op1 = gen_const_mem (Pmode, op1); - set_mem_alias_set (op1, ix86_GOT_alias_set ()); + set_mem_alias_set (op1, GOT_ALIAS_SET); } else { - tmp = ix86_legitimize_pe_coff_symbol (op1, addend != NULL_RTX); +#if TARGET_PECOFF + tmp = legitimize_pe_coff_symbol (op1, addend != NULL_RTX); if (tmp) { op1 = tmp; @@ -424,6 +425,7 @@ ix86_expand_move (machine_mode mode, rtx operands[]) op1 = operands[1]; break; } +#endif } if (addend) diff --git a/gcc/config/i386/i386-expand.h b/gcc/config/i386/i386-expand.h index a8c20993954..5e02df1706d 100644 --- a/gcc/config/i386/i386-expand.h +++ b/gcc/config/i386/i386-expand.h @@ -34,9 +34,7 @@ struct expand_vec_perm_d }; rtx legitimize_tls_address (rtx x, enum tls_model model, bool for_mov); -alias_set_type ix86_GOT_alias_set (void); rtx legitimize_pic_address (rtx orig, rtx reg); -rtx ix86_legitimize_pe_coff_symbol (rtx addr, bool inreg); bool insn_defines_reg (unsigned int regno1, unsigned int regno2, rtx_insn *insn); diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc index 66845b30446..ee3a59ed498 100644 --- a/gcc/config/i386/i386.cc +++ b/gcc/config/i386/i386.cc @@ -11807,30 +11807,6 @@ constant_address_p (rtx x) } -#if TARGET_PECOFF -rtx ix86_legitimize_pe_coff_symbol (rtx addr, bool inreg) -{ - return legitimize_pe_coff_symbol (addr, inreg); -} - -alias_set_type -ix86_GOT_alias_set (void) -{ - return mingw_GOT_alias_set (); -} -#else -rtx ix86_legitimize_pe_coff_symbol (rtx addr, bool inreg) -{ - return NULL_RTX; -} - -alias_set_type -ix86_GOT_alias_set (void) -{ - return -1; -} -#endif - /* Return a legitimate reference for ORIG (an address) using the register REG. If REG is 0, a new pseudo is generated. @@ -11867,9 +11843,11 @@ legitimize_pic_address (rtx orig, rtx reg) if (TARGET_64BIT && TARGET_DLLIMPORT_DECL_ATTRIBUTES) { - rtx tmp = ix86_legitimize_pe_coff_symbol (addr, true); +#if TARGET_PECOFF + rtx tmp = legitimize_pe_coff_symbol (addr, true); if (tmp) return tmp; +#endif } if (TARGET_64BIT && legitimate_pic_address_disp_p (addr)) @@ -11912,9 +11890,11 @@ legitimize_pic_address (rtx orig, rtx reg) on VxWorks, see gotoff_operand. */ || (TARGET_VXWORKS_RTP && GET_CODE (addr) == LABEL_REF)) { - rtx tmp = ix86_legitimize_pe_coff_symbol (addr, true); +#if TARGET_PECOFF + rtx tmp = legitimize_pe_coff_symbol (addr, true); if (tmp) return tmp; +#endif /* For x64 PE-COFF there is no GOT table, so we use address directly. */ @@ -11929,7 +11909,7 @@ legitimize_pic_address (rtx orig, rtx reg) UNSPEC_GOTPCREL); new_rtx = gen_rtx_CONST (Pmode, new_rtx); new_rtx = gen_const_mem (Pmode, new_rtx); - set_mem_alias_set (new_rtx, ix86_GOT_alias_set ()); + set_mem_alias_set (new_rtx, GOT_ALIAS_SET); } else { @@ -11951,7 +11931,7 @@ legitimize_pic_address (rtx orig, rtx reg) new_rtx = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new_rtx); new_rtx = gen_const_mem (Pmode, new_rtx); - set_mem_alias_set (new_rtx, ix86_GOT_alias_set ()); + set_mem_alias_set (new_rtx, GOT_ALIAS_SET); } new_rtx = copy_to_suggested_reg (new_rtx, reg, Pmode); @@ -12328,7 +12308,7 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) if (pic) off = gen_rtx_PLUS (tp_mode, pic, off); off = gen_const_mem (tp_mode, off); - set_mem_alias_set (off, ix86_GOT_alias_set ()); + set_mem_alias_set (off, GOT_ALIAS_SET); if (TARGET_64BIT || TARGET_ANY_GNU_TLS) { @@ -12526,9 +12506,11 @@ ix86_legitimize_address (rtx x, rtx, machine_mode mode) if (TARGET_DLLIMPORT_DECL_ATTRIBUTES) { - rtx tmp = ix86_legitimize_pe_coff_symbol (x, true); +#if TARGET_PECOFF + rtx tmp = legitimize_pe_coff_symbol (x, true); if (tmp) return tmp; +#endif } if (flag_pic && SYMBOLIC_CONST (x)) diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 969391d3013..2b3d0c8db75 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -2261,6 +2261,8 @@ extern int const svr4_debugger_register_map[FIRST_PSEUDO_REGISTER]; /* Which processor to tune code generation for. These must be in sync with processor_cost_table in i386-options.cc. */ +#define GOT_ALIAS_SET -1 + enum processor_type { PROCESSOR_GENERIC = 0, diff --git a/gcc/config/mingw/winnt-dll.cc b/gcc/config/mingw/winnt-dll.cc index 591e89cb5c9..c91e95225d3 100644 --- a/gcc/config/mingw/winnt-dll.cc +++ b/gcc/config/mingw/winnt-dll.cc @@ -1,6 +1,6 @@ /* Expand a SYMBOL into its corresponding dllimport, far-address, or refptr symbol. -Copyright (C) 2024 Free Software Foundation, Inc. +Copyright (C) 1988-2024 Free Software Foundation, Inc. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -206,13 +206,9 @@ legitimize_pe_coff_symbol (rtx addr, bool inreg) } } -#if !defined (TARGET_AARCH64_MS_ABI) - - if (ix86_cmodel != CM_LARGE_PIC && ix86_cmodel != CM_MEDIUM_PIC) + if (CMODEL_IS_NOT_LARGE_OR_MEDIUM_PIC) return NULL_RTX; -#endif - if (GET_CODE (addr) == SYMBOL_REF && !is_imported_p (addr) && SYMBOL_REF_EXTERNAL_P (addr) diff --git a/gcc/config/mingw/winnt-dll.h b/gcc/config/mingw/winnt-dll.h index 19c16e747a2..0877f10d67e 100644 --- a/gcc/config/mingw/winnt-dll.h +++ b/gcc/config/mingw/winnt-dll.h @@ -23,4 +23,4 @@ extern bool is_imported_p (rtx x); extern alias_set_type mingw_GOT_alias_set (void); extern rtx legitimize_pe_coff_symbol (rtx addr, bool inreg); -#endif \ No newline at end of file +#endif