Remove not needed __builtin_expect due to malloc predictor.

2018-08-10  Martin Liska  <mliska@suse.cz>

	* 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
This commit is contained in:
Martin Liska 2018-08-10 13:40:40 +02:00 committed by Martin Liska
parent aa40590559
commit 8b9a5b5e0e
4 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2018-08-10 Martin Liska <mliska@suse.cz>
* 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 <sebastian.huber@embedded-brains.de>
PR target/85904

View File

@ -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)

View File

@ -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)

View File

@ -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)