From: Martin Liska Date: Fri, 10 Aug 2018 11:40:40 +0000 (+0200) Subject: Remove not needed __builtin_expect due to malloc predictor. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8b9a5b5e0e1c69cd97f56c732cdb8a96c92baabe;p=gcc.git Remove not needed __builtin_expect due to malloc predictor. 2018-08-10 Martin Liska * libsupc++/new_op.cc (new): Remove __builtin_expect as malloc predictor can handle that. * libsupc++/new_opa.cc: Likewise. * libsupc++/new_opnt.cc (new): Likewise. From-SVN: r263470 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index c76324ccdd3..347c9e30532 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2018-08-10 Martin Liska + + * libsupc++/new_op.cc (new): Remove __builtin_expect as malloc + predictor can handle that. + * libsupc++/new_opa.cc: Likewise. + * libsupc++/new_opnt.cc (new): Likewise. + 2018-08-10 Sebastian Huber PR target/85904 diff --git a/libstdc++-v3/libsupc++/new_op.cc b/libstdc++-v3/libsupc++/new_op.cc index 3a1e38d9df7..3caa0bab2ea 100644 --- a/libstdc++-v3/libsupc++/new_op.cc +++ b/libstdc++-v3/libsupc++/new_op.cc @@ -47,7 +47,7 @@ operator new (std::size_t sz) _GLIBCXX_THROW (std::bad_alloc) if (sz == 0) sz = 1; - while (__builtin_expect ((p = malloc (sz)) == 0, false)) + while ((p = malloc (sz)) == 0) { new_handler handler = std::get_new_handler (); if (! handler) diff --git a/libstdc++-v3/libsupc++/new_opa.cc b/libstdc++-v3/libsupc++/new_opa.cc index 68eac5b8ceb..a27ff843ca1 100644 --- a/libstdc++-v3/libsupc++/new_opa.cc +++ b/libstdc++-v3/libsupc++/new_opa.cc @@ -126,7 +126,7 @@ operator new (std::size_t sz, std::align_val_t al) #endif using __gnu_cxx::aligned_alloc; - while (__builtin_expect ((p = aligned_alloc (align, sz)) == 0, false)) + while ((p = aligned_alloc (align, sz)) == 0) { new_handler handler = std::get_new_handler (); if (! handler) diff --git a/libstdc++-v3/libsupc++/new_opnt.cc b/libstdc++-v3/libsupc++/new_opnt.cc index a2dc33ad4d3..faab44e66c2 100644 --- a/libstdc++-v3/libsupc++/new_opnt.cc +++ b/libstdc++-v3/libsupc++/new_opnt.cc @@ -40,7 +40,7 @@ operator new (std::size_t sz, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT if (sz == 0) sz = 1; - while (__builtin_expect ((p = malloc (sz)) == 0, false)) + while ((p = malloc (sz)) == 0) { new_handler handler = std::get_new_handler (); if (! handler)