https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65769
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Well, guarding the UBSAN_VPTR check for non-NULL is certainly possible, but in the common case where the pointer isn't a compile time constant nor an obvious non-NULL value doing so would slow the sanitization down, and won't handle the case of just using a completely bogus, but still non-NULL pointer, anyway.