crtfastmath.c: New file.
authorRichard Henderson <rth@redhat.com>
Sun, 24 Jun 2001 02:05:06 +0000 (19:05 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Sun, 24 Jun 2001 02:05:06 +0000 (19:05 -0700)
        * config/alpha/crtfastmath.c: New file.
        * config/alpha/t-crtfm: New file.
        * config/alpha/elf.h (ENDFILE_SPEC): Use crtfastmath.o.
        * config/alpha/osf.h (ENDFILE_SPEC): Likewise.
        * config/alpha/t-crtbe (EXTRA_PARTS): Add pieces defined here.
        * config.gcc (alpha-{linux,freebsd,netbsd,osf}): Use alpha/t-crtfm;
        do not set extra_parts here.

From-SVN: r43537

gcc/ChangeLog
gcc/config.gcc
gcc/config/alpha/crtfastmath.c [new file with mode: 0644]
gcc/config/alpha/elf.h
gcc/config/alpha/osf.h
gcc/config/alpha/t-crtbe
gcc/config/alpha/t-crtfm [new file with mode: 0644]

index f0d23dd4dfb55f8ba6de741d2e314f6f725e0324..b5acd57cff27396bcc0183f990414c60a8e36792 100644 (file)
@@ -1,3 +1,13 @@
+2001-06-23  Richard Henderson  <rth@redhat.com>
+
+       * config/alpha/crtfastmath.c: New file.
+       * config/alpha/t-crtfm: New file.
+       * config/alpha/elf.h (ENDFILE_SPEC): Use crtfastmath.o.
+       * config/alpha/osf.h (ENDFILE_SPEC): Likewise.
+       * config/alpha/t-crtbe (EXTRA_PARTS): Add pieces defined here.
+       * config.gcc (alpha-{linux,freebsd,netbsd,osf}): Use alpha/t-crtfm;
+       do not set extra_parts here.
+
 2001-06-24  Joseph S. Myers  <jsm28@cam.ac.uk>
 
        * doc/install-old.texi: Remove more documentation of configure
index 3f708a4df7ff5740b653771ff0b31f248a39d1e9..df9f3c765db06baa1908c7f69bf7a953d5b55f48 100644 (file)
@@ -430,8 +430,7 @@ alpha*-*-linux*ecoff*)
 alpha*-*-linux*libc1*)
        tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h"
        target_cpu_default="MASK_GAS"
-       tmake_file="t-slibgcc-elf-ver t-linux t-linux-gnulibc1 alpha/t-alpha alpha/t-crtbe alpha/t-ieee"
-       extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
+       tmake_file="t-slibgcc-elf-ver t-linux t-linux-gnulibc1 alpha/t-alpha alpha/t-crtbe alpha/t-crtfm alpha/t-ieee"
        gas=yes gnu_ld=yes
        if test x$enable_threads = xyes; then
                thread_file='posix'
@@ -440,8 +439,7 @@ alpha*-*-linux*libc1*)
 alpha*-*-linux*)
        tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h"
        target_cpu_default="MASK_GAS"
-       tmake_file="t-slibgcc-elf-ver t-linux alpha/t-crtbe alpha/t-alpha alpha/t-ieee"
-       extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
+       tmake_file="t-slibgcc-elf-ver t-linux alpha/t-crtbe alpha/t-crtfm alpha/t-alpha alpha/t-ieee"
        gas=yes gnu_ld=yes
        if test x$enable_threads = xyes; then
                thread_file='posix'
@@ -450,14 +448,13 @@ alpha*-*-linux*)
 alpha*-*-freebsd*)
        tm_file="${tm_file} ${fbsd_tm_file} alpha/elf.h alpha/freebsd.h"
        target_cpu_default="MASK_GAS"
-       tmake_file="${tmake_file} alpha/t-crtbe alpha/t-alpha alpha/t-ieee"
+       tmake_file="${tmake_file} alpha/t-crtbe alpha/t-crtfm alpha/t-alpha alpha/t-ieee"
        ;;
 alpha*-*-netbsd*)
        xm_defines=POSIX
        tm_file="${tm_file} alpha/elf.h alpha/netbsd.h alpha/netbsd-elf.h"
        target_cpu_default="MASK_GAS"
-       tmake_file="alpha/t-crtbe alpha/t-alpha alpha/t-ieee"
-       extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
+       tmake_file="alpha/t-crtbe alpha/t-crtfm alpha/t-alpha alpha/t-ieee"
        gas=yes gnu_ld=yes
        ;;
 
