Fix strstr folding (PR tree-optimization/79196).
authorMartin Liska <mliska@suse.cz>
Mon, 23 Jan 2017 14:57:43 +0000 (15:57 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Mon, 23 Jan 2017 14:57:43 +0000 (14:57 +0000)
commitf368600fcd86f71c7bfc8a28f42434c539306da2
treebb8e8a1499c3766b40fb7df9c7365562bd7be70c
parentd886761fd048a6ad77dc7c927cbedfa503cfe01b
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.

From-SVN: r244812
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/asan/pr79196.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/strlenopt-30.c
gcc/tree-ssa-strlen.c