https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71625
--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Wed Jun 29 08:47:46 2016 New Revision: 237841 URL: https://gcc.gnu.org/viewcvs?rev=237841&root=gcc&view=rev Log: PR tree-optimization/71625 * tree-ssa-strlen.c (get_addr_stridx): Add PTR argument. Assume list is sorted by ascending list->offset. If PTR is non-NULL and there is previous strinfo, call get_stridx_plus_constant. (get_stridx): Pass exp as second argument to get_addr_stridx. (addr_stridxptr): Add missing list = list->next, so that there can be more than one entries in the list. Bump limit from 16 to 32. Ensure the list is sorted by ascending list->offset. (get_stridx_plus_constant): Adjust so that it can be also called with ADDR_EXPR instead of SSA_NAME as PTR. (handle_char_store): Pass NULL_TREE as second argument to get_addr_stridx. * gcc.dg/strlenopt-28.c: New test. Added: trunk/gcc/testsuite/gcc.dg/strlenopt-28.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-strlen.c