From: Jakub Jelinek Date: Fri, 3 Feb 2017 17:34:56 +0000 (+0100) Subject: re PR target/79354 (-mcpu=power8 -O2 generates power9 instruction on powerpc64le... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=437f0a81bdd733c66a0ed6172ccd2ac6a0e623d4;p=gcc.git re PR target/79354 (-mcpu=power8 -O2 generates power9 instruction on powerpc64le-linux) PR target/79354 * config/rs6000/rs6000.md (movsi_from_sf): Use wb constraint instead of wu for stxssp alternative. * gcc.target/powerpc/pr79354.c: New test. * gcc.c-torture/execute/pr79354.c: New test. From-SVN: r245157 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a8203a43b42..a1db12741e6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-02-03 Jakub Jelinek + + PR target/79354 + * config/rs6000/rs6000.md (movsi_from_sf): Use wb constraint instead of + wu for stxssp alternative. + 2017-02-03 Martin Sebor PR tree-optimization/79352 diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index bb0927ffb2f..fca6de04b4c 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -6814,7 +6814,7 @@ (unspec:SI [(match_operand:SF 1 "input_operand" "r, m, Z, Z, r, - f, wu, wu, wIwH, r, + f, wb, wu, wIwH, r, wK")] UNSPEC_SI_FROM_SF)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ff8ce70fed2..0595ff6df6f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2017-02-03 Jakub Jelinek + + PR target/79354 + * gcc.target/powerpc/pr79354.c: New test. + * gcc.c-torture/execute/pr79354.c: New test. + 2017-02-03 Martin Sebor PR tree-optimization/79352 diff --git a/gcc/testsuite/gcc.c-torture/execute/pr79354.c b/gcc/testsuite/gcc.c-torture/execute/pr79354.c new file mode 100644 index 00000000000..c196155e741 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr79354.c @@ -0,0 +1,30 @@ +/* PR target/79354 */ + +int b, f, g; +float e; +unsigned long d; + +__attribute__((noinline, noclone)) void +foo (int *a) +{ + for (g = 0; g < 32; g++) + if (f) + { + e = d; + __builtin_memcpy (&b, &e, sizeof (float)); + b = *a; + } +} + +int +main () +{ + int h = 5; + f = 1; + asm volatile ("" : : : "memory"); + foo (&h); + asm volatile ("" : : : "memory"); + foo (&b); + asm volatile ("" : : : "memory"); + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/pr79354.c b/gcc/testsuite/gcc.target/powerpc/pr79354.c new file mode 100644 index 00000000000..0806df02bfe --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr79354.c @@ -0,0 +1,22 @@ +/* PR target/79354 */ +/* { dg-do compile } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-mcpu=power8 -O2" } */ +/* { dg-final { scan-assembler-not {\mstxssp\M} } } */ + +int b, f, g; +float e; +unsigned long d; + +void +foo (int *a) +{ + for (g = 0; g < 32; g++) + if (f) + { + e = d; + __builtin_memcpy (&b, &e, sizeof (float)); + b = *a; + } +}