+2006-01-19 Richard Sandiford <richard@codesourcery.com>
+
+ * c-decl.c (add_flexible_array_elts_to_size): Simplify vector accesses.
+
2006-01-19 Jan Hubicka <jh@suse.cz>
* tree-vect-patterns.c (vect_pattern_recog_1): Prevent parse error.
static void
add_flexible_array_elts_to_size (tree decl, tree init)
{
- unsigned int size;
tree elt, type;
- size = VEC_length (constructor_elt, CONSTRUCTOR_ELTS (init));
- if (size == 0)
+ if (VEC_empty (constructor_elt, CONSTRUCTOR_ELTS (init)))
return;
- elt = VEC_index (constructor_elt, CONSTRUCTOR_ELTS (init), size - 1)->value;
+ elt = VEC_last (constructor_elt, CONSTRUCTOR_ELTS (init))->value;
type = TREE_TYPE (elt);
if (TREE_CODE (type) == ARRAY_TYPE
&& TYPE_SIZE (type) == NULL_TREE