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 [moved from gcc/config/sol26.h with 100% similarity]
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 cc64df9..176ce65 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 dd411de..92dce31 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
similarity index 100%
rename from gcc/config/sol26.h
rename to gcc/config/sol2-6.h
index eafe67c..372ab8c 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 d04fe71..f4f64c1 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 a8ada8a..40a29c4 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 2b4b2f9..048cda9 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 6554f46..6921b80 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 e95eb39..3cf9f8f 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>