https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102382
--- Comment #5 from rguenther at suse dot de <rguenther at suse dot de> --- On Fri, 17 Sep 2021, jakub at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102382 > > --- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- > Not to mention, for calloc like the above where size is non-constant, it > wouldn't know how many there are (it would need some magic for all). > Anyway, even constant number of 0s at the end of string > 1 wouldn't really > fit > well into the way how string lengths are invalidated... Fair enough - the main isse with this PR is the failure to elide the strlen () though when the store is a vector store. Btw, DSE would remove the earlier store but obviously we can't prune parts of the zeroing from calloc (we could split it into malloc + memset maybe). redundant store elimination in FRE/DOM is what elides later stores but those are not set up to pick up the zero from calloc even ...