From 76ca5f401d53091221b634f4e9774bc03dc8ffbe Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Wed, 15 Mar 2017 00:25:10 +0000 Subject: [PATCH] re PR target/79947 (ICE in rs6000_emit_swsqrt at gcc/config/rs6000/rs6000.c:37570) [gcc] 2017-03-14 Michael Meissner PR target/79947 * config/rs6000/rs6000.h (TARGET_FRSQRTES): Add check for -mpowerpc-gfxopt. [gcc/testsuite] 2017-03-14 Michael Meissner PR target/79947 * gcc.target/powerpc/pr79947.c: New test. From-SVN: r246150 --- gcc/ChangeLog | 6 ++++++ gcc/config/rs6000/rs6000.h | 3 ++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/powerpc/pr79947.c | 12 ++++++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/powerpc/pr79947.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 63597cd4c6b..77e6f8c0b68 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-03-14 Michael Meissner + + PR target/79947 + * config/rs6000/rs6000.h (TARGET_FRSQRTES): Add check for + -mpowerpc-gfxopt. + 2017-03-14 Martin Sebor PR middle-end/80020 diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 0180e0c3dfd..da6fd522f9d 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -752,7 +752,8 @@ extern int rs6000_vector_align[]; && (TARGET_POPCNTB || VECTOR_UNIT_VSX_P (DFmode))) #define TARGET_FRSQRTES (TARGET_HARD_FLOAT && TARGET_POPCNTB \ - && TARGET_FPRS && TARGET_SINGLE_FLOAT) + && TARGET_PPC_GFXOPT && TARGET_FPRS \ + && TARGET_SINGLE_FLOAT) #define TARGET_FRSQRTE (TARGET_HARD_FLOAT && TARGET_FPRS \ && TARGET_DOUBLE_FLOAT \ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 63daa280f66..f1ba337149b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-03-14 Michael Meissner + + PR target/79947 + * gcc.target/powerpc/pr79947.c: New test. + 2017-03-14 Martin Sebor PR middle-end/80020 diff --git a/gcc/testsuite/gcc.target/powerpc/pr79947.c b/gcc/testsuite/gcc.target/powerpc/pr79947.c new file mode 100644 index 00000000000..970e8c0ca89 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr79947.c @@ -0,0 +1,12 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-options "-Ofast -mno-powerpc-gfxopt -mcmpb -mno-vsx" } */ + +/* PR 79949: Compiler segmentation fault due to not having conditional move + support for the target if the -mno-powerpc-gfxopt option is used. */ + +float a, b; +void +c () +{ + a = __builtin_sqrtf (b); +} -- 2.30.2