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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jonathan Gruber from comment #3)
> (In reply to Richard Biener from comment #2).
> 
> Not sure if this completely answers the question, but, as far as I know, the
> PTRDIFF_MAX request-size limit for glibc's malloc is documented behavior,
> so, provided the program links against glibc, the programmer can certainly
> rely on this behavior of glibc's malloc. So, from this perspective, GCC's
> choice to elide the malloc/free in the test case is arguably a bug.

Printf is an example where gcc also not follow documented glibc behaviors too.
That is printf("%s\n", s) will crash because uses puts there instead of printf
which will print (null).

Reply via email to