revert: tree-vrp.c (check_array_ref): Bail out on zero-length arrays.
gcc/ 2013-09-03 Meador Inge <meadori@codesourcery.com> Revert: 2013-08-30 Meador Inge <meadori@codesourcery.com> * tree-vrp.c (check_array_ref): Bail out on zero-length arrays. gcc/testsuite/ 2013-09-03 Meador Inge <meadori@codesourcery.com> Revert: 2013-08-30 Meador Inge <meadori@codesourcery.com> * gcc.dg/Warray-bounds-11.c: New testcase. From-SVN: r202228
This commit is contained in:
parent
d7fd3fde96
commit
db8800bc5f
4 changed files with 18 additions and 15 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2013-09-03 Meador Inge <meadori@codesourcery.com>
|
||||||
|
|
||||||
|
Revert:
|
||||||
|
|
||||||
|
2013-08-30 Meador Inge <meadori@codesourcery.com>
|
||||||
|
|
||||||
|
* tree-vrp.c (check_array_ref): Bail out on zero-length arrays.
|
||||||
|
|
||||||
2013-09-03 David Edelsohn <dje.gcc@gmail.com>
|
2013-09-03 David Edelsohn <dje.gcc@gmail.com>
|
||||||
|
|
||||||
* config/rs6000/rs6000.h (ASM_OUTPUT_DEF_FROM_DECLS): Emit lglobl for
|
* config/rs6000/rs6000.h (ASM_OUTPUT_DEF_FROM_DECLS): Emit lglobl for
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
2013-09-03 Meador Inge <meadori@codesourcery.com>
|
||||||
|
|
||||||
|
Revert:
|
||||||
|
|
||||||
|
2013-08-30 Meador Inge <meadori@codesourcery.com>
|
||||||
|
|
||||||
|
* gcc.dg/Warray-bounds-11.c: New testcase.
|
||||||
|
|
||||||
2013-09-03 David Edelsohn <dje.gcc@gmail.com>
|
2013-09-03 David Edelsohn <dje.gcc@gmail.com>
|
||||||
|
|
||||||
* lib/target-supports.exp (check_weak_available): Return true for AIX.
|
* lib/target-supports.exp (check_weak_available): Return true for AIX.
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
/* { dg-do compile } */
|
|
||||||
/* { dg-options "-O2 -Warray-bounds -std=gnu99" } */
|
|
||||||
/* Test zero-length arrays for GNU C. */
|
|
||||||
|
|
||||||
unsigned int a[] = { };
|
|
||||||
unsigned int size_a;
|
|
||||||
|
|
||||||
int test(void)
|
|
||||||
{
|
|
||||||
/* This should not warn. */
|
|
||||||
return size_a ? a[0] : 0;
|
|
||||||
}
|
|
|
@ -6137,10 +6137,9 @@ check_array_ref (location_t location, tree ref, bool ignore_off_by_one)
|
||||||
low_sub = up_sub = TREE_OPERAND (ref, 1);
|
low_sub = up_sub = TREE_OPERAND (ref, 1);
|
||||||
up_bound = array_ref_up_bound (ref);
|
up_bound = array_ref_up_bound (ref);
|
||||||
|
|
||||||
/* Can not check flexible arrays or zero-length arrays. */
|
/* Can not check flexible arrays. */
|
||||||
if (!up_bound
|
if (!up_bound
|
||||||
|| TREE_CODE (up_bound) != INTEGER_CST
|
|| TREE_CODE (up_bound) != INTEGER_CST)
|
||||||
|| tree_int_cst_equal (up_bound, integer_minus_one_node))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Accesses to trailing arrays via pointers may access storage
|
/* Accesses to trailing arrays via pointers may access storage
|
||||||
|
|
Loading…
Add table
Reference in a new issue