re PR target/79907 (ICE in extract_constrain_insn, at recog.c:2213 on ppc64le)
authorPat Haugen <pthaugen@us.ibm.com>
Fri, 10 Mar 2017 14:32:42 +0000 (14:32 +0000)
committerPat Haugen <pthaugen@gcc.gnu.org>
Fri, 10 Mar 2017 14:32:42 +0000 (14:32 +0000)
PR target/79907
* config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Test
TARGET_UPPER_REGS_DI when setting 'wi' constraint regclass.
* gcc.target/powerpc/pr79907.c: New.

From-SVN: r246029

gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/pr79907.c [new file with mode: 0644]

index 306b5f140b6153ee3c6872da26d5e710fc2fdab9..34c6f2914219d27cda352156a3b0ecdce19001bd 100644 (file)
@@ -1,3 +1,9 @@
+2017-03-10  Pat Haugen  <pthaugen@us.ibm.com>
+
+       PR target/79907
+       * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Test
+       TARGET_UPPER_REGS_DI when setting 'wi' constraint regclass.
+
 2017-03-10  Martin Liska  <mliska@suse.cz>
 
         PR target/65705
index e528bdf8973b4f3d6c40fba076afff7bfaec2e69..c6ba091baed9c1d87f34df7d5fca9b0aa937f23c 100644 (file)
@@ -3182,7 +3182,7 @@ rs6000_init_hard_regno_mode_ok (bool global_init_p)
       else
        rs6000_constraints[RS6000_CONSTRAINT_ws] = FLOAT_REGS;
 
-      if (TARGET_UPPER_REGS_DF)                                        /* DImode  */
+      if (TARGET_UPPER_REGS_DI)                                        /* DImode  */
        rs6000_constraints[RS6000_CONSTRAINT_wi] = VSX_REGS;
       else
        rs6000_constraints[RS6000_CONSTRAINT_wi] = FLOAT_REGS;
index b17299b9400a26e8c0be9f792a5a9183cf0a7ba5..ef5609cd76942e3c9180b0565e6ed8136b93a2b5 100644 (file)
@@ -1,3 +1,8 @@
+2017-03-10  Pat Haugen  <pthaugen@us.ibm.com>
+
+       PR target/79907
+       * gcc.target/powerpc/pr79907.c: New.
+
 2017-03-10  Olivier Hainque  <hainque@adacore.com>
 
        * gnat.dg/opt64.adb: New test.
diff --git a/gcc/testsuite/gcc.target/powerpc/pr79907.c b/gcc/testsuite/gcc.target/powerpc/pr79907.c
new file mode 100644 (file)
index 0000000..c0e669b
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
+/* { dg-options "-mcpu=power8 -O3 -mno-upper-regs-df" } */
+
+int foo (short a[], int x)
+{
+  unsigned int i;
+  for (i = 0; i < 1000; i++)
+    {
+      x = a[i];
+      a[i] = (x <= 0 ? 0 : x);
+    }
+  return x;
+}