This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3, libstdcxx_so_7] Fix libstdc++/16896 & bump to 7.0.0


Hi,

the below fixes in the branch the PR. Took the occasion to bump the
version to 7.0.0 in the branch.

Tested x86-linux.

Paolo.

////////////////
2004-08-24  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/16896
	* include/bits/stl_list.h (struct _List_node_base): Rename the
	transfer member to _M_transfer, hook to _M_hook, and unhook to
	_M_unhook.
	* include/bits/list.tcc (list<>::insert): Tweak consistently.
	* src/list.cc: Change consistently.
	* config/linker-map.gnu: Likewise.	
	* testsuite/23_containers/list/16896.cc: New.

	* include/bits/stl_list.h: Trivial formatting fixes.

	* config/linker-map.gnu: Move everything in GLIBCXX_3.4, 3.4.1
	and 3.4.2 under GLIBCXX_3.6.
	* testsuite/testsuite_abi.cc: Add GLIBCXX_3.6.
	* configure.ac (libtool_VERSION): Bump to 7:0:0.
	* configure: Regenerate.
diff -urN libstdc++-v3-orig/config/linker-map.gnu libstdc++-v3/config/linker-map.gnu
--- libstdc++-v3-orig/config/linker-map.gnu	2004-07-08 07:24:33.000000000 +0200
+++ libstdc++-v3/config/linker-map.gnu	2004-08-24 18:06:21.000000000 +0200
@@ -20,7 +20,7 @@
 ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 ## USA.
 
-GLIBCXX_3.4 {
+GLIBCXX_3.6 {
 
   global:
 
@@ -55,11 +55,13 @@
       std::locale::_S_normalize_category*;
       std::locale::_[T-Za-z]*;
       std::[A-Zm-z]*;
-      std::_List_node_base::hook*;
       std::_List_node_base::swap*;
-      std::_List_node_base::unhook*;
       std::_List_node_base::reverse*;
-      std::_List_node_base::transfer*;
+
+      # Changed in libstdcxx_so_7-branch
+      std::_List_node_base::_M_transfer*;
+      std::_List_node_base::_M_hook*;
+      std::_List_node_base::_M_unhook*;
       std::__throw_*;
       std::__timepunct*;
       std::__numeric_limits_base*;
@@ -73,11 +75,13 @@
       __gnu_debug::_Safe_iterator_base*;
       __gnu_debug::_Safe_sequence_base*;
       __gnu_debug::_Error_formatter*;
-      __gnu_norm::_List_node_base::hook*;
       __gnu_norm::_List_node_base::swap*;
-      __gnu_norm::_List_node_base::unhook*;
       __gnu_norm::_List_node_base::reverse*;
-      __gnu_norm::_List_node_base::transfer*
+
+      # Changed in libstdcxx_so_7-branch
+      __gnu_norm::_List_node_base::_M_transfer*;
+      __gnu_norm::_List_node_base::_M_hook*;
+      __gnu_norm::_List_node_base::_M_unhook*;
     };
 
     # Names not in an 'extern' block are mangled names.
@@ -239,27 +243,21 @@
     _ZN9__gnu_cxx12__atomic_add*;
     _ZN9__gnu_cxx18__exchange_and_add*;
 
-  # DO NOT DELETE THIS LINE.  Port-specific symbols, if any, will be here.
-
-  local:
-    *;
-};
-
-GLIBCXX_3.4.1 {
- 
+    # In GLIBCXX_3.4.1
     _ZNSt12__basic_fileIcE4fileEv;
- 
-} GLIBCXX_3.4;
- 
-GLIBCXX_3.4.2 {
 
+    # In GLIBCXX_3.4.2
     _ZN9__gnu_cxx18stdio_sync_filebufI[cw]St11char_traitsI[cw]EE4fileEv;
 
     _ZN9__gnu_cxx11__pool_base9_M_refillE[jm];
     _ZN9__gnu_cxx11__pool_base16_M_get_free_listE[jm];
     _ZN9__gnu_cxx11__pool_base12_M_get_mutexEv;
 
-} GLIBCXX_3.4.1;
+  # DO NOT DELETE THIS LINE.  Port-specific symbols, if any, will be here.
+
+  local:
+    *;
+};
 
 # Symbols in the support library (libsupc++) have their own tag.
 CXXABI_1.3 {
diff -urN libstdc++-v3-orig/configure.ac libstdc++-v3/configure.ac
--- libstdc++-v3-orig/configure.ac	2004-08-23 12:18:27.000000000 +0200
+++ libstdc++-v3/configure.ac	2004-08-24 17:40:06.000000000 +0200
@@ -13,7 +13,7 @@
 ### am handles this now?  ORIGINAL_LD_FOR_MULTILIBS=$LD
 
 # For libtool versioning info, format is CURRENT:REVISION:AGE
-libtool_VERSION=6:2:0
+libtool_VERSION=7:0:0
 AC_SUBST(libtool_VERSION)
 
 # Find the rest of the source tree framework.
diff -urN libstdc++-v3-orig/include/bits/list.tcc libstdc++-v3/include/bits/list.tcc
--- libstdc++-v3-orig/include/bits/list.tcc	2004-08-03 12:11:31.000000000 +0200
+++ libstdc++-v3/include/bits/list.tcc	2004-08-24 18:32:07.000000000 +0200
@@ -85,7 +85,7 @@
     insert(iterator __position, const value_type& __x)
     {
       _Node* __tmp = _M_create_node(__x);
-      __tmp->hook(__position._M_node);
+      __tmp->_M_hook(__position._M_node);
       return __tmp;
     }
 
diff -urN libstdc++-v3-orig/include/bits/stl_list.h libstdc++-v3/include/bits/stl_list.h
--- libstdc++-v3-orig/include/bits/stl_list.h	2004-08-02 06:40:13.000000000 +0200
+++ libstdc++-v3/include/bits/stl_list.h	2004-08-24 17:05:36.000000000 +0200
@@ -80,17 +80,17 @@
     swap(_List_node_base& __x, _List_node_base& __y);
 
     void
-    transfer(_List_node_base * const __first,
-	     _List_node_base * const __last);
+    reverse();
 
     void
-    reverse();
+    _M_transfer(_List_node_base* const __first,
+		_List_node_base* const __last);
 
     void
-    hook(_List_node_base * const __position);
+    _M_hook(_List_node_base* const __position);
 
     void
-    unhook();
+    _M_unhook();
   };
 
   /// @if maint An actual node in the %list.  @endif
