https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86622

--- Comment #8 from Martin Sebor <msebor at gcc dot gnu.org> ---
Author: msebor
Date: Wed Jul 25 02:11:31 2018
New Revision: 262958

URL: https://gcc.gnu.org/viewcvs?rev=262958&root=gcc&view=rev
Log:
PR tree-optimization/86622 - incorrect strlen of array of array plus variable
offset
PR tree-optimization/86532 - Wrong code due to a wrong strlen folding starting
with r262522

gcc/ChangeLog:

        PR tree-optimization/86622
        PR tree-optimization/86532
        * builtins.h (string_length): Declare.
        * builtins.c (c_strlen): Correct handling of non-constant offsets.      
        (check_access): Be prepared for non-constant length ranges.
        (string_length): Make extern.
        * expr.c (string_constant): Only handle the minor non-constant
        array index.  Use string_constant to compute the length of
        a generic string constant.

gcc/testsuite/ChangeLog:

        PR tree-optimization/86622
        PR tree-optimization/86532
        * gcc.c-torture/execute/strlen-2.c: New test.
        * gcc.c-torture/execute/strlen-3.c: New test.
        * gcc.c-torture/execute/strlen-4.c: New test.


Added:
    trunk/gcc/testsuite/gcc.c-torture/execute/strlen-2.c
    trunk/gcc/testsuite/gcc.c-torture/execute/strlen-3.c
    trunk/gcc/testsuite/gcc.c-torture/execute/strlen-4.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/builtins.c
    trunk/gcc/builtins.h
    trunk/gcc/expr.c
    trunk/gcc/testsuite/ChangeLog

Reply via email to