Wstringop-overflow-10.c
874 Bytes
-
re PR tree-optimization/89500 (ICE: tree check: expected integer_cst, have… · 9bc83f27
re PR tree-optimization/89500 (ICE: tree check: expected integer_cst, have ssa_name in get_len, at tree.h:5653) PR tree-optimization/89500 * tree-ssa-strlen.c (stridx_strlenloc): Adjust comment. (handle_builtin_strlen): Remove noncst_bound variable. Always optimize strnlen (x, 0) to 0. Optimize strnlen (x, cst) to cst if the first cst bytes starting at x are known to be non-zero, even if the string is not zero terminated. Don't try to modify *si for strnlen. Update strlen_to_stridx only for strlen or if we can prove strnlen returns the same value as strlen would. * gcc.dg/pr89500.c: New test. * gcc.dg/Wstringop-overflow-10.c: New test. * gcc.dg/strlenopt-60.c: New test. From-SVN: r269230
Jakub Jelinek committed