https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114113
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- I bet we thread the p[n] == 0 case because of the later loop i < n condition. Consider when p[0] == 0, the code would then call malloc (0).