re PR libstdc++/52241 (Performance degradation of 447.dealII on corei7 at spec2006_base32.)

2012-02-20  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/52241
	* src/c++98/tree.cc (local_Rb_tree_increment,
	local_Rb_tree_decrement): Add.
	(_Rb_tree_increment(const _Rb_tree_node_base*),
	_Rb_tree_decrement(const _Rb_tree_node_base*)): Use the latter.
	(_Rb_tree_increment(_Rb_tree_node_base*),
	_Rb_tree_decrement(_Rb_tree_node_base*)): New.

From-SVN: r184404
This commit is contained in:
Paolo Carlini 2012-02-20 21:08:48 +00:00 committed by Paolo Carlini
parent 63b08143d6
commit d6f90f03e0
2 changed files with 29 additions and 7 deletions

View File

@ -1,3 +1,13 @@
2012-02-20 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/52241
* src/c++98/tree.cc (local_Rb_tree_increment,
local_Rb_tree_decrement): Add.
(_Rb_tree_increment(const _Rb_tree_node_base*),
_Rb_tree_decrement(const _Rb_tree_node_base*)): Use the latter.
(_Rb_tree_increment(_Rb_tree_node_base*),
_Rb_tree_decrement(_Rb_tree_node_base*)): New.
2012-02-20 Paolo Carlini <paolo.carlini@oracle.com> 2012-02-20 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/52309 PR libstdc++/52309

View File

@ -1,6 +1,6 @@
// RB tree utilities implementation -*- C++ -*- // RB tree utilities implementation -*- C++ -*-
// Copyright (C) 2003, 2005, 2009 Free Software Foundation, Inc. // Copyright (C) 2003, 2005, 2009, 2012 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
@ -56,8 +56,8 @@ namespace std _GLIBCXX_VISIBILITY(default)
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_VERSION
_Rb_tree_node_base* static _Rb_tree_node_base*
_Rb_tree_increment(_Rb_tree_node_base* __x) throw () local_Rb_tree_increment(_Rb_tree_node_base* __x) throw ()
{ {
if (__x->_M_right != 0) if (__x->_M_right != 0)
{ {
@ -79,14 +79,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return __x; return __x;
} }
_Rb_tree_node_base*
_Rb_tree_increment(_Rb_tree_node_base* __x) throw ()
{
return local_Rb_tree_increment(__x);
}
const _Rb_tree_node_base* const _Rb_tree_node_base*
_Rb_tree_increment(const _Rb_tree_node_base* __x) throw () _Rb_tree_increment(const _Rb_tree_node_base* __x) throw ()
{ {
return _Rb_tree_increment(const_cast<_Rb_tree_node_base*>(__x)); return local_Rb_tree_increment(const_cast<_Rb_tree_node_base*>(__x));
} }
_Rb_tree_node_base* static _Rb_tree_node_base*
_Rb_tree_decrement(_Rb_tree_node_base* __x) throw () local_Rb_tree_decrement(_Rb_tree_node_base* __x) throw ()
{ {
if (__x->_M_color == _S_red if (__x->_M_color == _S_red
&& __x->_M_parent->_M_parent == __x) && __x->_M_parent->_M_parent == __x)
@ -111,10 +117,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return __x; return __x;
} }
_Rb_tree_node_base*
_Rb_tree_decrement(_Rb_tree_node_base* __x) throw ()
{
return local_Rb_tree_decrement(__x);
}
const _Rb_tree_node_base* const _Rb_tree_node_base*
_Rb_tree_decrement(const _Rb_tree_node_base* __x) throw () _Rb_tree_decrement(const _Rb_tree_node_base* __x) throw ()
{ {
return _Rb_tree_decrement(const_cast<_Rb_tree_node_base*>(__x)); return local_Rb_tree_decrement(const_cast<_Rb_tree_node_base*>(__x));
} }
static void static void