[Bug target/115404] [15 Regression] possibly wrong code on glibc-2.39 since r15-1113-gde05e44b2ad963
ubizjak at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Jun 10 06:07:19 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115404
--- Comment #3 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Sergei Trofimovich from comment #0)
> if (__builtin_add_overflow ((uintptr_t) string, maxlen, &end))
> end = -1;
>
> Could it be that dead store to `&end` somehow conflicts with a following
> `end = -1`?
FYI, this is not dead store, the two lines above are exactly what middle-end
now transforms to a .SAT_ADD. The function returns -1 (AKA INT_MAX) when
addition overflows.
More information about the Gcc-bugs
mailing list