@@ -888,7 +888,7 @@
        */
       void
       swap(list& __x)
-      { _List_node_base::swap(this->_M_impl._M_node,__x._M_impl._M_node); }
+      { _List_node_base::swap(this->_M_impl._M_node, __x._M_impl._M_node); }
 
       /**
        *  Erases all the elements.  Note that this function only erases
@@ -1115,7 +1115,7 @@
 			   _InputIterator __first, _InputIterator __last,
 			   __false_type)
         {
-	  for ( ; __first != __last; ++__first)
+	  for (; __first != __last; ++__first)
 	    _M_insert(__pos, *__first);
 	}
 
@@ -1124,7 +1124,7 @@
       void
       _M_fill_insert(iterator __pos, size_type __n, const value_type& __x)
       {
-	for ( ; __n > 0; --__n)
+	for (; __n > 0; --__n)
 	  _M_insert(__pos, __x);
       }
 
@@ -1132,21 +1132,21 @@
       // Moves the elements from [first,last) before position.
       void
       _M_transfer(iterator __position, iterator __first, iterator __last)
-      { __position._M_node->transfer(__first._M_node,__last._M_node); }
+      { __position._M_node->_M_transfer(__first._M_node, __last._M_node); }
 
       // Inserts new element at position given and with value given.
       void
       _M_insert(iterator __position, const value_type& __x)
       {
         _Node* __tmp = _M_create_node(__x);
-        __tmp->hook(__position._M_node);
+        __tmp->_M_hook(__position._M_node);
       }
 
       // Erases element at position given.
       void
       _M_erase(iterator __position)
       {
-        __position._M_node->unhook();
+        __position._M_node->_M_unhook();
         _Node* __n = static_cast<_Node*>(__position._M_node);
         this->get_allocator().destroy(&__n->_M_data);
         _M_put_node(__n);
@@ -1165,9 +1165,9 @@
   */
   template<typename _Tp, typename _Alloc>
     inline bool
