r134865 - in /trunk/gcc: ChangeLog c-common.c c...
simonb@gcc.gnu.org
simonb@gcc.gnu.org
Thu May 1 19:03:00 GMT 2008
Author: simonb
Date: Thu May 1 19:03:32 2008
New Revision: 134865
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=134865
Log:
* c-common.h (warn_array_subscript_range): New function.
* c-common.c (warn_array_subscript_range): Ditto.
* tree-vrp.c (check_array_ref): Corrected code to agree with
comment, ignoring only arrays of size 0 or size 1.
* c-typeck.c (build_array_ref): Call warn_array_subscript_range.
* testsuite/gcc.dg/Warray-bounds.c: Updated for frontend warnings,
additional tests for arrays of size 0 and size 1.
* testsuite/g++.dg/warn/Warray-bounds.c: Ditto.
* testsuite/gcc.dg/Warray-bounds-noopt.c: New testcase.
* testsuite/g++.dg/warn/Warray-bounds-noopt.c: Ditto.
* typeck.c (build_array_ref): Call warn_array_subscript_range.
Added:
trunk/gcc/testsuite/g++.dg/warn/Warray-bounds-noopt.C
trunk/gcc/testsuite/gcc.dg/Warray-bounds-noopt.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-common.c
trunk/gcc/c-common.h
trunk/gcc/c-typeck.c
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/typeck.c
trunk/gcc/doc/invoke.texi
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/warn/Warray-bounds.C
trunk/gcc/testsuite/gcc.dg/Warray-bounds.c
trunk/gcc/tree-vrp.c
More information about the Gcc-cvs
mailing list