Bug 207421: use /Op to disable some floating-point optimizations of MSVC NSPRPUB_PRE_4_2_CLIENT_BRANCH
authorwtc%netscape.com
Fri, 06 Jun 2003 03:09:17 +0000
branchNSPRPUB_PRE_4_2_CLIENT_BRANCH
changeset 2851 1460dd392f950640a861b2e341e665b8fea12dd9
parent 2844 06bab8e7fe98ddb624f79c4ebe69e0f3ab8b257e
child 2854 704f7885e74237d0c16199fd7fd8e4eb921c17c8
push idunknown
push userunknown
push dateunknown
bugs207421
Bug 207421: use /Op to disable some floating-point optimizations of MSVC 6.0 Processor Pack because they make the floating-point calculations in prdtoa.c produce incorrect results. r=cls. Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
pr/src/misc/Makefile.in
--- a/pr/src/misc/Makefile.in
+++ b/pr/src/misc/Makefile.in
@@ -77,16 +77,26 @@ TARGETS	= $(OBJS)
 INCLUDES = -I$(dist_includedir) -I$(topsrcdir)/pr/include -I$(topsrcdir)/pr/include/private
 
 DEFINES	+= -D_NSPR_BUILD_
 
 RELEASE_BINS = $(srcdir)/compile-et.pl $(srcdir)/prerr.properties
 
 include $(topsrcdir)/config/rules.mk
 
+# Prevent floating point errors caused by MSVC 6.0 Processor Pack
+# optimizations (bug 207421).  This disables optimizations that
+# could change the precision of floating-point calculations for
+# this single compilation unit.
+ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
+$(OBJDIR)/prdtoa.$(OBJ_SUFFIX): prdtoa.c
+	@$(MAKE_OBJDIR)
+	$(CC) -Fo$@ -c $(CFLAGS) -Op $(call abspath,$<)
+endif
+
 #
 # Generate prerr.h, prerr.c, and prerr.properties from prerr.et.
 #
 build_prerr:
 	cd $(srcdir); $(PERL) compile-et.pl prerr.et
 
 export:: $(TARGETS)