From d8fe28be762164639c98506f9348f082e5f4b880 Mon Sep 17 00:00:00 2001 From: Pat Haugen Date: Fri, 17 Mar 2017 16:42:29 +0000 Subject: [PATCH] re PR target/79951 (ICE in extract_insn, at recog.c:2311 on ppc64le with -mno-cmpb) PR target/79951 * config/rs6000/rs6000.md (copysign3_fcpsgn): Test for VECTOR_UNIT_VSX_P (mode) too. * gcc.target/powerpc/pr79951.c: New. From-SVN: r246228 --- gcc/ChangeLog | 6 ++++++ gcc/config/rs6000/rs6000.md | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/powerpc/pr79951.c | 10 ++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/powerpc/pr79951.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index eb0e150d051..2ea7fe8d61a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-03-17 Pat Haugen + + PR target/79951 + * config/rs6000/rs6000.md (copysign3_fcpsgn): Test + for VECTOR_UNIT_VSX_P (mode) too. + 2017-03-17 Bernd Schmidt * reload.c (find_reloads): When reloading a nonoffsettable address, diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 000d84033c3..164fc2c33c6 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -4831,7 +4831,7 @@ (unspec:SFDF [(match_operand:SFDF 1 "gpc_reg_operand" ",") (match_operand:SFDF 2 "gpc_reg_operand" ",")] UNSPEC_COPYSIGN))] - "TARGET__FPR && TARGET_CMPB" + "TARGET__FPR && (TARGET_CMPB || VECTOR_UNIT_VSX_P (mode))" "@ fcpsgn %0,%2,%1 xscpsgndp %x0,%x2,%x1" diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4162ca23eed..7178b8e4f51 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-03-17 Pat Haugen + + PR target/79951 + * gcc.target/powerpc/pr79951.c: New. + 2017-03-17 Bernd Schmidt PR rtl-optimization/79910 diff --git a/gcc/testsuite/gcc.target/powerpc/pr79951.c b/gcc/testsuite/gcc.target/powerpc/pr79951.c new file mode 100644 index 00000000000..67837444b20 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr79951.c @@ -0,0 +1,10 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ +/* { dg-options "-mcpu=power8 -S -mno-cmpb" } */ + +float testf (float x, float y) +{ + return __builtin_copysignf (x, y); +} + -- 2.30.2