https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102202
--- Comment #3 from Richard Biener ---
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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102202
--- Comment #2 from Andrew Pinski ---
I wonder if we could do this expansion at the gimple level ...
Though introducing branches might not be happy for some.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102202
--- Comment #1 from Andrew Pinski ---
Likewise for memcpy:
typedef decltype(sizeof(0)) size_t;
void g(size_t a, char *d, char *e)
{
__builtin_memcpy(d, e, a&1);
}