]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR tree-optimization/88771 - Misleading -Werror=array-bounds error
authormsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 11 Feb 2019 17:44:05 +0000 (17:44 +0000)
committermsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 11 Feb 2019 17:44:05 +0000 (17:44 +0000)
commit49a30f91debe7c1af3ffc8727aca04a35dc5c698
treecdd2b8ec87767d99ab4bcddece5ee1e1a452fe6f
parent08acf739fbe5d50254578898ca1699de09e7ed62
PR tree-optimization/88771 - Misleading -Werror=array-bounds error

gcc/ChangeLog:

PR tree-optimization/88771
* gimple-ssa-warn-restrict.c (pass_wrestrict::gate): Also enable
when -Wstringop-overflow is set.
(builtin_memref::builtin_memref): Adjust excessive upper bound
only when lower bound is not excessive.
(maybe_diag_overlap): Detect and diagnose excessive bounds via
-Wstringop-ovefflow.
(maybe_diag_offset_bounds): Rename...
(maybe_diag_access_bounds): ...to this.
(check_bounds_or_overlap): Adjust for name change above.

gcc/testsuite/ChangeLog:

PR tree-optimization/88771
* gcc.dg/Wstringop-overflow-8.c: New test.
* gcc.dg/Wstringop-overflow-9.c: New test.
* gcc.dg/Warray-bounds-40.c: New test.
* gcc.dg/builtin-stpncpy.c: Adjust.
* gcc.dg/builtin-stringop-chk-4.c: Adjust.
* g++.dg/opt/memcpy1.C: Adjust.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@268775 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/gimple-ssa-warn-restrict.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/memcpy1.C
gcc/testsuite/gcc.dg/Warray-bounds-40.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Wstringop-overflow-8.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Wstringop-overflow-9.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/builtin-stpncpy.c
gcc/testsuite/gcc.dg/builtin-stringop-chk-4.c