crtprec.c: Move to ../libgcc/config/i386.
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Wed, 13 Jul 2011 17:39:35 +0000 (17:39 +0000)
committerRainer Orth <ro@gcc.gnu.org>
Wed, 13 Jul 2011 17:39:35 +0000 (17:39 +0000)
gcc:
* config/i386/crtprec.c: Move to ../libgcc/config/i386.
* config/i386/t-crtpc: Remove.
* config/t-darwin (EXTRA_MULTILIB_PARTS): Remove.
* config.gcc (i[34567]86-*-darwin*): Remove i386/t-crtpc from
tmake_file.
(x86_64-*-darwin*): Likewise.
(i[34567]86-*-linux*): Likewise.
(x86_64-*-linux*): Likewise.

* config/i386/sol2.h (ENDFILE_SPEC): Redefine.
Handle -mpc32, -mpc64, -mpc80.

libgcc:
* config/i386/crtprec.c: New file.
* config/i386/t-crtpc: Use $(srcdir) to refer to crtprec.c.
* config.host (i[34567]86-*-darwin*): Add i386/t-crtpc to tmake_file.
Add crtprec32.o, crtprec64.o, crtprec80.o to extra_parts.
(x86_64-*-darwin*): Likewise.
(i[34567]86-*-solaris2*: Likewise.

gcc/testsuite:
* gcc.c-torture/execute/990127-2.x: Use -mpc64 on i?86-*-darwin*,
i?86-*-solaris2*, x86_64-*-darwin*, x86_64-*-solaris2*.

From-SVN: r176242

gcc/ChangeLog
gcc/config.gcc
gcc/config/i386/crtprec.c [deleted file]
gcc/config/i386/sol2.h
gcc/config/i386/t-crtpc [deleted file]
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/990127-2.x
libgcc/ChangeLog
libgcc/config.host
libgcc/config/i386/crtprec.c [new file with mode: 0644]
libgcc/config/i386/t-crtpc

index 8f83ff3ecb517fe02f2ac864deaf10e9642e43ae..881d83f4445bef688f34c4aeb8d5edd7ea82e815 100644 (file)
@@ -1,3 +1,17 @@
+2011-07-13  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * config/i386/crtprec.c: Move to ../libgcc/config/i386.
+       * config/i386/t-crtpc: Remove.
+       * config/t-darwin (EXTRA_MULTILIB_PARTS): Remove.
+       * config.gcc (i[34567]86-*-darwin*): Remove i386/t-crtpc from
+       tmake_file.
+       (x86_64-*-darwin*): Likewise.
+       (i[34567]86-*-linux*): Likewise.
+       (x86_64-*-linux*): Likewise.
+
+       * config/i386/sol2.h (ENDFILE_SPEC): Redefine.
+       Handle -mpc32, -mpc64, -mpc80.
+
 2011-07-13  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * config/alpha/crtfastmath.c: Move to ../libgcc/config/alpha.
index 77424f2df512dfbd96553be734667c43cdbf6643..03fa7d274ca157f81e2419afed621327124ad623 100644 (file)
@@ -1208,12 +1208,12 @@ i[34567]86-*-darwin*)
        need_64bit_isa=yes
        # Baseline choice for a machine that allows m64 support.
        with_cpu=${with_cpu:-core2}
-       tmake_file="${tmake_file} t-slibgcc-dummy i386/t-crtpc"
+       tmake_file="${tmake_file} t-slibgcc-dummy"
        libgcc_tm_file="$libgcc_tm_file i386/darwin-lib.h"
        ;;
 x86_64-*-darwin*)
        with_cpu=${with_cpu:-core2}
-       tmake_file="${tmake_file} ${cpu_type}/t-darwin64 t-slibgcc-dummy i386/t-crtpc"
+       tmake_file="${tmake_file} ${cpu_type}/t-darwin64 t-slibgcc-dummy"
        tm_file="${tm_file} ${cpu_type}/darwin64.h"
        libgcc_tm_file="$libgcc_tm_file i386/darwin-lib.h"
        ;;
@@ -1311,7 +1311,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i
        i[34567]86-*-kopensolaris*-gnu) tm_file="${tm_file} i386/gnu-user.h kopensolaris-gnu.h i386/kopensolaris-gnu.h" ;;
        i[34567]86-*-gnu*) tm_file="$tm_file i386/gnu-user.h gnu.h i386/gnu.h";;
        esac
-       tmake_file="${tmake_file} i386/t-crtstuff i386/t-crtpc"
+       tmake_file="${tmake_file} i386/t-crtstuff"
        ;;
 x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
        tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h glibc-stdint.h \
@@ -1323,7 +1323,7 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
        x86_64-*-kfreebsd*-gnu) tm_file="${tm_file} kfreebsd-gnu.h i386/kfreebsd-gnu64.h" ;;
        x86_64-*-knetbsd*-gnu) tm_file="${tm_file} knetbsd-gnu.h" ;;
        esac
