[Bug c++/60750] [4.8/4.9 Regression] double free after std::move on string inside throw when compiled with optimization
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Apr 4 11:37:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60750
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
For some reason thrower() is pure(!?) (no vdef) and thus FRE maybe does some
invalid transform. Oh.
/* A 'pure' or a 'const' function never call-clobbers anything.
A 'noreturn' function might, but since we don't return anyway
there is no point in recording that. */
if (!(call_flags & (ECF_PURE | ECF_CONST | ECF_NORETURN)))
add_virtual_operand (fn, stmt, opf_def);
that's of course "true", but only if the function doesn't return otherwise
(like via EH):
# VUSE <.MEM_11>
thrower (&D.20915);
;; succ: 5 (EH)
it doesn't save us much when we remove that optimization (we "save" a
VDEF), but I can imagine other analyses being confused about this because
generally "no VDEF" -> doesn't store.
More information about the Gcc-bugs
mailing list