From 4ba8f0a3a4f8493a03b6229433728c49925e179f Mon Sep 17 00:00:00 2001 From: Andrew Pinski Date: Thu, 8 Dec 2016 04:59:00 +0000 Subject: [PATCH] aarch64.c (aarch64_load_symref_appropriately): Access the lower part of RTX appropriately. 2016-12-08 Andrew Pinski gcc * config/aarch64/aarch64.c (aarch64_load_symref_appropriately): Access the lower part of RTX appropriately. gcc/testsuite * gcc.target/aarch64/pr71112.c : New Testcase. From-SVN: r243427 --- gcc/ChangeLog | 5 +++++ gcc/config/aarch64/aarch64.c | 3 ++- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.c-torture/compile/pr71112.c | 10 ++++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr71112.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 929bf4d7ac7..a44ba8bcf8a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-12-08 Andrew Pinski + + * config/aarch64/aarch64.c (aarch64_load_symref_appropriately): + Access the lower part of RTX appropriately. + 2016-12-07 David Malcolm * genpreds.c (write_tm_constrs_h): Update for renaming of diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 128f32bda23..98f76c15b4e 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/ChangeLog b/gcc/testsuite/ChangeLog index 27225c24837..d4fb081254d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2016-12-08 Andrew Pinski + + * gcc.target/aarch64/pr71112.c : New Testcase. + 2016-12-07 Martin Sebor PR middle-end/77784 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 00000000000..69e2df6f0e2 --- /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; +} -- 2.30.2