diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index f56df9aebc1..a687a48ccb0 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2012-09-18 Paolo Carlini + + PR libstdc++/54612 + * include/ext/random.tcc (operator== + (const __gnu_cxx::simd_fast_mersenne_twister_engine<>&, + const __gnu_cxx::simd_fast_mersenne_twister_engine<>&)): Fix + state_size use. + * config/cpu/i486/opt/ext/opt_random.h: Guard with __SSE2__. + 2012-09-17 Ulrich Drepper * configure.ac: Substitute CPU_OPT_EXT_RANDOM. diff --git a/libstdc++-v3/config/cpu/i486/opt/ext/opt_random.h b/libstdc++-v3/config/cpu/i486/opt/ext/opt_random.h index cd06f3f342d..968b1c18bf2 100644 --- a/libstdc++-v3/config/cpu/i486/opt/ext/opt_random.h +++ b/libstdc++-v3/config/cpu/i486/opt/ext/opt_random.h @@ -32,6 +32,7 @@ #pragma GCC system_header +#ifdef __SSE2__ namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) { @@ -130,5 +131,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION } // namespace +#endif // __SSE2__ #endif // _EXT_OPT_RANDOM_H diff --git a/libstdc++-v3/include/ext/random.tcc b/libstdc++-v3/include/ext/random.tcc index eca8772f767..07001379415 100644 --- a/libstdc++-v3/include/ext/random.tcc +++ b/libstdc++-v3/include/ext/random.tcc @@ -328,7 +328,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __msk1, __msk2, __msk3, __msk4, __parity1, __parity2, __parity3, __parity4>& __rhs) { - return (std::equal(__lhs._M_stateT, __lhs._M_stateT + state_size, + typedef __gnu_cxx::simd_fast_mersenne_twister_engine<_UIntType, + __m, __pos1, __sl1, __sl2, __sr1, __sr2, + __msk1, __msk2, __msk3, __msk4, + __parity1, __parity2, __parity3, __parity4> __engine; + return (std::equal(__lhs._M_stateT, + __lhs._M_stateT + __engine::state_size, __rhs._M_stateT) && __lhs._M_pos == __rhs._M_pos); }