PR tree-optimization/83896 - ice in get_string_len on a call to strlen with
authorMartin Sebor <msebor@redhat.com>
Fri, 26 Jan 2018 16:47:22 +0000 (16:47 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Fri, 26 Jan 2018 16:47:22 +0000 (09:47 -0700)
commita011292a9e0c4fc64738237f01a0fd03ff07a6ae
treeef201c6dce0f918f5e1e748439aec5cc4cf0f004
parentf91edfc4e593505431d975b3e8512cde5bb63b9e
PR tree-optimization/83896 - ice in get_string_len on a call to strlen with

PR tree-optimization/83896 - ice in get_string_len on a call to strlen with
non-constant length

gcc/ChangeLog:

        PR tree-optimization/83896
        * tree-ssa-strlen.c (get_string_len): Rename...
        (get_string_cst_length): ...to this.  Return HOST_WIDE_INT.
        Avoid assuming length is constant.
        (handle_char_store): Use HOST_WIDE_INT for string length.

gcc/testsuite/ChangeLog:

        PR tree-optimization/83896
        * gcc.dg/strlenopt-43.c: New test.

From-SVN: r257100
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/strlenopt-43.c [new file with mode: 0644]
gcc/tree-ssa-strlen.c