The null pointer check is never needed for correct code, only to gracefully handle undefined cases. Add __builtin_expect to be sure that we don't pessimize the valid uses. libstdc++-v3/ChangeLog: * libsupc++/dyncast.cc (__dynamic_cast): Add __builtin_expect to precondition check. Tested powerpc64le-linux. Committed to trunk.