https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92765

--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #12)
> The __builtin_strcmp(ptr->header.magic, "x") call in comment #0 is undefined
> because the two-element array ptr->header.magic is not a nul-terminated
> string.  The warning was designed to point that out.

I don't agree with that view, but if you replace that first __builtin_strcmp
with say __builtin_memcmp(ptr->header.magic, "x", 2) == 0 it fails the same
way.  Plus all the other testcases in this PR.
The first call really doesn't matter, all that matters is that there is
something taking address of ptr->header.magic earlier in the function.
And a warning designed on something the GIMPLE IL does not preserve is wrong.

Reply via email to