[Bug tree-optimization/92893] [10 Regression] Unhelpful -Wstringop-overflow warning for a trailing one-element array

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Apr 18 17:52:41 GMT 2020


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

--- Comment #7 from Martin Sebor <msebor at gcc dot gnu.org> ---
(In reply to Jeffrey A. Law from comment #6)
> Isn't this ultimately a case of relying on the type information from that
> MEM expression in a place where it's not valid?

Yes, as I mentioned in comment #1, it's by design (which could stand to
improve).  I rewritten the whole function (compute_objsize) to deal with this
and a number of other problems due to the limitations of
compute_builtin_object_size (constant sizes, no ranges) that it relies on but
the changes are more intrusive than I feel comfortable for GCC 10.


More information about the Gcc-bugs mailing list