[Bug tree-optimization/64277] [4.9 Regression] Incorrect warning "array subscript is above array bounds"

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Apr 16 12:03:00 GMT 2015


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

--- Comment #23 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Thu Apr 16 12:03:11 2015
New Revision: 222146

URL: https://gcc.gnu.org/viewcvs?rev=222146&root=gcc&view=rev
Log:
2015-04-16  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/64277
    * tree-vrp.c (check_array_ref): Fix anti-range handling,
    simplify upper bound handling.
    (search_for_addr_array): Simplify.
    (check_array_bounds): Handle ADDR_EXPRs here.
    (check_all_array_refs): Simplify.

    * gcc.dg/Warray-bounds-14.c: New testcase.
    * gcc.dg/Warray-bounds-15.c: Likewise.
    * c-c++-common/ubsan/bounds-4.c: Disable -Warray-bounds.
    * c-c++-common/ubsan/bounds-6.c: Likewise.

Added:
    trunk/gcc/testsuite/gcc.dg/Warray-bounds-14.c
    trunk/gcc/testsuite/gcc.dg/Warray-bounds-15.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/c-c++-common/ubsan/bounds-4.c
    trunk/gcc/testsuite/c-c++-common/ubsan/bounds-6.c
    trunk/gcc/tree-vrp.c



More information about the Gcc-bugs mailing list