[Bug middle-end/89337] Bogus "exceeds maximum object size" on unreachable code

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Feb 19 03:22:00 GMT 2019


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.


More information about the Gcc-bugs mailing list