This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/64504] Invalid free() with _GLIBCXX_DEBUG and -fwhole-program
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 26 Jan 2015 10:56:03 +0000
- Subject: [Bug libstdc++/64504] Invalid free() with _GLIBCXX_DEBUG and -fwhole-program
- Auto-submitted: auto-generated
- References: <bug-64504-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64504
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hubicka at gcc dot gnu.org
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Looks like _S_empty_rep_storage is tested like
if (ptr != &_S_empty_rep_storage)
in libstdc++ and thus having multiple _S_empty_rep_storage instantiations is
going to break.
Honza - how was -fwhole-program (and LTO?!) designed to deal with C++ ODR
rules? With -fno-linker-plugin, that is?
To others:
-fwhole-program basically assumes that all defined symbols can be brought
local to the unit (apart from main()). Seems like this includes instantiated
templates which means that we assume there is only a single TU and thus ODR
violations never arise from that.