From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 63810 invoked by alias); 27 Jun 2017 14:55:23 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 61998 invoked by uid 89); 27 Jun 2017 14:55:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.2 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,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=alright X-HELO: mail-yw0-f178.google.com Received: from mail-yw0-f178.google.com (HELO mail-yw0-f178.google.com) (209.85.161.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 27 Jun 2017 14:55:20 +0000 Received: by mail-yw0-f178.google.com with SMTP id t127so12923260ywc.3 for ; Tue, 27 Jun 2017 07:55:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=gFP4On8bjwnd4QW2GifS44sysNJdvOiHvSvB8wJc8FA=; b=mKGkt5s68HmvwPkpdxeh0oZxURzjNZmxNtghWzN0+s5+YZrGnjJ4LpnUHoVDkUlgDr K+bgP90u8eZLPm4tTs93VweAnnE/0TVKoX90kydO5PIboMa6fI01mIKuQ72F/Jd5FpEi weBk91AZeOTFiX1rwXbUXE0G+7bZsUpMFy41BzRwtsCsIYdFvVsEfIZI/S49vb1GaEO7 crQvYmK9Rr4coZnRESLCKpoMsEgDUuu5mJ25AzYAwgZHuvdKaNmKRUS0x2LlEyKzp5wq AhatpNccD5RV3aPjHDI5py3dT612djB0TUUYMvKXresrpBnXZf9V6Fl4M0p0kgbKTerJ 4XVw== X-Gm-Message-State: AKS2vOyvn3xK4CEvJwjSZFRHgg5+dopWQVRvNzMaZhdPsGWwibv9/OOR lQ1fPoMEC0w9C0L65xGmXr8ogUanwo5i X-Received: by 10.129.101.215 with SMTP id z206mr4130706ywb.333.1498575318295; Tue, 27 Jun 2017 07:55:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.53.8 with HTTP; Tue, 27 Jun 2017 07:55:17 -0700 (PDT) In-Reply-To: References: From: Yvan Roux Date: Tue, 27 Jun 2017 14:55:00 -0000 Message-ID: Subject: Re: [PATCH][AArch64] Fix PR79041 To: Wilco Dijkstra Cc: GCC Patches , James Greenhalgh , nd Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg02041.txt.bz2 Hi On 27 June 2017 at 16:49, Wilco Dijkstra wrote: > 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? I can't approve it, but the patch is ok for me, I've built and regtested the very same patch for aarch64-linux-gnu, aarch64-none-elf and aarch64_be-none-elf targets :) Yvan > 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" } } */