Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Mar 2011 08:52:23 +0000 (UTC)
From:      David Schultz <das@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r219325 - stable/8/lib/msun
Message-ID:  <201103060852.p268qNsj091453@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: das
Date: Sun Mar  6 08:52:23 2011
New Revision: 219325
URL: http://svn.freebsd.org/changeset/base/219325

Log:
  MFC r216137:
    Disable gcc's built-in rint() function when compiling s_nearbyint.c.
    It results in incorrect optimizations that break nearbyint().

Modified:
  stable/8/lib/msun/Makefile
Directory Properties:
  stable/8/lib/msun/   (props changed)

Modified: stable/8/lib/msun/Makefile
==============================================================================
--- stable/8/lib/msun/Makefile	Sun Mar  6 08:50:15 2011	(r219324)
+++ stable/8/lib/msun/Makefile	Sun Mar  6 08:52:23 2011	(r219325)
@@ -109,6 +109,12 @@ COMMON_SRCS:=  ${COMMON_SRCS:N${i:R}.c}
 .endfor
 .endif
 
+# Some files need certain gcc built-in functions to be disabled, since gcc's
+# model of the functions bogusly assumes -fno-trapping-math.
+XRINT_CFLAGS=	-fno-builtin-rint -fno-builtin-rintf -fno-builtin-rintl
+CFLAGS+=	${XRINT_CFLAGS}
+XRINT_CFLAGS:=	${.IMPSRC:M*/s_nearbyint.c:C/^.+$/${XRINT_CFLAGS}/:C/^$//}
+
 SRCS=	${COMMON_SRCS} ${ARCH_SRCS}
 
 INCS=	fenv.h math.h



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103060852.p268qNsj091453>