https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70147
--- Comment #29 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Jason Merrill from comment #27) > (In reply to Bernd Edlinger from comment #26) > > I just fail to understand why we cannot just clobber the whole > > object once in the in-charge constructor, > > then if sanitizing vptrs initialize every vptr once to zero. > > and skip all the clobber and vptr initializing on the > > not in-charge constructors. > > That sounds fine, for classes with virtual bases. It depends on the clobbers. If you conditionalize all ctor clobbers on __in_chrg (always, or only for -fsanitize=vptr?), then the -fsanitize=vptr initialization can be guarded the same. If you do it only for a subset e.g. only if there are empty primary virtual bases, then -fsanitize=vptr should match that too, otherwise DSE will happily remove the earlier -fsanitize=vptr NULL stores. Jason, shall I reassign this PR to you?