From c7582f442684afde561bf860d4800b1b3610bccd Mon Sep 17 00:00:00 2001
From: rtoy <rtoy>
Date: Fri, 18 Jan 2008 14:31:50 +0000
Subject: [PATCH] Move the rules for e_rem_pio2.c and k_rem_pio2.c from
 GNUmakefile to Config.linux_gencgc.

This only appears to be an issue on Linux.  FreeBSD and Darwin are
ok.  And it depends on the compiler. gcc 4.2.1 produces bad results,
but gcc 3.4.6 is ok.  Could be an aliasing issue.  So use -O1
everywhere.  -ffloat-store doesn't appear to matter so remove that
too.
---
 lisp/Config.linux_gencgc | 14 ++++++++++++++
 lisp/GNUmakefile         | 17 +----------------
 2 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/lisp/Config.linux_gencgc b/lisp/Config.linux_gencgc
index 6377a63e8..108a2f454 100644
--- a/lisp/Config.linux_gencgc
+++ b/lisp/Config.linux_gencgc
@@ -31,3 +31,17 @@ OS_SRC = Linux-os.c os-common.c elf.c e_rem_pio2.c k_rem_pio2.c
 OS_LINK_FLAGS = -rdynamic -Xlinker --export-dynamic -Xlinker -Map -Xlinker foo
 OS_LIBS = -ldl
 #GC_SRC = gencgc.c
+
+# gcc 4.2.1 on Suse 10.3 appears to mis-compile these files with -O2.
+# Hence, compile these with -O1, which appears to work.  (Perhaps this
+# is an aliasing issue?)  To see this failure, try computing (cos
+# (expt 2d0 120)).  This should be near -0.92587902285....
+#
+# This appears to be ok with gcc 3.4.6, but we force -O1 everywhere
+# since we can't tell what compiler version we're using.
+
+e_rem_pio2.o : e_rem_pio2.c
+	$(CC) -c $(CFLAGS) -O1 $<
+
+k_rem_pio2.o : k_rem_pio2.c
+	$(CC) -c $(CFLAGS) -O1 $<
diff --git a/lisp/GNUmakefile b/lisp/GNUmakefile
index 234a23eb5..0d676d5ba 100644
--- a/lisp/GNUmakefile
+++ b/lisp/GNUmakefile
@@ -1,4 +1,4 @@
-# $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/GNUmakefile,v 1.27 2008/01/18 01:44:18 rtoy Exp $
+# $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/GNUmakefile,v 1.28 2008/01/18 14:31:50 rtoy Exp $
 
 all: lisp.nm
 
@@ -64,19 +64,4 @@ Depends: ${SRCS}
 	$(DEPEND) ${DEPEND_FLAGS} ${CFLAGS} ${CPPFLAGS} $^ > ,depends
 	mv ,depends Depends
 
-# For x86 architectures, these files need to be compiled with
-# -ffloat-store to make sure that we get double-float precision
-# instead of the default x86 80-bit extended precision.
-
-# gcc 4.2.1 on Suse 10.3 appears to mis-compile these files with -O2.
-# Hence, compile these with -O1, which appears to work.  To see this
-# failure, try computing (cos (expt 2d0 120)).  This should be near
-# -0.92587902285....
-
-e_rem_pio2.o : e_rem_pio2.c
-	$(CC) -c $(CFLAGS) -O1 -ffloat-store $(PATH1)/e_rem_pio2.c
-
-k_rem_pio2.o : k_rem_pio2.c
-	$(CC) -c $(CFLAGS) -O1 -ffloat-store $(PATH1)/k_rem_pio2.c
-
 -include Depends
-- 
GitLab