https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65610
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Mon Mar 30 21:56:02 2015 New Revision: 221781 URL: https://gcc.gnu.org/viewcvs?rev=221781&root=gcc&view=rev Log: PR ipa/65610 * ipa-utils.h (inlined_polymorphic_ctor_dtor_block_p): Declare. * ipa-polymorphic-call.c (inlined_polymorphic_ctor_dtor_block_p): New function. (decl_maybe_in_construction_p, noncall_stmt_may_be_vtbl_ptr_store): Use it. * ipa-prop.c (param_type_may_change_p): Likewise. * tree-ssa-live.c: Include ipa-utils.h and its dependencies. (remove_unused_scope_block_p): Add in_ctor_dtor_block argument. Before inlining, preserve inlined_polymorphic_ctor_dtor_block_p blocks and the outermost block with FUNCTION_DECL BLOCK_ABSTRACT_ORIGIN inside of them. Adjust recursive calls. (remove_unused_locals): Adjust remove_unused_scope_block_p caller. * g++.dg/ubsan/pr65610.C: New test. Added: trunk/gcc/testsuite/g++.dg/ubsan/pr65610.C Modified: trunk/gcc/ChangeLog trunk/gcc/ipa-polymorphic-call.c trunk/gcc/ipa-prop.c trunk/gcc/ipa-utils.h trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-live.c