PR tree-optimization/83671 - Fix for false positive reported by -Wstringop-overflow...
commitd5d661d5e819fc0a566d3509145e97f0d59f305e
authormsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Jan 2018 21:40:14 +0000 (10 21:40 +0000)
committermsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Jan 2018 21:40:14 +0000 (10 21:40 +0000)
treefafafff32b2c7dda509c5af6251cf14765cc834f
parent3e2681840c30b0b5155ba4bf707b9b134b7cd0eb
PR tree-optimization/83671 - Fix for false positive reported by -Wstringop-overflow does not work with inlining

gcc/testsuite/ChangeLog:

PR tree-optimization/83671
* gcc.dg/strlenopt-40.c: New test.
* gcc.dg/strlenopt-41.c: New test.

gcc/ChangeLog:

PR tree-optimization/83671
* builtins.c (c_strlen): Unconditionally return zero for the empty
string.
Use -Warray-bounds for warnings.
* gimple-fold.c (get_range_strlen): Handle non-constant lengths
for non-constant array indices with COMPONENT_REF, arrays of
arrays, and pointers to arrays.
(gimple_fold_builtin_strlen): Determine and set length range for
non-constant character arrays.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256457 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/builtins.c
gcc/gimple-fold.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/string1.C
gcc/testsuite/gcc.dg/strlenopt-40.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/strlenopt-41.c [new file with mode: 0644]