From e1122ddda6332ca3a430b3944053ad8ecf11fb20 Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Fri, 8 Feb 2013 19:36:04 +0000 Subject: [PATCH] re PR target/56043 (ICE in rs6000_builtin_vectorized_libmass for vsx-mass-1.c) [gcc] 2013-02-07 Michael Meissner PR target/56043 * config/rs6000/rs6000.c (rs6000_builtin_vectorized_libmass): If there is no implicit builtin declaration, just return NULL. [gcc/testsuite] 2013-02-07 Michael Meissner PR target/56043 * gcc.target/powerpc/vsx-mass-1.c: Only run this test on powerpc*-*-linux*. From-SVN: r195898 --- gcc/ChangeLog | 6 ++++++ gcc/config/rs6000/rs6000.c | 9 +++++++-- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gcc.target/powerpc/vsx-mass-1.c | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8fa5912..9d66888 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-02-08 Michael Meissner + + PR target/56043 + * config/rs6000/rs6000.c (rs6000_builtin_vectorized_libmass): + If there is no implicit builtin declaration, just return NULL. + 2013-02-08 Uros Bizjak * config/i386/sse.md (FMAMODEM): New mode iterator. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 8b5f030..fbf57be 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -3699,7 +3699,8 @@ rs6000_builtin_vectorized_libmass (tree fndecl, tree type_out, tree type_in) bdecl = builtin_decl_implicit (fn); suffix = "d2"; /* pow -> powd2 */ if (el_mode != DFmode - || n != 2) + || n != 2 + || !bdecl) return NULL_TREE; break; @@ -3736,7 +3737,8 @@ rs6000_builtin_vectorized_libmass (tree fndecl, tree type_out, tree type_in) bdecl = builtin_decl_implicit (fn); suffix = "4"; /* powf -> powf4 */ if (el_mode != SFmode - || n != 4) + || n != 4 + || !bdecl) return NULL_TREE; break; @@ -3749,6 +3751,9 @@ rs6000_builtin_vectorized_libmass (tree fndecl, tree type_out, tree type_in) gcc_assert (suffix != NULL); bname = IDENTIFIER_POINTER (DECL_NAME (bdecl)); + if (!bname) + return NULL_TREE; + strcpy (name, bname + sizeof ("__builtin_") - 1); strcat (name, suffix); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index be17827..583e7d5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2013-02-08 Michael Meissner + + PR target/56043 + * gcc.target/powerpc/vsx-mass-1.c: Only run this test on + powerpc*-*-linux*. + 2013-02-08 Edgar E. Iglesias * 20101011-1.c: Add __MICROBLAZE__ exception to set DO_TEST 0 diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-mass-1.c b/gcc/testsuite/gcc.target/powerpc/vsx-mass-1.c index e4a82f6..adb5c9f 100644 --- a/gcc/testsuite/gcc.target/powerpc/vsx-mass-1.c +++ b/gcc/testsuite/gcc.target/powerpc/vsx-mass-1.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-do compile { target { powerpc*-*-linux* } } } */ /* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ /* { dg-require-effective-target powerpc_vsx_ok } */ /* { dg-options "-O3 -ftree-vectorize -mcpu=power7 -ffast-math -mveclibabi=mass" } */ -- 2.7.4