-    operator==(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y)
+    operator==(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
     {
-      typedef typename list<_Tp,_Alloc>::const_iterator const_iterator;
+      typedef typename list<_Tp, _Alloc>::const_iterator const_iterator;
       const_iterator __end1 = __x.end();
       const_iterator __end2 = __y.end();
 
@@ -1194,32 +1194,32 @@
   */
   template<typename _Tp, typename _Alloc>
     inline bool
-    operator<(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y)
+    operator<(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
     { return std::lexicographical_compare(__x.begin(), __x.end(),
 					  __y.begin(), __y.end()); }
 
   /// Based on operator==
   template<typename _Tp, typename _Alloc>
     inline bool
-    operator!=(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y)
+    operator!=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
     { return !(__x == __y); }
 
   /// Based on operator<
   template<typename _Tp, typename _Alloc>
     inline bool
-    operator>(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y)
+    operator>(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
     { return __y < __x; }
 
   /// Based on operator<
   template<typename _Tp, typename _Alloc>
     inline bool
-    operator<=(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y)
+    operator<=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
     { return !(__y < __x); }
 
   /// Based on operator<
   template<typename _Tp, typename _Alloc>
     inline bool
-    operator>=(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y)
+    operator>=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
     { return !(__x < __y); }
 
   /// See std::list::swap().
diff -urN libstdc++-v3-orig/src/list.cc libstdc++-v3/src/list.cc
--- libstdc++-v3-orig/src/list.cc	2004-04-16 21:04:05.000000000 +0200
+++ libstdc++-v3/src/list.cc	2004-08-24 17:23:00.000000000 +0200
@@ -1,6 +1,6 @@
 // std::list utilities implementation -*- C++ -*-
 
-// Copyright (C) 2003 Free Software Foundation, Inc.
+// Copyright (C) 2003, 2004 Free Software Foundation, Inc.
 //
 // 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
@@ -90,8 +90,20 @@
   }
 
   void
-  _List_node_base::transfer(_List_node_base * const __first,
-                            _List_node_base * const __last)
+  _List_node_base::reverse()
+  {
+    _List_node_base* __tmp = this;
+    do
+    {
+      std::swap(__tmp->_M_next, __tmp->_M_prev);
+      __tmp = __tmp->_M_prev;     // Old next node is now prev.
+    } 
+    while (__tmp != this);
+  }
+
+  void
+  _List_node_base::_M_transfer(_List_node_base* const __first,
+			       _List_node_base* const __last)
   {
     if (this != __last)
     {
@@ -109,19 +121,7 @@
   }
 
   void
-  _List_node_base::reverse()
-  {
-    _List_node_base* __tmp = this;
-    do
-    {
-      std::swap(__tmp->_M_next, __tmp->_M_prev);
-      __tmp = __tmp->_M_prev;     // Old next node is now prev.
-    } 
-    while (__tmp != this);
-  }
-
-  void
-  _List_node_base::hook(_List_node_base* const __position)
+  _List_node_base::_M_hook(_List_node_base* const __position)
   {
     this->_M_next = __position;
     this->_M_prev = __position->_M_prev;
@@ -130,7 +130,7 @@
   }
 
   void
-  _List_node_base::unhook()
+  _List_node_base::_M_unhook()
   {
     _List_node_base* const __next_node = this->_M_next;
     _List_node_base* const __prev_node = this->_M_prev;
diff -urN libstdc++-v3-orig/testsuite/23_containers/list/16896.cc libstdc++-v3/testsuite/23_containers/list/16896.cc
--- libstdc++-v3-orig/testsuite/23_containers/list/16896.cc	1970-01-01 01:00:00.000000000 +0100
+++ libstdc++-v3/testsuite/23_containers/list/16896.cc	2004-08-24 17:15:30.000000000 +0200
@@ -0,0 +1,41 @@
+// Copyright (C) 2004 Free Software Foundation, Inc.
+//
+// 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction.  Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License.  This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#define transfer 1
+#define hook 2
+#define unhook 3
+
+#include <testsuite_hooks.h>
+#include <list>
+
+// { dg-do compile }
+
+// libstdc++/16896
+int main()
+{
+  return 0;
+}
diff -urN libstdc++-v3-orig/testsuite/testsuite_abi.cc libstdc++-v3/testsuite/testsuite_abi.cc
--- libstdc++-v3-orig/testsuite/testsuite_abi.cc	2004-07-08 07:24:33.000000000 +0200
+++ libstdc++-v3/testsuite/testsuite_abi.cc	2004-08-24 18:06:39.000000000 +0200
@@ -164,6 +164,7 @@
       known_versions.push_back("GLIBCXX_3.4");
       known_versions.push_back("GLIBCXX_3.4.1");
       known_versions.push_back("GLIBCXX_3.4.2");
+      known_versions.push_back("GLIBCXX_3.6");
       known_versions.push_back("CXXABI_1.2");
       known_versions.push_back("CXXABI_1.2.1");
       known_versions.push_back("CXXABI_1.3");

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]