config.gcc (i[34567]86-*-solaris2*): Add config/sol2-10.h to tm_file on Solaris 10...
authorEric Botcazou <ebotcazou@libertysurf.fr>
Tue, 21 Mar 2006 20:59:11 +0000 (21:59 +0100)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 21 Mar 2006 20:59:11 +0000 (20:59 +0000)
2006-03-21  Eric Botcazou  <ebotcazou@libertysurf.fr>

* 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
gcc/config.gcc
gcc/config/sol2-10.h [new file with mode: 0644]
gcc/config/sol2-6.h [new file with mode: 0644]
gcc/config/sol26.h [deleted file]
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/builtins-18.c
gcc/testsuite/gcc.dg/builtins-20.c
gcc/testsuite/gcc.dg/builtins-53.c
gcc/testsuite/gcc.dg/builtins-config.h
gcc/testsuite/gcc.dg/single-precision-constant.c

index cc64df97caa8758af430d9086984a932ea931ee6..176ce6560e7fb1a4c394ab8facef6b6c840d5db4 100644 (file)
@@ -1,3 +1,12 @@
+2006-03-21  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * 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  <pinskia@physics.uc.edu>
 
        PR tree-opt/26781
index dd411deaf6a89b21200f813a27e0b9867a1236f0..92dce31765e4da5ac206eb3eedada9b392eef563 100644 (file)
@@ -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 (file)
index 0000000..1da6bee
--- /dev/null
@@ -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 (file)
index 0000000..d5b7dda
--- /dev/null
@@ -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 (file)
index d5b7dda..0000000
+++ /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} \
-"
index eafe67c1dcf4a43445c60a22835adc0794c05942..372ab8c11136c2f3240954ecb8ab24e33924495c 100644 (file)
@@ -1,3 +1,13 @@
+2006-03-21  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * 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  <pinskia@physics.uc.edu>
 
        PR tree-opt/26781
index d04fe712f9a1b8968ffab40c983e594efa5f58ef..f4f64c1acb3c9b47d957f8720ed757e4ea94a4a2 100644 (file)
@@ -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;
index a8ada8a8606c8d150f04adb6669d56bd2b6971eb..40a29c4f559ceeedbfb6cc697b4d4cd15ee7da79 100644 (file)
@@ -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"
 
index 2b4b2f978b4c8a2c3b4dd6629dc0c3fcf3c02cdf..048cda92afb1dd3abb61b967b4d038815e550497 100644 (file)
@@ -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"
 
index 6554f46057fddb551754388e804da2927ee8a868..6921b80b3a77ec17bafbd97b83f68776a31b32dd 100644 (file)
@@ -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)
index e95eb39618ec4fd672f3aec686eb80be3024f35c..3cf9f8ffe8750e862d90f36431ec291c69882e7b 100644 (file)
@@ -1,8 +1,12 @@
 /* Test that double precision constants are correctly handled 
    when code is compiled with -fsingle-precision-constant */
 /* Origin: Carlos O'Donell <carlos@codesourcery.com> */
+
 /* { 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 <math.h>
 #include <float.h>