https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80769
--- Comment #3 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> --- Author: rsandifo Date: Tue Aug 1 12:22:03 2017 New Revision: 250772 URL: https://gcc.gnu.org/viewcvs?rev=250772&root=gcc&view=rev Log: Backport fix for PR 80769 2017-08-01 Richard Sandiford <richard.sandif...@linaro.org> gcc/ PR tree-optimization/80769 * tree-ssa-strlen.c (strinfo): Document that "stmt" is also used for malloc and calloc. Document the new invariant that all related strinfos have delayed lengths or none do. (get_next_strinfo): New function. (verify_related_strinfos): Move earlier in file. (set_endptr_and_length): New function, split out from... (get_string_length): ...here. Also set the lengths of related strinfos. gcc/testsuite/ PR tree-optimization/80769 * gcc.dg/strlenopt-31.c: New test. * gcc.dg/strlenopt-31g.c: Likewise. Added: branches/gcc-7-branch/gcc/testsuite/gcc.dg/strlenopt-31.c branches/gcc-7-branch/gcc/testsuite/gcc.dg/strlenopt-31g.c Modified: branches/gcc-7-branch/gcc/ChangeLog branches/gcc-7-branch/gcc/testsuite/ChangeLog branches/gcc-7-branch/gcc/tree-ssa-strlen.c