[Bug libstdc++/49553] mt19937 number generator is broken on 64bit systems

2011-06-27 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49553

Paolo Carlini  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||WONTFIX

--- Comment #2 from Paolo Carlini  2011-06-27 
21:54:09 UTC ---
No, the problem isn't in that typedef, which must be like that, per TR1. The
problem is a limitation of the tr1::uniform_int which doesn't work for an
UniformRandomNumberGenerator which generates numbers in a range smaller than
the required uniform_int output range (see the XXX comment). Fixing that was
not trivial, but it is now fixed in the C++0x uniform_int, whereas the TR1 code
ad this time is frozen, I'm sorry, if you still want to use it, please work
around the limitation (there are many ways).


[Bug libstdc++/49553] mt19937 number generator is broken on 64bit systems

2011-06-27 Thread boris at dolgov dot name
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49553

--- Comment #1 from Boris Dolgov  2011-06-27 21:40:09 
UTC ---
Created attachment 24610
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24610
Replace magic numbers to __WORDSIZE and __WORDSIZE-1

The attached patch solves the problem for me.