https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61294
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Happens on an isolated path where GCC optimized if (len) .... memset (p, val, len); to if (len == 0) { .... memset (p, val, 0); } else { ..... memset (p, val, len); } can happen and there is no good way around that, thus it's a false positive. It's the if (grid->Points) check that is false when the compiler can compute the 'len' parameter will be zero. Maybe that helps you deciding whether it really is a false positive or not (well, yes, whether you are calling memset with len == 0, which might be valid, but we warn about it).