https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92341

--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
Author: msebor
Date: Tue Nov  5 16:20:44 2019
New Revision: 277851

URL: https://gcc.gnu.org/viewcvs?rev=277851&root=gcc&view=rev
Log:
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.


Added:
    trunk/gcc/testsuite/gcc.dg/Warray-bounds-53.c
    trunk/gcc/testsuite/gcc.dg/Warray-bounds-54.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/warn/Warray-bounds-4.C
    trunk/gcc/tree-sra.c
    trunk/gcc/tree-vrp.c

Reply via email to