+2014-05-14 Richard Sandiford <r.sandiford@uk.ibm.com>
+
+ * gcc-interface/decl.c (gnat_to_gnu_entity): Convert
+ integer_one_node to the appropriate type.
+ * gcc-interface/trans.c (gnat_to_gnu): Likewise.
+ (pos_to_constructor): Likewise.
+
2014-05-13 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (annotate_value): Fix thinko in latest change.
= build_binary_op (PLUS_EXPR, gnu_string_index_type,
gnu_lower_bound,
int_const_binop (MINUS_EXPR, gnu_length,
- integer_one_node));
+ convert (gnu_string_index_type,
+ integer_one_node)));
tree gnu_index_type
= create_index_type (convert (sizetype, gnu_lower_bound),
convert (sizetype, gnu_upper_bound),
int length = String_Length (gnat_string);
int i;
tree gnu_idx = TYPE_MIN_VALUE (TYPE_DOMAIN (gnu_result_type));
+ tree gnu_one_node = convert (TREE_TYPE (gnu_idx), integer_one_node);
vec<constructor_elt, va_gc> *gnu_vec;
vec_alloc (gnu_vec, length);
Get_String_Char (gnat_string, i + 1));
CONSTRUCTOR_APPEND_ELT (gnu_vec, gnu_idx, t);
- gnu_idx = int_const_binop (PLUS_EXPR, gnu_idx, integer_one_node);
+ gnu_idx = int_const_binop (PLUS_EXPR, gnu_idx, gnu_one_node);
}
gnu_result = gnat_build_constructor (gnu_result_type, gnu_vec);
CONSTRUCTOR_APPEND_ELT (gnu_expr_vec, gnu_index,
convert (TREE_TYPE (gnu_array_type), gnu_expr));
- gnu_index = int_const_binop (PLUS_EXPR, gnu_index, integer_one_node);
+ gnu_index = int_const_binop (PLUS_EXPR, gnu_index,
+ convert (TREE_TYPE (gnu_index),
+ integer_one_node));
}
return gnat_build_constructor (gnu_array_type, gnu_expr_vec);