This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/79196] [7 Regression] Probably invalid folding of strstr(x, "foo") eq x to memcmp (x, "foo", strlen("foo"))


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

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
Author: marxin
Date: Mon Jan 23 14:57:43 2017
New Revision: 244812

URL: https://gcc.gnu.org/viewcvs?rev=244812&root=gcc&view=rev
Log:
Fix strstr folding (PR tree-optimization/79196).

2017-01-23  Martin Liska  <mliska@suse.cz>

        PR tree-optimization/79196
        * tree-ssa-strlen.c (fold_strstr_to_memcmp): Rename to ...
        (fold_strstr_to_strncmp): ... this.  Fold the pattern to strncmp
        instead of memcmp.
        (strlen_optimize_stmt): Call the renamed function.
2017-01-23  Martin Liska  <mliska@suse.cz>

        PR tree-optimization/79196
        * gcc.dg/asan/pr79196.c: New test.
        * gcc.dg/strlenopt-30.c: Update scanned pattern.

Added:
    trunk/gcc/testsuite/gcc.dg/asan/pr79196.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/strlenopt-30.c
    trunk/gcc/tree-ssa-strlen.c

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]