From patchwork Fri Jul 14 14:22:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 788554 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 3x8FJz5fXrz9s72 for ; Sat, 15 Jul 2017 00:22:59 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="mTRo/lRs"; 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:references:in-reply-to :content-type:content-transfer-encoding:mime-version; q=dns; s= default; b=Vip3e1tdTJ4Rp073mQT9ifviadMbjn5M17VC0qkDlBbGYI4KoGT1k HOVE9ZoCcPIC3d3ZNUnog8SIDibw8QusB/lK2T7NtrYAOj4/Wf+x6E+KDWDu4vwq ouuJWA5DFPEQmkk+PITdUKPDmaR2Hd8l/FjJ+Ygu5fPbyja6HyoSHY= 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:references:in-reply-to :content-type:content-transfer-encoding:mime-version; s=default; bh=Bq9MNqPL6/MhnefVohgFLz4sXw8=; b=mTRo/lRsTOhcnEJWIZXCL62lkwJ7 ZrWLRbkrw01Wr8J76SOzNacxeZTn+MoqPiDXjl5/yNisK665nfTpKNFSIgsHlhIE VC/psEV6VqPd9YLeE/g5d68uAiNjr2ViYeg0ldUIGlH8W6IAG3nDh2B5nom/Eufx vcAllqPZiZAhpjQ= Received: (qmail 19509 invoked by alias); 14 Jul 2017 14:22:48 -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 19499 invoked by uid 89); 14 Jul 2017 14:22:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1653 X-HELO: EUR03-AM5-obe.outbound.protection.outlook.com Received: from mail-eopbgr30054.outbound.protection.outlook.com (HELO EUR03-AM5-obe.outbound.protection.outlook.com) (40.107.3.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Jul 2017 14:22:45 +0000 Received: from AM5PR0802MB2610.eurprd08.prod.outlook.com (10.175.46.18) by DB6PR08MB2662.eurprd08.prod.outlook.com (10.175.234.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.13; Fri, 14 Jul 2017 14:22:42 +0000 Received: from AM5PR0802MB2610.eurprd08.prod.outlook.com ([fe80::b567:13a:e52:92de]) by AM5PR0802MB2610.eurprd08.prod.outlook.com ([fe80::b567:13a:e52:92de%17]) with mapi id 15.01.1261.018; Fri, 14 Jul 2017 14:22:42 +0000 From: Wilco Dijkstra To: GCC Patches , James Greenhalgh CC: nd , Yvan Roux Subject: Re: [PATCH][AArch64] Fix PR79041 Date: Fri, 14 Jul 2017 14:22:42 +0000 Message-ID: References: In-Reply-To: authentication-results: arm.com; dkim=none (message not signed) header.d=none; arm.com; dmarc=none action=none header.from=arm.com; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6PR08MB2662; 7:WVEi1kO/kbAS8EQKyR+QnOjHBEX8hIOJlsYgN3Btwj7RjmJhAP88CGFhLT6Apzvt29/czlo/K9UGsVQQPgCemgVy2ov/7oJXOk1Iac83W3bpKfJsqjZNvNp45HEAOBAcCrEcRwn8t9aoup4bc9DGJlcFDi/IuQ/xavY4Xuqmr7qwMryAj6+53Qj6tKU7jHhNlhs1o6ptv3ZlIggV1y+rf2BFxFuq5+9NRkXFRj0226yl2EVvMmNMCWvwslfpdh35UQyVytDl0ftyI6rZIH/k72TPm/SXh05LbWs5KQUaSEn08PCrILs45Jiajyw9M3W7ck/4/avSz+xDgPwVnzKpyEnCeP6k+KyVdrJlo98v0CwaSuyHWUhWhP/YP7zdW0qn7+KimAkueiP+bKZ08gQDqT8LqyEUPDr4yRmGnose0bNJ/yr589SKKdpQ+6HknnviRqcpkJ5Pvxw8V0FIKJ86SpB0xufrVVnGe+K+MkF6IssjpgwwpMVbZ/S/LjS43hpwjpppBKJAJG6s17KSLvG4fjugWon2MBg+taJL7nAOzWhciGggqKt+gQCe2K5tnIQs2ljuA4DovgdzyrJPTI1cNRafBA3eFze4mTwa87VKZzVJO1is1yFXvd2FiJh8+MHxNrWkuksXJrK4hjU6pLjBRIJQLpGfYChpsOhcL++Srykt6QzS5LGHnQtOy7++qsf9SIVyXf0kQH/grwnIfVGkYx9b0NkeATFRNiJA6wZdmB3QoYdDjFD19OeaGARmEeHJkvwyCigJbl7wLzVVe3/wj7V1gEjVWlfHZA7sbMYmkqk= x-ms-office365-filtering-correlation-id: 8dacad9d-94ca-4f26-f3d1-08d4cac3ca2a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(300000503095)(300135400095)(48565401081)(2017052603031)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DB6PR08MB2662; x-ms-traffictypediagnostic: DB6PR08MB2662: nodisclaimer: True x-exchange-antispam-report-test: UriScan:(180628864354917)(236129657087228)(148574349560750); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(2017060910075)(5005006)(8121501046)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123560025)(20161123555025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB6PR08MB2662; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB6PR08MB2662; x-forefront-prvs: 0368E78B5B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39850400002)(39410400002)(39400400002)(39840400002)(39860400002)(39450400003)(377424004)(25786009)(6506006)(7736002)(5250100002)(3660700001)(7696004)(2900100001)(53936002)(5660300001)(229853002)(8676002)(72206003)(2950100002)(54356999)(2906002)(50986999)(6436002)(6636002)(55016002)(102836003)(76176999)(6116002)(4326008)(81166006)(99286003)(8936002)(74316002)(9686003)(54906002)(3280700002)(33656002)(3846002)(14454004)(6246003)(575784001)(38730400002)(305945005)(66066001)(86362001)(189998001)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR08MB2662; H:AM5PR0802MB2610.eurprd08.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jul 2017 14:22:42.4703 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR08MB2662 ping   As described in PR79041, -mcmodel=large -mpc-relative-literal-loads may be used to avoid generating ADRP/ADD or ADRP/LDR.  However both trunk and GCC7 may still emit ADRP for some constant pool literals. Fix this by adding a aarch64_pcrelative_literal_loads check. OK for trunk/GCC7 backport? ChangeLog: 2017-06-27  Wilco Dijkstra          PR target/79041         * config/aarch64/aarch64.c (aarch64_classify_symbol):         Avoid SYMBOL_SMALL_ABSOLUTE .         * testsuite/gcc.target/aarch64/pr79041-2.c: New test. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 060cd8476d2954119daac495ecb059c9be73edbe..329d244e9cf16dbdf849e5dd02b3999caf0cd5a7 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -10042,7 +10042,7 @@ aarch64_classify_symbol (rtx x, rtx offset)            /* This is alright even in PIC code as the constant               pool reference is always PC relative and within               the same translation unit.  */ -         if (CONSTANT_POOL_ADDRESS_P (x)) +         if (CONSTANT_POOL_ADDRESS_P (x) && !aarch64_pcrelative_literal_loads)              return SYMBOL_SMALL_ABSOLUTE;            else              return SYMBOL_FORCE_TO_MEM; diff --git a/gcc/testsuite/gcc.target/aarch64/pr79041-2.c b/gcc/testsuite/gcc.target/aarch64/pr79041-2.c new file mode 100644 index 0000000000000000000000000000000000000000..e7899725bad2b770f8488a07f99792113275bdf2 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr79041-2.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mcmodel=large -mpc-relative-literal-loads" } */ + +__int128 +t (void) +{ +  return (__int128)1 << 80; +} + +/* { dg-final { scan-assembler "adr" } } */