https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89337
--- Comment #12 from Martin Sebor <msebor at gcc dot gnu.org> --- One of the approaches we have been discussing is replacing these invalid calls with __builtin_trap or __builtin_unreachable, perhaps optionally preceded by __builtin_warning ("specified size exceeds maximum object size") which would be issued if the code wasn't eliminated. Command line options controlling the choices would be provided. This would work in some cases but probably not those where the invalid value ends up constant-propagated after the new statement has been introduced. It's something to investigate/prototype for GCC 10.