re PR target/79179 (PowerPC64: -mcpu=power9 creates stxsd with bad offset)
authorMichael Meissner <meissner@linux.vnet.ibm.com>
Thu, 26 Jan 2017 04:16:11 +0000 (04:16 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Thu, 26 Jan 2017 04:16:11 +0000 (04:16 +0000)
[gcc]
2017-01-25  Michael Meissner  <meissner@linux.vnet.ibm.com>

PR target/79179
* config/rs6000/vsx.md (vsx_extract_<mode>_store): Use wY
constraint instead of o for the stxsd instruction.

[gcc/testsuite]
2017-01-25  Michael Meissner  <meissner@linux.vnet.ibm.com>

PR target/79179
* gcc.target/powerpc/pr79179.c: New test.

From-SVN: r244917

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

index 4712d7c40d93fb09a813e2c4a14c7b5c63da9421..a068478407a3dcded72e1d5263c68459f07306e4 100644 (file)
@@ -1,3 +1,9 @@
+2017-01-25  Michael Meissner  <meissner@linux.vnet.ibm.com>
+
+       PR target/79179
+       * config/rs6000/vsx.md (vsx_extract_<mode>_store): Use wY
+       constraint instead of o for the stxsd instruction.
+
 2017-01-25  Carl Love  <cel@us.ibm.com>
 
        * config/rs6000/rs6000-c (altivec_overloaded_builtins): Fix order
index 28bbeb2a7d97d193db1b037fbe3ae20df73e29cf..b10ade40db6288fbc9249001b5982caedc211807 100644 (file)
 ;; Optimize storing a single scalar element that is the right location to
 ;; memory
 (define_insn "*vsx_extract_<mode>_store"
-  [(set (match_operand:<VS_scalar> 0 "memory_operand" "=m,Z,o")
+  [(set (match_operand:<VS_scalar> 0 "memory_operand" "=m,Z,wY")
        (vec_select:<VS_scalar>
         (match_operand:VSX_D 1 "register_operand" "d,wv,wb")
         (parallel [(match_operand:QI 2 "vsx_scalar_64bit" "wD,wD,wD")])))]
index 99bec45d5a758ae8c92eb8be8494e3b9cd67faa2..1cce52129873a1e893988dc01a5c51b2dc45ad60 100644 (file)
@@ -1,3 +1,8 @@
+2017-01-25  Michael Meissner  <meissner@linux.vnet.ibm.com>
+
+       PR target/79179
+       * gcc.target/powerpc/pr79179.c: New test.
+
 2017-01-25  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
        * gcc.target/powerpc/vsx-elemrev-4.c: Change expected code
diff --git a/gcc/testsuite/gcc.target/powerpc/pr79179.c b/gcc/testsuite/gcc.target/powerpc/pr79179.c
new file mode 100644 (file)
index 0000000..0815a2e
--- /dev/null
@@ -0,0 +1,23 @@
+/* { dg-do assemble { target { powerpc*-*-* && lp64 } } } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
+/* { dg-require-effective-target powerpc_p9vector_ok } */
+/* { dg-options "-mcpu=power9 -O3" } */
+
+/* Compile with -O3 -mcpu=power9.  It originally generated
+
+        stxsd 12,1(9)
+
+   which is illegal.  */
+
+#pragma pack(1)
+struct {
+        signed : 1;
+        unsigned long a;
+} b;
+
+void c(void)
+{
+        b.a = 0;
+        for (; b.a <= 45; b.a = (long)b.a + 1)
+                ;
+}