Move/correct offset adjustment (PR middle-end/96903).
authorMartin Sebor <msebor@redhat.com>
Fri, 11 Sep 2020 15:40:45 +0000 (09:40 -0600)
committerMartin Sebor <msebor@redhat.com>
Fri, 11 Sep 2020 15:42:29 +0000 (09:42 -0600)
commitf36a8168f04dfbde9d4c64421c1058975b28ff9a
tree0a91d08d1d73d3cdd55bce00bfe8474576186b89
parent1be7bf7dab86d2fb33561b7eac1d2f527aa98b2c
Move/correct offset adjustment (PR middle-end/96903).

Resolves:
PR middle-end/96903 - bogus warning on memcpy at negative offset from array end

gcc/ChangeLog:

PR middle-end/96903
* builtins.c (compute_objsize): Remove incorrect offset adjustment.
(compute_objsize): Adjust offset range here instead.

gcc/testsuite/ChangeLog:

PR middle-end/96903
* gcc.dg/Wstringop-overflow-42.c:: Add comment.
* gcc.dg/Wstringop-overflow-43.c: New test.
gcc/builtins.c
gcc/testsuite/gcc.dg/Wstringop-overflow-42.c
gcc/testsuite/gcc.dg/Wstringop-overflow-43.c [new file with mode: 0644]