-       tmake_file="${tmake_file} i386/t-linux64 i386/t-crtstuff i386/t-crtpc"
+       tmake_file="${tmake_file} i386/t-linux64 i386/t-crtstuff"
        x86_multilibs="${with_multilib_list}"
        if test "$x86_multilibs" = "default"; then
                x86_multilibs="m64,m32"
diff --git a/gcc/config/i386/crtprec.c b/gcc/config/i386/crtprec.c
deleted file mode 100644 (file)
index 4f42a8f..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2007, 2009 Free Software Foundation, Inc.
- *
- * This file 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 3, or (at your option) any
- * later version.
- * 
- * This file 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.
- * 
- * Under Section 7 of GPL version 3, you are granted additional
- * permissions described in the GCC Runtime Library Exception, version
- * 3.1, as published by the Free Software Foundation.
- *
- * You should have received a copy of the GNU General Public License and
- * a copy of the GCC Runtime Library Exception along with this program;
- * see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
- * <http://www.gnu.org/licenses/>.
- */
-
-#if __PREC == 32
- #define X87CW         (0 << 8)        /* Single precision (24 bits) */
-#elif __PREC == 64
- #define X87CW         (2 << 8)        /* Double precision (53 bits) */
-#elif __PREC == 80
- #define X87CW         (3 << 8)        /* Extended precision (64 bits) */
-#else
- #error "Wrong precision requested."
-#endif
-
-#define X87CW_PCMASK   (3 << 8)
-
-static void __attribute__((constructor))
-set_precision (void)
-{
-  unsigned short int cwd;
-
-  asm volatile ("fstcw\t%0" : "=m" (cwd));
-
-  cwd &= ~X87CW_PCMASK;
-  cwd |= X87CW;
-
-  asm volatile ("fldcw\t%0" : : "m" (cwd));
-}
index f620de5fa44ea3fb1ff50ac8cbe3cf4d97d00db2..e0e7c5b6a1e44292d2623a2d7114d15aa581be4d 100644 (file)
@@ -70,6 +70,14 @@ along with GCC; see the file COPYING3.  If not see
 #undef ASM_SPEC
 #define ASM_SPEC ASM_SPEC_BASE
 
+#undef  ENDFILE_SPEC
+#define ENDFILE_SPEC \
+  "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
+   %{mpc32:crtprec32.o%s} \
+   %{mpc64:crtprec64.o%s} \
+   %{mpc80:crtprec80.o%s} \
+   crtend.o%s crtn.o%s"
+
 #define SUBTARGET_CPU_EXTRA_SPECS \
   { "cpp_subtarget",    CPP_SUBTARGET_SPEC },          \
   { "asm_cpu",          ASM_CPU_SPEC },                \
diff --git a/gcc/config/i386/t-crtpc b/gcc/config/i386/t-crtpc
deleted file mode 100644 (file)
index c165772..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (C) 2007 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 3, 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 COPYING3.  If not see
-# <http://www.gnu.org/licenses/>.
-
-EXTRA_PARTS += crtprec32.o crtprec64.o crtprec80.o
-
-$(T)crtprec32.o: $(srcdir)/config/i386/crtprec.c $(GCC_PASSES)
-       $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(MULTILIB_CFLAGS) -D__PREC=32 -c \
-               $(srcdir)/config/i386/crtprec.c \
-               -o $(T)crtprec32$(objext)
-
-$(T)crtprec64.o: $(srcdir)/config/i386/crtprec.c $(GCC_PASSES)
-       $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(MULTILIB_CFLAGS) -D__PREC=64 -c \
-               $(srcdir)/config/i386/crtprec.c \
-               -o $(T)crtprec64$(objext)
-
-$(T)crtprec80.o: $(srcdir)/config/i386/crtprec.c $(GCC_PASSES)
-       $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(MULTILIB_CFLAGS) -D__PREC=80 -c \
-               $(srcdir)/config/i386/crtprec.c \
-               -o $(T)crtprec80$(objext)
index a74ee65ae4ca3941b4666f7f7e09141d943314dc..d4743a620aa1aa847c84fab701be58af05bdda64 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-13  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * gcc.c-torture/execute/990127-2.x: Use -mpc64 on i?86-*-darwin*,
+       i?86-*-solaris2*, x86_64-*-darwin*, x86_64-*-solaris2*.
+
 2011-07-13  Uros Bizjak  <ubizjak@gmail.com>
 
        * lib/g++.exp (g++_init):  Use istarget.  Remove target_triplet global.
index 56455ab8847808a58a6d7ea03feaaec2d3229535..3e1d8352d22a5d36bf65ad0a5269f3b3164bd75a 100644 (file)
@@ -3,12 +3,16 @@
 # Use -mpc64 to force 80387 floating-point precision to 64 bits.  This option
 # has no effect on SSE, but it is needed in case of -m32 on x86_64 targets.
 
