[Bug target/102202] Inefficent expansion of memset when range is [0,1]

2021-09-06 Thread rguenth at gcc dot gnu.org via Gcc-bugs
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

[Bug target/102202] Inefficent expansion of memset when range is [0,1]

2021-09-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
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.

[Bug target/102202] Inefficent expansion of memset when range is [0,1]

2021-09-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
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); }