aarch64.c (aarch64_load_symref_appropriately): Access the lower part of RTX appropria...
authorAndrew Pinski <apinski@cavium.com>
Thu, 8 Dec 2016 04:59:00 +0000 (04:59 +0000)
committerNaveen H.S <naveenh@gcc.gnu.org>
Thu, 8 Dec 2016 04:59:00 +0000 (04:59 +0000)
2016-12-08  Andrew Pinski  <apinski@cavium.com>

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
gcc/config/aarch64/aarch64.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr71112.c [new file with mode: 0644]

index 929bf4d7ac741bd6fad84305f3e11d07452e9fdd..a44ba8bcf8aeb41a233fc6487cb643ba144a83bc 100644 (file)
@@ -1,3 +1,8 @@
+2016-12-08  Andrew Pinski  <apinski@cavium.com>
+
+       * config/aarch64/aarch64.c (aarch64_load_symref_appropriately):
+       Access the lower part of RTX appropriately.
+
 2016-12-07  David Malcolm  <dmalcolm@redhat.com>
 
        * genpreds.c (write_tm_constrs_h): Update for renaming of
index 128f32bda238488d8ccac9d105802d9be69c48db..98f76c15b4ef398d1d164c3e72f3967adb698838 100644 (file)
@@ -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)
index 27225c2483759b37d120b305fd1e0a97ae32c991..d4fb081254d3d0d98386de35c07f1b97b1c04684 100644 (file)
@@ -1,3 +1,7 @@
+2016-12-08  Andrew Pinski  <apinski@cavium.com>
+
+       * gcc.target/aarch64/pr71112.c : New Testcase.
+
 2016-12-07  Martin Sebor  <msebor@redhat.com>
 
        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 (file)
index 0000000..69e2df6
--- /dev/null
@@ -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;
+}