public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Yvan Roux <yvan.roux@linaro.org>
To: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	James Greenhalgh <James.Greenhalgh@arm.com>, nd <nd@arm.com>
Subject: Re: [PATCH][AArch64] Fix PR79041
Date: Tue, 27 Jun 2017 14:55:00 -0000	[thread overview]
Message-ID: <CAD57uCci8JczEKP+7o8Yn=dYgrE1KQJk7EBp_1dredz1ir53PQ@mail.gmail.com> (raw)
In-Reply-To: <AM5PR0802MB26103FED048608341E3B2BA183DC0@AM5PR0802MB2610.eurprd08.prod.outlook.com>

Hi

On 27 June 2017 at 16:49, Wilco Dijkstra <Wilco.Dijkstra@arm.com> 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  <wdijkstr@arm.com>
>
>         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" } } */

  reply	other threads:[~2017-06-27 14:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-27 14:49 Wilco Dijkstra
2017-06-27 14:55 ` Yvan Roux [this message]
2017-06-27 15:04   ` Yvan Roux
2017-07-14 14:22 ` Wilco Dijkstra
2017-07-21 11:22   ` Wilco Dijkstra
2017-07-24 17:06     ` James Greenhalgh
2017-07-25 12:13       ` [COMMITED][AArch64] " Wilco Dijkstra
2017-07-25 12:52         ` Ramana Radhakrishnan
2017-07-25 13:14           ` Wilco Dijkstra
2017-07-25 14:15         ` Andreas Schwab
2017-07-26 12:03           ` Wilco Dijkstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAD57uCci8JczEKP+7o8Yn=dYgrE1KQJk7EBp_1dredz1ir53PQ@mail.gmail.com' \
    --to=yvan.roux@linaro.org \
    --cc=James.Greenhalgh@arm.com \
    --cc=Wilco.Dijkstra@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nd@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).