[Bug c++/22591] [4.0 Regression] std::swap() followed by list::erase() produces incorrect list::begin()
reichelt at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Jul 22 16:40:00 GMT 2005
------- 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
More information about the Gcc-bugs
mailing list