https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70147
--- Comment #18 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Bernd Edlinger from comment #17) > > As the compromise I meant this instead (incremental patch). > > Though, in that case the -flifetime-dse=2 clobbers are also wrong in the > > subobject ctors, because they should not overlap the vtable pointers of the > > virtual bases if we rely on them from the caller, otherwise when those are > > inlined could be DSEd, even when we actually rely on them. > > However that sounds more or less like a P1-BUG ! > > If the virtual base has already initialized the base object, > maybe it has put it into a linked list, or so all that code will > silently be removed again, and the list would be left in an > inconsistent state. > > Do you see a way, how to conditionalize the clobber on the in_charge? Very easily, by wrapping the CLOBBER into an conditional testing current_in_charge_parm if that is non-NULL or something similar. Or by using a different CLOBBER for the subobject ctors (e.g. one that does clobber just the data fields and not the vtable pointers in there, whatever).