[Bug c++/64318] Using _Cilk_for with <random> cause strange floating point exception

zhouyan at me dot com gcc-bugzilla@gcc.gnu.org
Mon Dec 15 19:27:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64318

--- Comment #3 from zhouyan at me dot com ---
Here is version that shall be thread-safe, that produce the same problem,

#include <random>

int main ()
{
    _Cilk_for (int i = 0; i != 10000; ++i) {
        std::mt19937 eng(i);
        std::normal_distribution<> rnorm;
        rnorm(eng);
    }
}


The original program which I first found the issue was thread-safe. The MWE I
first submitted was created a little too hasty. In fact, neither mt19937 nor
normal_distribution is thread-safe. Anyway, I don't think race condition was
the problem.



More information about the Gcc-bugs mailing list