https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79578
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- Since the check comes from the front-end, and the DR says it's not needed, maybe this belongs to component c++ not tree-optimization. If the front-end didn't insert the check we wouldn't need to optimize it away.