-if { [istarget i?86-*-linux*]
+if { [istarget i?86-*-darwin*]
+     || [istarget i?86-*-linux*]
      || [istarget i?86-*-kfreebsd*-gnu]
      || [istarget i?86-*-knetbsd*-gnu]
+     || [istarget i?86-*-solaris2*]
+     || [istarget x86_64-*-darwin*]
      || [istarget x86_64-*-linux*]
      || [istarget x86_64-*-kfreebsd*-gnu]
-     || [istarget x86_64-*-knetbsd*-gnu] } {
+     || [istarget x86_64-*-knetbsd*-gnu]
+     || [istarget x86_64-*-solaris2*] } {
        set additional_flags "-mpc64"
 }
 
index 401287cfb064cfa6c860cb479c4592ed26b9df19..49fed6ef5c1fbebc78139e030380088fcd339e78 100644 (file)
@@ -1,3 +1,12 @@
+2011-07-13  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * config/i386/crtprec.c: New file.
+       * config/i386/t-crtpc: Use $(srcdir) to refer to crtprec.c.
+       * config.host (i[34567]86-*-darwin*): Add i386/t-crtpc to tmake_file.
+       Add crtprec32.o, crtprec64.o, crtprec80.o to extra_parts.
+       (x86_64-*-darwin*): Likewise.
+       (i[34567]86-*-solaris2*: Likewise.
+
 2011-07-13  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * config/alpha/crtfastmath.c: New file.
index fba7ecd67ab75feee88b855b50a1233c68b1701d..63c4dcc34abc3687d2b116bb5ce1889032f26d33 100644 (file)
@@ -325,12 +325,12 @@ hppa[12]*-*-hpux11*)
        md_unwind_header=pa/hpux-unwind.h
        ;;
 i[34567]86-*-darwin*)
-       tmake_file="$tmake_file i386/t-crtfm"
-       extra_parts="$extra_parts crtfastmath.o"
+       tmake_file="$tmake_file i386/t-crtpc i386/t-crtfm"
+       extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
        ;;
 x86_64-*-darwin*)
-       tmake_file="t-darwin ${cpu_type}/t-darwin64 i386/t-crtfm t-slibgcc-darwin"
-       extra_parts="$extra_parts crtfastmath.o"
+       tmake_file="t-darwin ${cpu_type}/t-darwin64 i386/t-crtpc i386/t-crtfm t-slibgcc-darwin"
+       extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
        ;;
 i[34567]86-*-elf*)
        ;;
@@ -387,8 +387,8 @@ i[34567]86-*-rtems*)
        tmake_file="${tmake_file} t-crtin i386/t-softfp i386/t-crtstuff t-rtems"
        ;;
 i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
-       tmake_file="$tmake_file i386/t-crtfm"
-       extra_parts="$extra_parts crtfastmath.o"
+       tmake_file="$tmake_file i386/t-crtpc i386/t-crtfm"
+       extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
        md_unwind_header=i386/sol2-unwind.h
        ;;
 i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae)
diff --git a/libgcc/config/i386/crtprec.c b/libgcc/config/i386/crtprec.c
new file mode 100644 (file)
index 0000000..4f42a8f
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+ *
+ * This file 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 3, or (at your option) any
+ * later version.
+ * 
+ * This file 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.
+ * 
+ * Under Section 7 of GPL version 3, you are granted additional
+ * permissions described in the GCC Runtime Library Exception, version
+ * 3.1, as published by the Free Software Foundation.
+ *
+ * You should have received a copy of the GNU General Public License and
+ * a copy of the GCC Runtime Library Exception along with this program;
+ * see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+
+#if __PREC == 32
+ #define X87CW         (0 << 8)        /* Single precision (24 bits) */
+#elif __PREC == 64
+ #define X87CW         (2 << 8)        /* Double precision (53 bits) */
+#elif __PREC == 80
+ #define X87CW         (3 << 8)        /* Extended precision (64 bits) */
+#else
+ #error "Wrong precision requested."
+#endif
+
+#define X87CW_PCMASK   (3 << 8)
+
+static void __attribute__((constructor))
+set_precision (void)
+{
+  unsigned short int cwd;
+
+  asm volatile ("fstcw\t%0" : "=m" (cwd));
+
+  cwd &= ~X87CW_PCMASK;
+  cwd |= X87CW;
+
+  asm volatile ("fldcw\t%0" : : "m" (cwd));
+}
index c231ce195f2e5e24d8802bb5b64a9fda853b2359..b605f6f79306959e4647db9ce98e90f5080f2425 100644 (file)
@@ -1,8 +1,8 @@
-crtprec32.o: $(gcc_srcdir)/config/i386/crtprec.c
+crtprec32.o: $(srcdir)/config/i386/crtprec.c
        $(gcc_compile) -D__PREC=32 -c $<
 
-crtprec64.o: $(gcc_srcdir)/config/i386/crtprec.c
+crtprec64.o: $(srcdir)/config/i386/crtprec.c
        $(gcc_compile) -D__PREC=64 -c $<
 
-crtprec80.o: $(gcc_srcdir)/config/i386/crtprec.c
+crtprec80.o: $(srcdir)/config/i386/crtprec.c
        $(gcc_compile) -D__PREC=80 -c $<