decl.c (gnat_to_gnu_entity): Convert integer_one_node to the appropriate type.

gcc/ada/
	* 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.

From-SVN: r210427
This commit is contained in:
Richard Sandiford 2014-05-14 15:42:25 +00:00 committed by Richard Sandiford
parent 70d6d5c1d3
commit 8b9aec861e
3 changed files with 14 additions and 3 deletions

View File

@ -1,3 +1,10 @@
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.

View File

@ -2840,7 +2840,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
= 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),

View File

@ -5597,6 +5597,7 @@ gnat_to_gnu (Node_Id gnat_node)
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);
@ -5606,7 +5607,7 @@ gnat_to_gnu (Node_Id gnat_node)
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);
@ -9092,7 +9093,9 @@ pos_to_constructor (Node_Id gnat_expr, tree gnu_array_type,
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);