]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
array (at): Do not use builtin_expect.
authorJan Hubicka <jh@suse.cz>
Fri, 24 Apr 2009 09:35:19 +0000 (11:35 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 24 Apr 2009 09:35:19 +0000 (09:35 +0000)
* include/tr1_impl/array (at): Do not use builtin_expect.
* include/ext/throw_allocator.h (allocate): Likewise.
* include/ext/pool_allocator.h (allocate): Likweise.
* include/ext/bitmap_allocator.h (allocate): Likewise.
* include/ext/rc_string_base.h (_S_construct): Likewise.
* include/ext/malloc_allocator.h (allocate): Likewise.
* include/ext/mt_allocator.h (allocate): Likewise.
* include/ext/sso_string_base.h (_M_construct): Likewise.
* include/bits/basic_string.tcc (_S_construct): Likewise.

From-SVN: r146681

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/basic_string.tcc
libstdc++-v3/include/ext/bitmap_allocator.h
libstdc++-v3/include/ext/malloc_allocator.h
libstdc++-v3/include/ext/mt_allocator.h
libstdc++-v3/include/ext/new_allocator.h
libstdc++-v3/include/ext/pool_allocator.h
libstdc++-v3/include/ext/rc_string_base.h
libstdc++-v3/include/ext/sso_string_base.h
libstdc++-v3/include/ext/throw_allocator.h
libstdc++-v3/include/tr1_impl/array

index b1695d7edaadf4b8e2ae3d67a0fcb23bd91a8245..a3901bc54581dfdcb7ee5c712e13a8aeda61c40b 100644 (file)
@@ -1,3 +1,15 @@
+2009-04-22  Jan Hubicka  <jh@suse.cz>
+
+       * include/tr1_impl/array (at): Do not use builtin_expect.
+       * include/ext/throw_allocator.h (allocate): Likewise.
+       * include/ext/pool_allocator.h (allocate): Likweise.
+       * include/ext/bitmap_allocator.h (allocate): Likewise.
+       * include/ext/rc_string_base.h (_S_construct): Likewise.
+       * include/ext/malloc_allocator.h (allocate): Likewise.
+       * include/ext/mt_allocator.h (allocate): Likewise.
+       * include/ext/sso_string_base.h (_M_construct): Likewise.
+       * include/bits/basic_string.tcc (_S_construct): Likewise.
+
 2009-04-22  Jan Hubicka  <jh@suse.cz>
 
        * include/c_std/cstdlib (abort, exit, _Exit): Mark noreturn throw ().
index a5553c61a1b16dc154840c817d50b509456d6eb8..ec771c66859f7846672e9cc44ef9c2816f79f415 100644 (file)
@@ -129,8 +129,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
          return _S_empty_rep()._M_refdata();
 #endif
        // NB: Not required, but considered best practice.
-       if (__builtin_expect(__gnu_cxx::__is_null_pointer(__beg)
-                            && __beg != __end, 0))
+       if (__gnu_cxx::__is_null_pointer(__beg) && __beg != __end)
          __throw_logic_error(__N("basic_string::_S_construct NULL not valid"));
 
        const size_type __dnew = static_cast<size_type>(std::distance(__beg,
index e5bfa18ec5b26e21006cca3528dc1cf420a40ae6..f6790d00043420dc644ba7c5e79cb107a58ab3b0 100644 (file)
@@ -1049,7 +1049,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
       pointer 
       allocate(size_type __n)
       {
-       if (__builtin_expect(__n > this->max_size(), false))
+       if (__n > this->max_size())
          std::__throw_bad_alloc();
 
        if (__builtin_expect(__n == 1, true))
index 4c4a72a171c401611fc98d35f4485d39438d7480..b432c63a61eaf9189316908ac312874f2ac1b723 100644 (file)
@@ -84,7 +84,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
       pointer
       allocate(size_type __n, const void* = 0)
       {
-       if (__builtin_expect(__n > this->max_size(), false))
+       if (__n > this->max_size())
          std::__throw_bad_alloc();
 
        pointer __ret = static_cast<_Tp*>(std::malloc(__n * sizeof(_Tp)));
index fc31fe8a737af1a60f783e5863f37ca1771fb144..e44b98d4bf700a34b52883d185b8ff0756141188 100644 (file)
@@ -674,7 +674,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
     __mt_alloc<_Tp, _Poolp>::
     allocate(size_type __n, const void*)
     {
-      if (__builtin_expect(__n > this->max_size(), false))
+      if (__n > this->max_size())
        std::__throw_bad_alloc();
 
       __policy_type::_S_initialize_once();
index 290c73a11c2a7f70ef5c8e97e69c2d768dc1a404..51666c3c7fdef062ea1744c9490a5c9eb9a0c942 100644 (file)
@@ -83,7 +83,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
       pointer
       allocate(size_type __n, const void* = 0)
       { 
-       if (__builtin_expect(__n > this->max_size(), false))
+       if (__n > this->max_size())
          std::__throw_bad_alloc();
 
        return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
index d7077b1986b69fbdab7c7ad783b91527d8961a8d..b1e61841c0a74116ce3a3574facfd310fcabf30d 100644 (file)
@@ -200,7 +200,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
       pointer __ret = 0;
       if (__builtin_expect(__n != 0, true))
        {
-         if (__builtin_expect(__n > this->max_size(), false))
+         if (__n > this->max_size())
            std::__throw_bad_alloc();
 
          // If there is a race through here, assume answer from getenv
@@ -230,7 +230,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
                  *__free_list = __result->_M_free_list_link;
                  __ret = reinterpret_cast<_Tp*>(__result);
                }
-             if (__builtin_expect(__ret == 0, 0))
+             if (__ret == 0)
                std::__throw_bad_alloc();
            }
        }
index dce5e06710c42ff7fe512ffe64df4f69f0fb6c63..6d8c430d57503e718a0958fea04cadb291c7baab 100644 (file)
@@ -546,7 +546,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
          return _S_empty_rep._M_refcopy();
 
        // NB: Not required, but considered best practice.
-       if (__builtin_expect(__is_null_pointer(__beg) && __beg != __end, 0))
+       if (__is_null_pointer(__beg) && __beg != __end)
          std::__throw_logic_error(__N("__rc_string_base::"
                                       "_S_construct NULL not valid"));
 
index 85a0d7c9b18070dd3b5ee7bef44394da6642e081..6d2af7c46dd658f223546b3ba6ac37f84e99d7d5 100644 (file)
@@ -428,7 +428,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
                   std::forward_iterator_tag)
       {
        // NB: Not required, but considered best practice.
-       if (__builtin_expect(__is_null_pointer(__beg) && __beg != __end, 0))
+       if (__is_null_pointer(__beg) && __beg != __end)
          std::__throw_logic_error(__N("__sso_string_base::"
                                       "_M_construct NULL not valid"));
 
index c87408fd93118e5beaecb9014f5298e2054f1f15..1303054694352722f7f5a3f1d8df4954d1f86717 100644 (file)
@@ -220,7 +220,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
       pointer
       allocate(size_type __n, std::allocator<void>::const_pointer hint = 0)
       {
-       if (__builtin_expect(__n > this->max_size(), false))
+       if (__n > this->max_size())
          std::__throw_bad_alloc();
 
        throw_conditionally();
index c0bd24076fa2a7036c97009d544d13142a87b95f..7cd3db3d0f904b1bc18dd7a03d73859bf2867a50 100644 (file)
@@ -149,7 +149,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
       reference
       at(size_type __n)
       {
-       if (__builtin_expect(__n >= _Nm, false))
+       if (__n >= _Nm)
          std::__throw_out_of_range(__N("array::at"));
        return _M_instance[__n];
       }
@@ -157,7 +157,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
       const_reference
       at(size_type __n) const
       {
-       if (__builtin_expect(__n >= _Nm, false))
+       if (__n >= _Nm)
          std::__throw_out_of_range(__N("array::at"));
        return _M_instance[__n];
       }