From: Jonathan Wakely Date: Mon, 9 Nov 2020 14:31:13 +0000 (+0000) Subject: libstdc++: Remove redundant check for zero in std::__popcount X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ff4bfb1553cf525d7299bbf7451ac32cfd97ae1b;p=gcc.git libstdc++: Remove redundant check for zero in std::__popcount The popcount built-ins work fine for zero, so there's no need to check for it. libstdc++-v3/ChangeLog: * include/std/bit (__popcount): Remove redundant check for zero. --- diff --git a/libstdc++-v3/include/std/bit b/libstdc++-v3/include/std/bit index f4344820d52..16f7eba46d7 100644 --- a/libstdc++-v3/include/std/bit +++ b/libstdc++-v3/include/std/bit @@ -184,9 +184,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION using __gnu_cxx::__int_traits; constexpr auto _Nd = __int_traits<_Tp>::__digits; - if (__x == 0) - return 0; - constexpr auto _Nd_ull = __int_traits::__digits; constexpr auto _Nd_ul = __int_traits::__digits; constexpr auto _Nd_u = __int_traits::__digits;