This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/22591] [4.0 Regression] std::swap() followed by list::erase() produces incorrect list::begin()
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Jul 2005 16:40:11 -0000
- Subject: [Bug c++/22591] [4.0 Regression] std::swap() followed by list::erase() produces incorrect list::begin()
- References: <20050721155650.22591.Simon.Finn@reify.co.uk>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From reichelt at gcc dot gnu dot org 2005-07-22 16:40 -------
Just another data point:
I just compiled the testcase (without including iostream) with -O3 -c
using 4.0 branch.
If I link this with libstdc++ from the 4.0 the assertion is triggered.
If I link this with libstdc++ from the 3.4 branch or mainline,
the assert is not triggered.
The same happens, if I use -O0 instead of -O3.
nm of the object file yields:
U _Unwind_Resume
U _ZNSt15_List_node_base4hookEPS_
U _ZNSt15_List_node_base4swapERS_S0_
U _ZNSt15_List_node_base6unhookEv
00000000 d _ZZ4mainE19__PRETTY_FUNCTION__
U _ZdlPv
U _Znwj
U __assert_fail
U __gxx_personality_v0
00000000 T main
So a miscompilation of _List_node_base::swap (or ::hook or ::unhook)
in libstdc++ seems to be very likely.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |reichelt at gcc dot gnu dot
| |org
Target Milestone|--- |4.0.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22591