https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105727
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I must be missing something, but it looks to me like a kasan kernel bug memset(info, 0, sizeof(struct sysinfo)); most likely doesn't have size 1, 2, 4, 8 or 16 but it is still a constant size memset calls if (!kasan_check_range((unsigned long)addr, len, true, _RET_IP_)) that calls return check_region_inline(addr, size, write, ret_ip); in check_region_inline I don't see any effort to take a different path for sizes other than 1/2/4/8/16, then it calls if (likely(!memory_is_poisoned(addr, size))) and that function emits BUILD_BUG if size is constant and not 1/2/4/8/16 What just surprises me is that it doesn't hit much more often, there will be many memset calls with constant size that is not 1/2/4/8/16. Sure, we might not inline or ipa cp/vrp all of them...