From: Eric Botcazou Date: Tue, 21 Mar 2006 20:59:11 +0000 (+0100) Subject: config.gcc (i[34567]86-*-solaris2*): Add config/sol2-10.h to tm_file on Solaris 10... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ec23ed606daa42ee11510be00add6f2a6350d565;p=gcc.git config.gcc (i[34567]86-*-solaris2*): Add config/sol2-10.h to tm_file on Solaris 10 and later. 2006-03-21 Eric Botcazou * config.gcc (i[34567]86-*-solaris2*): Add config/sol2-10.h to tm_file on Solaris 10 and later. (sparc64-*-solaris2*): Likewise. (sparc-*-solaris2*): Likewise. * config/sol26.h: Rename to config/sol2-6.h. * config/sol2-10.h: New file. testsuite/ * gcc.dg/builtins-config.h (Solaris case): Define HAVE_C99_RUNTIME if _STDC_C99 is defined. * gcc.dg/builtins-18.c: Pass -std=c99 on Solaris. * gcc.dg/builtins-20.c: Likewise. * gcc.dg/builtins-53.c: Likewise. * gcc.dg/single-precision-constant.c: Likewise. Also pass -mmacosx-version-min=10.3 on PowerPC/Darwin. From-SVN: r112255 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cc64df97caa..176ce6560e7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2006-03-21 Eric Botcazou + + * config.gcc (i[34567]86-*-solaris2*): Add config/sol2-10.h to + tm_file on Solaris 10 and later. + (sparc64-*-solaris2*): Likewise. + (sparc-*-solaris2*): Likewise. + * config/sol26.h: Rename to config/sol2-6.h. + * config/sol2-10.h: New file. + 2006-03-21 Andrew Pinski PR tree-opt/26781 diff --git a/gcc/config.gcc b/gcc/config.gcc index dd411deaf6a..92dce31765e 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1149,7 +1149,11 @@ i[34567]86-*-solaris2*) tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h sol2.h" case ${target} in *-*-solaris2.[0-6] | *-*-solaris2.[0-6].*) - tm_file="${tm_file} sol26.h" + tm_file="${tm_file} sol2-6.h" + ;; + *-*-solaris2.1[0-9]*) + tm_file="${tm_file} sol2-10.h" + ;; esac tm_file="${tm_file} i386/sol2.h" tmake_file="t-sol2 i386/t-sol2 t-svr4" @@ -2113,7 +2117,13 @@ sparc-*-rtems*) extra_parts="crti.o crtn.o crtbegin.o crtend.o" ;; sparc64-*-solaris2* | sparcv9-*-solaris2*) - tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sol2.h sparc/sol2.h sparc/sol2-64.h sparc/sol2-bi.h" + tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sol2.h" + case ${target} in + *-*-solaris2.1[0-9]*) + tm_file="${tm_file} sol2-10.h" + ;; + esac + tm_file="${tm_file} sparc/sol2.h sparc/sol2-64.h sparc/sol2-bi.h" if test x$gnu_ld = xyes; then tm_file="${tm_file} sparc/sol2-gld.h sparc/sol2-gld-bi.h" fi @@ -2142,7 +2152,11 @@ sparc-*-solaris2*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sol2.h" case ${target} in *-*-solaris2.[0-6] | *-*-solaris2.[0-6].*) - tm_file="${tm_file} sol26.h" + tm_file="${tm_file} sol2-6.h" + ;; + *-*-solaris2.1[0-9]*) + tm_file="${tm_file} sol2-10.h" + ;; esac tm_file="${tm_file} sparc/sol2.h" if test x$gnu_ld = xyes; then diff --git a/gcc/config/sol2-10.h b/gcc/config/sol2-10.h new file mode 100644 index 00000000000..1da6bee10de --- /dev/null +++ b/gcc/config/sol2-10.h @@ -0,0 +1,24 @@ +/* Operating system specific defines to be used when targeting GCC for any + Solaris 2 system starting from Solaris 10. + Copyright 2006 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING. If not, write to +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +/* Solaris 10 has the float and long double forms of math functions. */ +#undef TARGET_C99_FUNCTIONS +#define TARGET_C99_FUNCTIONS 1 diff --git a/gcc/config/sol2-6.h b/gcc/config/sol2-6.h new file mode 100644 index 00000000000..d5b7dda2a5f --- /dev/null +++ b/gcc/config/sol2-6.h @@ -0,0 +1,27 @@ +/* Operating system specific defines to be used when targeting GCC for any + Solaris 2 system up to Solaris 2.6. + Copyright 2004 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING. If not, write to +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#undef CPP_SUBTARGET_SPEC +#define CPP_SUBTARGET_SPEC "\ +%{pthreads|pthread:-D_REENTRANT -D_PTHREADS95} \ +%{!pthreads:%{!pthread:%{threads:-D_REENTRANT -D_SOLARIS_THREADS}}} \ +%{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude} \ +" diff --git a/gcc/config/sol26.h b/gcc/config/sol26.h deleted file mode 100644 index d5b7dda2a5f..00000000000 --- a/gcc/config/sol26.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Operating system specific defines to be used when targeting GCC for any - Solaris 2 system up to Solaris 2.6. - Copyright 2004 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GCC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ - -#undef CPP_SUBTARGET_SPEC -#define CPP_SUBTARGET_SPEC "\ -%{pthreads|pthread:-D_REENTRANT -D_PTHREADS95} \ -%{!pthreads:%{!pthread:%{threads:-D_REENTRANT -D_SOLARIS_THREADS}}} \ -%{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude} \ -" diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index eafe67c1dcf..372ab8c1113 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2006-03-21 Eric Botcazou + + * gcc.dg/builtins-config.h (Solaris case): Define HAVE_C99_RUNTIME + if _STDC_C99 is defined. + * gcc.dg/builtins-18.c: Pass -std=c99 on Solaris. + * gcc.dg/builtins-20.c: Likewise. + * gcc.dg/builtins-53.c: Likewise. + * gcc.dg/single-precision-constant.c: Likewise. Also pass + -mmacosx-version-min=10.3 on PowerPC/Darwin. + 2006-03-21 Andrew Pinski PR tree-opt/26781 diff --git a/gcc/testsuite/gcc.dg/builtins-18.c b/gcc/testsuite/gcc.dg/builtins-18.c index d04fe712f9a..f4f64c1acb3 100644 --- a/gcc/testsuite/gcc.dg/builtins-18.c +++ b/gcc/testsuite/gcc.dg/builtins-18.c @@ -8,6 +8,7 @@ /* { dg-do link } */ /* { dg-options "-O2 -ffast-math" } */ /* { dg-options "-O2 -ffast-math -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */ +/* { dg-options "-O2 -ffast-math -std=c99" { target *-*-solaris2* } } */ #include "builtins-config.h" @@ -33,9 +34,9 @@ main (void) if (__builtin_cabsf (fc) != 5.0F) link_error (); if (cabsf (3.0F + 4.0iF) != 5.0F) - link_failure (); + link_error (); if (__builtin_cabsf (3.0F + 4.0iF) != 5.0F) - link_failure (); + link_error (); #endif /* Test doubles. */ @@ -44,9 +45,9 @@ main (void) if (__builtin_cabs (dc) != 5.0) link_error (); if (cabs (3.0 + 4.0i) != 5.0) - link_failure (); + link_error (); if (__builtin_cabs (3.0 + 4.0i) != 5.0) - link_failure (); + link_error (); #ifdef HAVE_C99_RUNTIME /* Test long doubles. */ @@ -55,9 +56,9 @@ main (void) if (__builtin_cabsl (ldc) != 5.0L) link_error (); if (cabsl (3.0L + 4.0iL) != 5.0L) - link_failure (); + link_error (); if (__builtin_cabsl (3.0L + 4.0iL) != 5.0L) - link_failure (); + link_error (); #endif return 0; diff --git a/gcc/testsuite/gcc.dg/builtins-20.c b/gcc/testsuite/gcc.dg/builtins-20.c index a8ada8a8606..40a29c4f559 100644 --- a/gcc/testsuite/gcc.dg/builtins-20.c +++ b/gcc/testsuite/gcc.dg/builtins-20.c @@ -8,6 +8,7 @@ /* { dg-do link } */ /* { dg-options "-O2 -ffast-math" } */ /* { dg-options "-O2 -ffast-math -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */ +/* { dg-options "-O2 -ffast-math -std=c99" { target *-*-solaris2* } } */ #include "builtins-config.h" diff --git a/gcc/testsuite/gcc.dg/builtins-53.c b/gcc/testsuite/gcc.dg/builtins-53.c index 2b4b2f978b4..048cda92afb 100644 --- a/gcc/testsuite/gcc.dg/builtins-53.c +++ b/gcc/testsuite/gcc.dg/builtins-53.c @@ -11,6 +11,7 @@ /* { dg-do compile } */ /* { dg-options "-O2 -ffast-math" } */ /* { dg-options "-O2 -ffast-math -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */ +/* { dg-options "-O2 -ffast-math -std=c99" { target *-*-solaris2* } } */ #include "builtins-config.h" diff --git a/gcc/testsuite/gcc.dg/builtins-config.h b/gcc/testsuite/gcc.dg/builtins-config.h index 6554f46057f..6921b80b3a7 100644 --- a/gcc/testsuite/gcc.dg/builtins-config.h +++ b/gcc/testsuite/gcc.dg/builtins-config.h @@ -11,8 +11,9 @@ #if defined(__hppa) && defined(__hpux) /* PA HP-UX doesn't have the entire C99 runtime. */ -#elif defined(__sun) -/* Solaris doesn't have the entire C99 runtime. */ +#elif defined(__sun) && ! defined (_STDC_C99) +/* Solaris up to 9 doesn't have the entire C99 runtime. + Solaris 10 defines _STDC_C99 if __STDC_VERSION__ is >= 199901L. */ #elif defined(__sgi) /* Irix6 doesn't have the entire C99 runtime. */ #elif defined(__FreeBSD__) && (__FreeBSD__ < 5) diff --git a/gcc/testsuite/gcc.dg/single-precision-constant.c b/gcc/testsuite/gcc.dg/single-precision-constant.c index e95eb39618e..3cf9f8ffe87 100644 --- a/gcc/testsuite/gcc.dg/single-precision-constant.c +++ b/gcc/testsuite/gcc.dg/single-precision-constant.c @@ -1,8 +1,12 @@ /* Test that double precision constants are correctly handled when code is compiled with -fsingle-precision-constant */ /* Origin: Carlos O'Donell */ + /* { dg-do run } */ /* { dg-options "-fsingle-precision-constant" } */ +/* { dg-options "-fsingle-precision-constant -mmacosx-version-min=10.3" { target powerpc-*-darwin* } } */ +/* { dg-options "-fsingle-precision-constant -std=c99" { target *-*-solaris2* } } */ + #include #include