PR tree-optimization/90626 - fold strcmp(a, b) == 0 to zero when one string length...
authorMartin Sebor <msebor@redhat.com>
Wed, 19 Jun 2019 20:37:41 +0000 (20:37 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Wed, 19 Jun 2019 20:37:41 +0000 (14:37 -0600)
commit4b4a26731e96522a76a6f9fc6a253d41a29238ef
treeead7cea0bd370d8f021fe8e4df8a2ff9ed11b09b
parent14fef000947916e55e5aa1bdd6d78a04ed78dde4
PR tree-optimization/90626 - fold strcmp(a, b) == 0 to zero when one string length is exact and the other is unequal

gcc/ChangeLog:

PR tree-optimization/90626
* tree-ssa-strlen.c (strxcmp_unequal): New function.
(handle_builtin_string_cmp): Call it.

gcc/testsuite/ChangeLog:

PR tree-optimization/90626
* gcc.dg/strlenopt-65.c: New test.
* gcc.dg/strlenopt-66.c: New test.
* gcc.dg/strlenopt.h (strcmp, strncmp): Declare.

From-SVN: r272485
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/strlenopt-65.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/strlenopt-66.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/strlenopt.h
gcc/tree-ssa-strlen.c