re PR target/84264 (ICE in rs6000_emit_le_vsx_store, at config/rs6000/rs6000.c:10367...
authorPeter Bergner <bergner@vnet.ibm.com>
Mon, 5 Mar 2018 15:52:11 +0000 (09:52 -0600)
committerPeter Bergner <bergner@gcc.gnu.org>
Mon, 5 Mar 2018 15:52:11 +0000 (09:52 -0600)
gcc/
PR target/84264
* config/rs6000/vector.md (mov<mode>): Disallow altivec memory operands.

gcc/testsuite/
PR target/84264
* g++.dg/pr84264.C: New test.

From-SVN: r258251

gcc/ChangeLog
gcc/config/rs6000/vector.md
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/pr84264.C [new file with mode: 0644]

index c52325615ba9c30817c5ac2b40866e2d73754da5..723e718baa1b176c373420083a421c22cffd769f 100644 (file)
@@ -1,3 +1,8 @@
+2018-03-05  Peter Bergner  <bergner@vnet.ibm.com>
+
+       PR target/84264
+       * config/rs6000/vector.md (mov<mode>): Disallow altivec memory operands.
+
 2018-03-05  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/84486
index 6e2576ee1d8477a744913878c2188e27d38536ff..d27079bf129111d364099d312dd5bed95df99133 100644 (file)
          && !vlogical_operand (operands[1], <MODE>mode))
        operands[1] = force_reg (<MODE>mode, operands[1]);
     }
+  /* When generating load/store instructions to/from VSX registers on
+     pre-power9 hardware in little endian mode, we need to emit register
+     permute instructions to byte swap the contents, since the VSX load/store
+     instructions do not include a byte swap as part of their operation.
+     Altivec loads and stores have no such problem, so we skip them below.  */
   if (!BYTES_BIG_ENDIAN
       && VECTOR_MEM_VSX_P (<MODE>mode)
       && !TARGET_P9_VECTOR
       && !gpr_or_gpr_p (operands[0], operands[1])
-      && (memory_operand (operands[0], <MODE>mode)
-          ^ memory_operand (operands[1], <MODE>mode)))
+      && ((memory_operand (operands[0], <MODE>mode)
+          && !altivec_indexed_or_indirect_operand(operands[0], <MODE>mode))
+         ^ (memory_operand (operands[1], <MODE>mode)
+            && !altivec_indexed_or_indirect_operand(operands[1], <MODE>mode))))
     {
       rs6000_emit_le_vsx_move (operands[0], operands[1], <MODE>mode);
       DONE;
index 44543c31f0f38fe40c67b630debdac8ef2b95f78..70bce764b06f816cdec5e2f0d79df7f07885ca9c 100644 (file)
@@ -1,3 +1,8 @@
+2018-03-05  Peter Bergner  <bergner@vnet.ibm.com>
+
+       PR target/84264
+       * g++.dg/pr84264.C: New test.
+
 2018-03-05  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/84618
diff --git a/gcc/testsuite/g++.dg/pr84264.C b/gcc/testsuite/g++.dg/pr84264.C
new file mode 100644 (file)
index 0000000..4f8a77d
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-options "-w -O1 -fstack-protector-strong" } */
+
+void _setjmp ();
+void a (unsigned long *);
+void
+b (void)
+{
+  for (;;)
+    {
+      _setjmp ();
+      unsigned long args[9]{};
+      a (args);
+    }
+}