https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107660
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |UNCONFIRMED Ever confirmed|1 |0 --- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> --- Thanks for the reduced example code, I can see what the problem is now. The mt19937 engine produces consistent results, but the commit that Andrew linked to alters the output of std::uniform_int_distribution, due to a different (much faster) algorithm used to downscale the random bits produced by std::mt19937 to the number of elements being shuffled. The only requirement on the uniform_int_distribution is that it produces values uniformly distributed between the minimum and maximum values. Unlike std::mt19937 it doesn't have to produce a specific sequence of values. I supposed we could add a macro that disables the new fast implementation, for users who prefer to get the same sequence of values as GCC 10, even though it's slower.