Boost.config limits_test testcase and qnan checks.

First an introduction; my name is Matt Markland and I support the Cray Compiling Environment (CCE) C/C++ compiler for Cray, Inc. We (Cray) are in the process of improving our Boost support and currently have an intern doing some work for us on this path. While working on Boost.config, he has run into a testcase failure with the limits_test function test_float_limits(). With default options, CCE fails the qnan tests due to the fact that we do not conform to the IEEE specification. CCE is a little different here in that by default it runs at a higher optimization level then other compilers. Gcc will fail this portion of the test if you compile with optimization on and -ffast-math. My question is whether it is valid to test the qnan behavior when a platform does not claim compliance? It seems to me that these checks should be wrapped in an is_iec559 check. Thoughts? Thanks for your time! Matt ---- Matthew Markland Compiler Front-End and Libraries C/C++ Front-End markland@cray.com 651-605-9186

First an introduction; my name is Matt Markland and I support the Cray Compiling Environment (CCE) C/C++ compiler for Cray, Inc. We (Cray) are in the process of improving our Boost support and currently have an intern doing some work for us on this path. While working on Boost.config, he has run into a testcase failure with the limits_test function test_float_limits(). With default options, CCE fails the qnan tests due to the fact that we do not conform to the IEEE specification. CCE is a little different here in that by default it runs at a higher optimization level then other compilers. Gcc will fail this portion of the test if you compile with optimization on and -ffast-math.
My question is whether it is valid to test the qnan behavior when a platform does not claim compliance? It seems to me that these checks should be wrapped in an is_iec559 check.
I think that's a valid point to make - I've disabled the test for inequality between NaN's unless is_iec559 is true. Great to see you're working on compiling Boost too! John.

Matthew Markland wrote:
default it runs at a higher optimization level then other compilers. Gcc will fail this portion of the test if you compile with optimization on and -ffast-math.
My question is whether it is valid to test the qnan behavior when a platform does not claim compliance?
I wonder how you measure "claim compliance"? I once had a long debug session with gcc-4.5.2 before I found out that the builtin "is_nan" was returning wrong results. Isn't compiling the code that uses "is_nan" without warning also some sort of "compliance claim"? I know you are probably referring to "numeric_limits<double>::is_iec559", but on which floating point functionality can I still rely as a programmer if (is_iec559 == false)? Regards, Thomas
participants (3)
-
John Maddock
-
Matthew Markland
-
Thomas Klimpel