[Bug tree-optimization/86259] [8/9 Regression] min(4, strlen(s)) optimized to strlen(s) with -flto

davmac at davmac dot org gcc-bugzilla@gcc.gnu.org
Wed Jul 11 10:47:00 GMT 2018


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

--- Comment #20 from Davin McCall <davmac at davmac dot org> ---
(In reply to Davin McCall from comment #19)
> [...] If the result of offsetof has no provenance even the long form won't
> work.

"no provenance" meaning "empty provenance", and of course this is not actually
correct; shouldn't have posted before coffee. However, if it had provenance of
the member, that would be problematic. Having provenance of the compound object
(s2') would be ok for Richard Biener's example of ((char *)&s2 + offsetof(S,
a)) but not for my extended example of determining the address of the
containing object using a pointer to a member object and offsetof.


More information about the Gcc-bugs mailing list