https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63164
--- Comment #18 from Thomas de Bock <tdebock at DRWUK dot com> --- (In reply to Jason Merrill from comment #17) > As I commented at > > https://inbox.sourceware.org/gcc-patches/75ff8af8-af03-42fa-b68b- > e6c16a34c...@redhat.com/ > > we could optimize the dynamic_cast to type_info::operator== instead of > vtable comparison. I agree having dynamic_cast be optimized to type_info::operator== when it can (and when optimizations are enabled) would be good. Like I said though I also think having an optimal optimization that just checks vtables ptrs is important to have available behind some compiler flags as well.