This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] [AArch64] Fix PR71112
- From: James Greenhalgh <james dot greenhalgh at arm dot com>
- To: "Hurugalawadi, Naveen" <Naveen dot Hurugalawadi at cavium dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>, Marcus Shawcroft <marcus dot shawcroft at arm dot com>, "Pinski, Andrew" <Andrew dot Pinski at cavium dot com>, "nd at arm dot com" <nd at arm dot com>, Kyrill Tkachov <kyrylo dot tkachov at foss dot arm dot com>
- Date: Wed, 7 Dec 2016 11:07:31 +0000
- Subject: Re: [PATCH] [AArch64] Fix PR71112
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=pass (sender IP is 217.140.96.140) smtp.mailfrom=arm.com; cavium.com; dkim=none (message not signed) header.d=none;cavium.com; dmarc=bestguesspass action=none header.from=arm.com;cavium.com; dkim=none (message not signed) header.d=none;
- Nodisclaimer: True
- References: <CO2PR07MB269488C6223A95A66CCCBC2B83B70@CO2PR07MB2694.namprd07.prod.outlook.com> <20161206123126.GA37335@arm.com> <CO2PR07MB2694B30CA45CFC8572630A2D83850@CO2PR07MB2694.namprd07.prod.outlook.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On Wed, Dec 07, 2016 at 07:25:21AM +0000, Hurugalawadi, Naveen wrote:
> Hi James,
>
> Thanks for the review and suggestions regarding the testcase.
>
> >> Why limit the ABI and endianness here, and if you do plan to do that
>
> Extra options have been dropped and the testcase will check across
> all variants and endianness.
>
> Please find attached the modified patch as per the comments and let
> me know if its okay?
OK with an appropriate ChangeLog entry.
Thanks,
James
> diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
> index dab46b5..9fce849 100644
> --- a/gcc/config/aarch64/aarch64.c
> +++ b/gcc/config/aarch64/aarch64.c
> @@ -1302,7 +1302,8 @@ aarch64_load_symref_appropriately (rtx dest, rtx imm,
> emit_move_insn (gp_rtx, gen_rtx_HIGH (Pmode, s));
>
> if (mode != GET_MODE (gp_rtx))
> - gp_rtx = simplify_gen_subreg (mode, gp_rtx, GET_MODE (gp_rtx), 0);
> + gp_rtx = gen_lowpart (mode, gp_rtx);
> +
> }
>
> if (mode == ptr_mode)
> diff --git a/gcc/testsuite/gcc.c-torture/compile/pr71112.c b/gcc/testsuite/gcc.c-torture/compile/pr71112.c
> new file mode 100644
> index 0000000..69e2df6
> --- /dev/null
> +++ b/gcc/testsuite/gcc.c-torture/compile/pr71112.c
> @@ -0,0 +1,10 @@
> +/* PR target/71112. */
> +/* { dg-additional-options "-fpie" { target pie } } */
> +
> +extern int dbs[100];
> +void f (int *);
> +int nscd_init (void)
> +{
> + f (dbs);
> + return 0;
> +}