aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2018-08-10 13:40:40 +0200
committerMartin Liska <marxin@gcc.gnu.org>2018-08-10 11:40:40 +0000
commit8b9a5b5e0e1c69cd97f56c732cdb8a96c92baabe (patch)
tree0cb0dfc849273125d64fdbf1605be514baeddefe
parentaa40590559358fb59326f6adaed65db709061640 (diff)
downloadgcc-8b9a5b5e0e1c69cd97f56c732cdb8a96c92baabe.zip
gcc-8b9a5b5e0e1c69cd97f56c732cdb8a96c92baabe.tar.gz
gcc-8b9a5b5e0e1c69cd97f56c732cdb8a96c92baabe.tar.bz2
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
-rw-r--r--libstdc++-v3/ChangeLog7
-rw-r--r--libstdc++-v3/libsupc++/new_op.cc2
-rw-r--r--libstdc++-v3/libsupc++/new_opa.cc2
-rw-r--r--libstdc++-v3/libsupc++/new_opnt.cc2
4 files changed, 10 insertions, 3 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index c76324c..347c9e3 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -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
diff --git a/libstdc++-v3/libsupc++/new_op.cc b/libstdc++-v3/libsupc++/new_op.cc
index 3a1e38d..3caa0ba 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 68eac5b..a27ff84 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 a2dc33a..faab44e 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)