PR middle-end/95673 - missing -Wstring-compare for an impossible strncmp test
authorMartin Sebor <msebor@redhat.com>
Tue, 17 Nov 2020 02:47:39 +0000 (19:47 -0700)
committerMartin Sebor <msebor@redhat.com>
Tue, 17 Nov 2020 02:47:39 +0000 (19:47 -0700)
commitb1ecb86569f63f897f6a95049c4ccf400bddeaad
treef7c22f08535842dd7204679011de3da1433bdab9
parentf8e4c55cbc09fbbe136b2ba2da405d7bdced07ae
PR middle-end/95673 - missing -Wstring-compare for an impossible strncmp test

gcc/ChangeLog:

PR middle-end/95673
* tree-ssa-strlen.c (used_only_for_zero_equality): Rename...
(use_in_zero_equality): ...to this.  Add a default argument.
(handle_builtin_memcmp): Adjust to the name change above.
(handle_builtin_string_cmp): Same.
(maybe_warn_pointless_strcmp): Same.  Pass in an explicit argument.

gcc/testsuite/ChangeLog:

PR middle-end/95673
* gcc.dg/Wstring-compare-3.c: New test.
gcc/testsuite/gcc.dg/Wstring-compare-3.c [new file with mode: 0644]
gcc/tree-ssa-strlen.c