diff options
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 5 | ||||
-rw-r--r-- | libstdc++-v3/include/std/bit | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index fa92b4b..b1747e8 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,4 +1,9 @@ 2018-07-04 Jonathan Wakely <jwakely@redhat.com> + Jakub Jelinek <jakub@redhat.com> + + * include/std/bit (__rotl, __rotr): Fix for non-power of two sizes. + +2018-07-04 Jonathan Wakely <jwakely@redhat.com> PR libstdc++/86398 * include/std/type_traits (is_trivially_constructible): Check diff --git a/libstdc++-v3/include/std/bit b/libstdc++-v3/include/std/bit index ace8895..a23f2ba 100644 --- a/libstdc++-v3/include/std/bit +++ b/libstdc++-v3/include/std/bit @@ -46,7 +46,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { constexpr auto _Nd = numeric_limits<_Tp>::digits; const unsigned __sN = __s % _Nd; - return (__x << __sN) | (__x >> ((-__sN) % _Nd)); + return (__x << __sN) | (__x >> ((_Nd - __sN) % _Nd)); } template<typename _Tp> @@ -55,7 +55,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { constexpr auto _Nd = numeric_limits<_Tp>::digits; const unsigned __sN = __s % _Nd; - return (__x >> __sN) | (__x << ((-__sN) % _Nd)); + return (__x >> __sN) | (__x << ((_Nd - __sN) % _Nd)); } template<typename _Tp> |