Date: Mon, 6 Dec 2010 00:19:56 +0000 (UTC) From: David Schultz <das@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r216223 - head/tools/regression/lib/msun Message-ID: <201012060019.oB60JuQd014093@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: das Date: Mon Dec 6 00:19:56 2010 New Revision: 216223 URL: http://svn.freebsd.org/changeset/base/216223 Log: Work around gcc constant folding bugs. Modified: head/tools/regression/lib/msun/test-lrint.c Modified: head/tools/regression/lib/msun/test-lrint.c ============================================================================== --- head/tools/regression/lib/msun/test-lrint.c Mon Dec 6 00:02:49 2010 (r216222) +++ head/tools/regression/lib/msun/test-lrint.c Mon Dec 6 00:19:56 2010 (r216223) @@ -41,9 +41,14 @@ __FBSDID("$FreeBSD$"); #include <ieeefp.h> #endif +/* + * XXX The volatile here is to avoid gcc's bogus constant folding and work + * around the lack of support for the FENV_ACCESS pragma. + */ #define test(func, x, result, excepts) do { \ + volatile double _d = x; \ assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ - assert((func)(x) == (result) || fetestexcept(FE_INVALID)); \ + assert((func)(_d) == (result) || fetestexcept(FE_INVALID)); \ assert(fetestexcept(FE_ALL_EXCEPT) == (excepts)); \ } while (0)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012060019.oB60JuQd014093>