Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Aug 2014 17:14:47 +0000 (UTC)
From:      Steve Kargl <kargl@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r270845 - head/lib/msun/src
Message-ID:  <201408301714.s7UHEl0R043670@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kargl
Date: Sat Aug 30 17:14:47 2014
New Revision: 270845
URL: http://svnweb.freebsd.org/changeset/base/270845

Log:
  Make tiny volatile to prevent the compiler(s) from
  constant folding expressions of the form "1 - tiny",
  which are used to raise FE_INEXACT.

Modified:
  head/lib/msun/src/s_tanh.c
  head/lib/msun/src/s_tanhf.c

Modified: head/lib/msun/src/s_tanh.c
==============================================================================
--- head/lib/msun/src/s_tanh.c	Sat Aug 30 15:41:07 2014	(r270844)
+++ head/lib/msun/src/s_tanh.c	Sat Aug 30 17:14:47 2014	(r270845)
@@ -42,7 +42,8 @@ __FBSDID("$FreeBSD$");
 #include "math.h"
 #include "math_private.h"
 
-static const double one = 1.0, two = 2.0, tiny = 1.0e-300, huge = 1.0e300;
+static volatile const double tiny = 1.0e-300;
+static const double one = 1.0, two = 2.0, huge = 1.0e300;
 
 double
 tanh(double x)

Modified: head/lib/msun/src/s_tanhf.c
==============================================================================
--- head/lib/msun/src/s_tanhf.c	Sat Aug 30 15:41:07 2014	(r270844)
+++ head/lib/msun/src/s_tanhf.c	Sat Aug 30 17:14:47 2014	(r270845)
@@ -19,7 +19,9 @@ __FBSDID("$FreeBSD$");
 #include "math.h"
 #include "math_private.h"
 
-static const float one=1.0, two=2.0, tiny = 1.0e-30, huge = 1.0e30;
+static volatile const float tiny = 1.0e-30;
+static const float one=1.0, two=2.0, huge = 1.0e30;
+
 float
 tanhf(float x)
 {



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