re PR tree-optimization/63989 (tree-ssa-strlen.c doesn't handle constant pointer...
authorJakub Jelinek <jakub@redhat.com>
Thu, 8 Jan 2015 21:30:56 +0000 (22:30 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 8 Jan 2015 21:30:56 +0000 (22:30 +0100)
commit204a913bda3c3228723ea13e41c9dd831c362b33
tree769905ce0ea2dd0ec84a6ed340016c2adba5f3d1
parent57534689d75b6164dae4ac7f5c6f23d543f63583
re PR tree-optimization/63989 (tree-ssa-strlen.c doesn't handle constant pointer plus and array refs if constant offset is smaller than known constant string length)

PR tree-optimization/63989
* params.def (PARAM_MAX_TRACKED_STRLENS): Increment default
from 1000 to 10000.
* tree-ssa-strlen.c (get_strinfo): Moved earlier.
(get_stridx): If we don't have a record for certain SSA_NAME,
but it is POINTER_PLUS_EXPR of some SSA_NAME we do with
constant offset, call get_stridx_plus_constant.
(get_stridx_plus_constant): New function.
(zero_length_string): Don't use get_stridx here.

* gcc.dg/strlenopt-27.c: New test.

From-SVN: r219362
gcc/ChangeLog
gcc/params.def
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/strlenopt-27.c [new file with mode: 0644]
gcc/tree-ssa-strlen.c