public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-4843] libstdc++: Remove redundant check for zero in std::__popcount
@ 2020-11-09 14:54 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2020-11-09 14:54 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:ff4bfb1553cf525d7299bbf7451ac32cfd97ae1b

commit r11-4843-gff4bfb1553cf525d7299bbf7451ac32cfd97ae1b
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Nov 9 14:31:13 2020 +0000

    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:
---
 libstdc++-v3/include/std/bit | 3 ---
 1 file changed, 3 deletions(-)

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<unsigned long long>::__digits;
       constexpr auto _Nd_ul = __int_traits<unsigned long>::__digits;
       constexpr auto _Nd_u = __int_traits<unsigned>::__digits;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-09 14:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-09 14:54 [gcc r11-4843] libstdc++: Remove redundant check for zero in std::__popcount Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).