PR middle-end/92341 - missing -Warray-bounds indexing past the end of a compound...
authorMartin Sebor <msebor@redhat.com>
Tue, 5 Nov 2019 16:20:44 +0000 (16:20 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Tue, 5 Nov 2019 16:20:44 +0000 (09:20 -0700)
commit361d4a9eb6b397f3401b7693ee9fbc032e95a0f0
treed0efeac99cf67e900fd19921105e9211998dbe51
parent02bf7e6fa219f939b3225c54fbe8bab2133b1aeb
PR middle-end/92341 - missing -Warray-bounds indexing past the end of a compound literal

PR middle-end/92341 - missing -Warray-bounds indexing past the end of a compound literal
PR middle-end/82612 - missing -Warray-bounds on a non-zero offset from the address of a non-array object

gcc/testsuite/ChangeLog:

PR middle-end/92341
PR middle-end/82612
* g++.dg/warn/Warray-bounds-4.C: Adjust text of expected warning.
* gcc.dg/Warray-bounds-53.c: New test.
* gcc.dg/Warray-bounds-54.c: New test.

gcc/ChangeLog:

PR middle-end/92341
PR middle-end/82612
* tree-sra.c (get_access_for_expr): Fail for out-of-bounds offsets.
* tree-vrp.c (vrp_prop::check_array_ref): Correct index and text
of message printed in a warning for empty arrays.
(vrp_prop::check_mem_ref): Also handle function parameters and
empty arrays.

From-SVN: r277851
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/Warray-bounds-4.C
gcc/testsuite/gcc.dg/Warray-bounds-53.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Warray-bounds-54.c [new file with mode: 0644]
gcc/tree-sra.c
gcc/tree-vrp.c