diff options
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c/c-typeck.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 71a1db1..43cc839 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,8 @@ +2013-07-04 Joern Rennecke <joern.rennecke@embecosm.com> + + PR c/57821 + * c-typeck.c (set_init_index): When folding, check for index overflow. + 2013-06-28 Balaji V. Iyer <balaji.v.iyer@intel.com> * c-parser.c (c_parser_array_notation): Removed rejection of array diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index 3a92311..30871db 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -7217,6 +7217,11 @@ set_init_index (tree first, tree last, if (last) constant_expression_warning (last); constructor_index = convert (bitsizetype, first); + if (tree_int_cst_lt (constructor_index, first)) + { + constructor_index = copy_node (constructor_index); + TREE_OVERFLOW (constructor_index) = 1; + } if (last) { |