From: Segher Boessenkool Date: Tue, 28 Jun 2016 05:56:41 +0000 (+0200) Subject: rs6000: Fix split of ashdi3_extswsli_dot for memory (PR71670) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a826405801ce4e28d534e3f693f236405d886caf;p=gcc.git rs6000: Fix split of ashdi3_extswsli_dot for memory (PR71670) 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4c91c5f8522..6870078636e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-06-27 Segher Boessenkool + + 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 * config/rs6000/rs6000.md ('type' attribute): Add diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index bb31e41e256..e8a6205df3a 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -4094,7 +4094,7 @@ 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; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7e7cf8b7e67..866cef796f3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-06-27 Segher Boessenkool + + PR target/71670 + * gcc.target/powerpc/pr71670.c: New testcase. + 2016-06-27 Peter Bergner 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 index 00000000000..18fb62759d9 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr71670.c @@ -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; }