PR tree-optimization/83456 - -Wrestrict false positive on a non-overlapping memcpy...
commit75e9093e0068dde034aca984805fc31cd78eacb6
authormsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 12 Mar 2018 18:04:16 +0000 (12 18:04 +0000)
committermsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 12 Mar 2018 18:04:16 +0000 (12 18:04 +0000)
tree3fbe1a5f54834ad2c8f3f4f8d5572933ad7b9ae0
parent0383e6cae1eb463c6dc5712bf737f7d060f74b0e
PR tree-optimization/83456 - -Wrestrict false positive on a non-overlapping memcpy in an inline function

gcc/ChangeLog:

PR tree-optimization/83456
* gimple-fold.c (gimple_fold_builtin_memory_op): Avoid warning
for perfectly overlapping calls to memcpy.
(gimple_fold_builtin_memory_chk): Same.
(gimple_fold_builtin_strcpy): Handle no-warning.
(gimple_fold_builtin_stxcpy_chk): Same.
* tree-ssa-strlen.c (maybe_diag_stxncpy_trunc): Handle no-warning.

gcc/c-family/ChangeLog:

PR tree-optimization/83456
* gcc/c-family/c-common.c (check_function_restrict): Return bool.
Restore checking of bounded built-in functions.
(check_function_arguments): Also return the result
of warn_for_restrict.
* gcc/c-family/c-common.c (check_function_restrict): Return bool.
* gcc/c-family/c-warn.c (warn_for_restrict): Return bool.

gcc/testsuite/ChangeLog:

PR tree-optimization/83456
* c-c++-common/Wrestrict-2.c: Remove test cases.
* c-c++-common/Wrestrict.c: Same.
* gcc.dg/Wrestrict-12.c: New test.
* gcc.dg/Wrestrict-14.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@258455 138bc75d-0d04-0410-961f-82ee72b054a4
12 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-common.h
gcc/c-family/c-warn.c
gcc/gimple-fold.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/Wrestrict-2.c
gcc/testsuite/c-c++-common/Wrestrict.c
gcc/testsuite/gcc.dg/Wrestrict-12.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Wrestrict-14.c [new file with mode: 0644]
gcc/tree-ssa-strlen.c