https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102202
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- We do have machinery (from profiling) to pass along min/max size which we already use, so I wonder if we should use those bounds in more cases. Of course memset (..., [0, 1]) could be constant folded on GIMPLE into a branch as you say. Eventually tree-call-dce.c is a good place to do so (the memset is conditionally dead after all...)