From ec23ed606daa42ee11510be00add6f2a6350d565 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Tue, 21 Mar 2006 21:59:11 +0100 Subject: [PATCH] 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 --- gcc/ChangeLog | 9 +++++++ gcc/config.gcc | 20 +++++++++++++--- gcc/config/sol2-10.h | 24 +++++++++++++++++++ gcc/config/{sol26.h => sol2-6.h} | 0 gcc/testsuite/ChangeLog | 10 ++++++++ gcc/testsuite/gcc.dg/builtins-18.c | 13 +++++----- gcc/testsuite/gcc.dg/builtins-20.c | 1 + gcc/testsuite/gcc.dg/builtins-53.c | 1 + gcc/testsuite/gcc.dg/builtins-config.h | 5 ++-- .../gcc.dg/single-precision-constant.c | 4 ++++ 10 files changed, 76 insertions(+), 11 deletions(-) create mode 100644 gcc/config/sol2-10.h rename gcc/config/{sol26.h => sol2-6.h} (100%) 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/sol26.h b/gcc/config/sol2-6.h similarity index 100% rename from gcc/config/sol26.h rename to gcc/config/sol2-6.h 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 -- 2.30.2