This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [v3] Fix ext/random/hypergeometric_distribution/operators/values.cc on Solaris 9
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Wed, 27 Nov 2013 17:17:15 +0100
- Subject: Re: [v3] Fix ext/random/hypergeometric_distribution/operators/values.cc on Solaris 9
- Authentication-results: sourceware.org; auth=none
- References: <yddvbze7wym dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE> <52960E79 dot 70709 at oracle dot com>
Hi Paolo,
> On 11/27/2013 03:14 PM, Rainer Orth wrote:
>> hypergeometric_pdf is defined in testsuite/util/testsuite_random.h
>> inside _GLIBCXX_USE_C99_MATH_TR1, but used unconditionally. Fixed which
>> the following patch which allows the test to compile and pass on
>> i386-pc-solaris2.9. On i386-pc-solaris2.11, it FAILs with an Arithmetic
>> exception, as it did before the patch:
>>
>> Program received signal SIGFPE, Arithmetic exception.
>> [Switching to Thread 1 (LWP 1)]
>> 0x080542ba in std::generate_canonical<unsigned int, 32u,
>> std::mersenne_twister_engine<unsigned int, 32u, 624u, 397u, 31u,
>> 2567483615u, 11u, 4294967295u, 7u, 2636928640u, 15u, 4022730752u, 18u,
>> 1812433253u> > (__urng=...)
>> at
>> /var/gcc/regression/trunk/11-gcc/build/i386-pc-solaris2.11/libstdc++-v3/include/bits/random.tcc:3480
>> 3480 return __sum / __tmp;
>>
>> __tmp is 0 here.
>>
>> Ok for mainline?
> Please use // { dg-require-cmath "" } instead.
make sense since this renders the test unsupported instead of pass.
Since I'd already committed the previous version based on Jonathan's
approval, I've installed the following on top of it after testing with
the appropriate runtest command.
Rainer
2013-11-27 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* testsuite/ext/random/hypergeometric_distribution/operators/values.cc:
Use dg-require-cmath instead.
diff --git a/libstdc++-v3/testsuite/ext/random/hypergeometric_distribution/operators/values.cc b/libstdc++-v3/testsuite/ext/random/hypergeometric_distribution/operators/values.cc
--- a/libstdc++-v3/testsuite/ext/random/hypergeometric_distribution/operators/values.cc
+++ b/libstdc++-v3/testsuite/ext/random/hypergeometric_distribution/operators/values.cc
@@ -1,5 +1,6 @@
// { dg-options "-std=gnu++11" }
// { dg-require-cstdint "" }
+// { dg-require-cmath "" }
//
// 2013-11-18 Edward M. Smith-Rowland <3dw4rd@verizon.net>
//
@@ -31,7 +32,6 @@
void
test01()
{
-#if _GLIBCXX_USE_C99_MATH_TR1
using namespace __gnu_test;
std::mt19937 eng;
@@ -50,7 +50,6 @@ test01()
auto bhd3 = std::bind(hd3, eng);
testDiscreteDist(bhd3, [](int k)
{ return hypergeometric_pdf(k, 100, 20, 5); });
-#endif
}
int
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University