Bug 207421: use /Op to disable some floating-point optimizations of MSVC MOZILLA_1_4_BRANCH
authorwtc%netscape.com
Thu, 19 Jun 2003 03:51:16 +0000
branchMOZILLA_1_4_BRANCH
changeset 2855 67404ef7e000bd5d93f48806af3fb96f3de968e6
parent 2841 f5ace4f0e1677038d6ef3b18d22c221c19ad993c
child 2987 e3a7abf90681d12413135d13767bba27f97080d4
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. a=asa,adt for the Mozilla 1.4 branch. Tag: MOZILLA_1_4_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)