PR tree-optimization/85259 - Missing -Wstringop-overflow= since r256683
commitc1a0c86ca4851263809c757b97f070dd9fbebbf1
authormsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 Jun 2018 18:05:13 +0000 (12 18:05 +0000)
committermsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 Jun 2018 18:05:13 +0000 (12 18:05 +0000)
tree54f2c40c75f1eaadb4e09b9210721c95bda1b3a4
parent9d1a574bc57e41d8dc8c0566901d248bc212f30f
PR tree-optimization/85259 - Missing -Wstringop-overflow= since r256683

gcc/ChangeLog:

PR tree-optimization/85259
* builtins.c (compute_objsize): Handle constant offsets.
* gimple-ssa-warn-restrict.c (maybe_diag_offset_bounds): Return
true iff a warning has been issued.
* gimple.h (gimple_nonartificial_location): New function.
* tree-ssa-strlen.c (maybe_diag_stxncpy_trunc): Call
gimple_nonartificial_location and handle -Wno-system-headers.
(handle_builtin_stxncpy): Same.

gcc/testsuite/ChangeLog:

PR tree-optimization/85259
* gcc.dg/Wstringop-overflow-5.c: New test.
* gcc.dg/Wstringop-overflow-6.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@261518 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/builtins.c
gcc/gimple-ssa-warn-restrict.c
gcc/gimple.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/Wstringop-overflow-5.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Wstringop-overflow-6.c [new file with mode: 0644]
gcc/tree-ssa-strlen.c