PR middle-end/83373 - False positive reported by -Wstringop-overflow
authorMartin Sebor <msebor@redhat.com>
Mon, 18 Dec 2017 22:49:57 +0000 (22:49 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Mon, 18 Dec 2017 22:49:57 +0000 (15:49 -0700)
commit06199618c1c047366fdafd2b0fafdace1fb44abc
treea0d1d0ffb97b3a497c587d6dd9e1ecfd092a08ec
parentadaefe2a50b56505b9745955da5231cd87ce9d8a
PR middle-end/83373 - False positive reported by -Wstringop-overflow

PR middle-end/83373 - False positive reported by -Wstringop-overflow
PR tree-optimization/78450 - strlen(s) return value can be assumed to be less than the size of s

gcc/ChangeLog:

PR middle-end/83373
PR tree-optimization/78450
* tree-ssa-strlen.c (maybe_set_strlen_range): New function.
(handle_builtin_strlen): Call it.

gcc/testsuite/ChangeLog:

PR middle-end/83373
PR tree-optimization/78450
* gcc.dg/pr83373.c: New test.
* gcc.dg/strlenopt-36.c: New test.
* gcc.dg/strlenopt-37.c: New test.

From-SVN: r255790
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr83373.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/strlenopt-36.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/strlenopt-37.c [new file with mode: 0644]
gcc/tree-ssa-strlen.c