rs6000: Fix split of ashdi3_extswsli_dot for memory (PR71670)
authorSegher Boessenkool <segher@kernel.crashing.org>
Tue, 28 Jun 2016 05:56:41 +0000 (07:56 +0200)
committerSegher Boessenkool <segher@gcc.gnu.org>
Tue, 28 Jun 2016 05:56:41 +0000 (07:56 +0200)
The splitter for ashdi3_extswsli_dot for cr0 with memory uses emit_insn
gen_ashdi3_extswsli_dot, which does not work because that emits a scratch,
while the splitter runs after reload so there should be a real register
instead.  We can laboriously fix that up, or emit using
gen_ashdi3_extswsli_dot2 instead.  This patch does the latter.

PR target/71670
* config/rs6000/rs6000.md (ashdi3_extswsli_dot): Use
gen_ashdi3_extswsli_dot2 instead of gen_ashdi3_extswsli_dot.

gcc/testsuite/
PR target/71670
* gcc.target/powerpc/pr71670.c: New testcase.

From-SVN: r237813

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

index 4c91c5f85222d4b779452d845927a7de06a345e0..6870078636ed8202a59a536984d8098185991503 100644 (file)
@@ -1,3 +1,9 @@
+2016-06-27  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       PR target/71670
+       * config/rs6000/rs6000.md (ashdi3_extswsli_dot): Use
+       gen_ashdi3_extswsli_dot2 instead of gen_ashdi3_extswsli_dot.
+
 2016-06-27  Pat Haugen  <pthaugen@us.ibm.com>
 
        * config/rs6000/rs6000.md ('type' attribute): Add
index bb31e41e2568afa2dbb2a2484b4434255f61ea8c..e8a6205df3afb024449ce7e9d8d51eaf263b7f33 100644 (file)
 
   if (REGNO (cr) == CR0_REGNO)
     {
-      emit_insn (gen_ashdi3_extswsli_dot (dest, src2, shift, cr));
+      emit_insn (gen_ashdi3_extswsli_dot2 (dest, src2, shift, cr));
       DONE;
     }
 
index 7e7cf8b7e673921296c063bf489d78cd243757cf..866cef796f3ae0a250af37677173462ad4e30277 100644 (file)
@@ -1,3 +1,8 @@
+2016-06-27  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       PR target/71670
+       * gcc.target/powerpc/pr71670.c: New testcase.
+
 2016-06-27  Peter Bergner  <bergner@vnet.ibm.com>
 
        PR target/71656
diff --git a/gcc/testsuite/gcc.target/powerpc/pr71670.c b/gcc/testsuite/gcc.target/powerpc/pr71670.c
new file mode 100644 (file)
index 0000000..18fb627
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
+/* { dg-options "-mcpu=power9 -O1" } */
+
+volatile int a;
+int b;
+void fn1(void) { b + (long)b || a; }