@@ -478,7 +475,7 @@ alpha*-dec-osf*)
                extra_passes="mips-tfile mips-tdump"
        fi
        use_collect2=yes
-       tmake_file="alpha/t-alpha alpha/t-ieee alpha/t-osf"
+       tmake_file="alpha/t-alpha alpha/t-ieee alpha/t-osf alpha/t-crtfm"
        case $machine in
          *-*-osf1*)
            tm_file="${tm_file} alpha/osf.h alpha/osf12.h alpha/osf2or3.h"
diff --git a/gcc/config/alpha/crtfastmath.c b/gcc/config/alpha/crtfastmath.c
new file mode 100644 (file)
index 0000000..4651ee7
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2001 Free Software Foundation, Inc.
+ * Contributed by Richard Henderson (rth@redhat.com)
+ *
+ * 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 2, or (at your option) any
+ * later version.
+ * 
+ * In addition to the permissions in the GNU General Public License, the
+ * Free Software Foundation gives you unlimited permission to link the
+ * compiled version of this file with other programs, and to distribute
+ * those programs without any restriction coming from the use of this
+ * file.  (The General Public License restrictions do apply in other
+ * respects; for example, they cover modification of the file, and
+ * distribution when not linked into another program.)
+ * 
+ * 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.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING.  If not, write to
+ * the Free Software Foundation, 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ * 
+ *    As a special exception, if you link this library with files
+ *    compiled with GCC to produce an executable, this does not cause
+ *    the resulting executable to be covered by the GNU General Public License.
+ *    This exception does not however invalidate any other reasons why
+ *    the executable file might be covered by the GNU General Public License.
+ */
+
+/* Assume OSF/1 compatible interfaces.  */
+
+extern void __ieee_set_fp_control (unsigned long int);
+
+#define IEEE_MAP_DMZ  (1UL<<12)       /* Map denorm inputs to zero */
+#define IEEE_MAP_UMZ  (1UL<<13)       /* Map underflowed outputs to zero */
+
+static void __attribute__((constructor))
+set_fast_math (void)
+{
+  __ieee_set_fp_control (IEEE_MAP_DMZ | IEEE_MAP_UMZ);
+}
index a77a64328d976691950c79048e83981fe012ac53..dbec2b487f31b3fed6eb6b9d4f309394d1fa4b39 100644 (file)
@@ -677,7 +677,8 @@ void FN ()                                  \
 
 #undef ENDFILE_SPEC
 #define ENDFILE_SPEC \
-  "%{shared:crtendS.o%s}%{!shared:crtend.o%s} crtn.o%s"
+  "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
+   %{shared:crtendS.o%s}%{!shared:crtend.o%s} crtn.o%s"
 
 /* We support #pragma.  */
 #define HANDLE_SYSV_PRAGMA
index 1aecf33ad3916841357312d71099fd2301ab8909..24ebaf6aa3fd31a8543712804a04a718c9a1da49 100644 (file)
@@ -68,6 +68,9 @@ Boston, MA 02111-1307, USA.  */
 #define STARTFILE_SPEC  \
   "%{!shared:%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}"
 
+#define ENDFILE_SPEC \
+  "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s}"
+
 #define MD_STARTFILE_PREFIX "/usr/lib/cmplrs/cc/"
 
 #define ASM_FILE_START(FILE)                                   \
index 27e402747d5c068133e902fe3ac525a41bc76f5d..384237b1c9c16df90d95d66cb9715ff6c28ff44f 100644 (file)
@@ -1,6 +1,8 @@
 # Effectively disable the crtbegin/end rules using crtstuff.c
 T = disable
 
+EXTRA_PARTS += crtbegin.o crtend.o crtbeginS.o crtendS.o
+
 # Assemble startup files.
 crtbegin.o: $(srcdir)/config/alpha/crtbegin.asm $(GCC_PASSES)
        $(GCC_FOR_TARGET) -c -o crtbegin.o -x assembler-with-cpp -I. $(srcdir)/config/alpha/crtbegin.asm
diff --git a/gcc/config/alpha/t-crtfm b/gcc/config/alpha/t-crtfm
new file mode 100644 (file)
index 0000000..7076b51
--- /dev/null
@@ -0,0 +1,4 @@
+EXTRA_PARTS += crtfastmath.o
+
+crtfastmath.o: $(srcdir)/config/alpha/crtfastmath.c $(GCC_PASSES)
+       $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -c -o crtfastmath.o $(srcdir)/config/alpha/crtfastmath.c