Commit 1139f2e8 by Eric Botcazou Committed by Eric Botcazou

decl.c (gnat_to_gnu_entity): Use boolean_type_node in lieu of integer_type_node…

decl.c (gnat_to_gnu_entity): Use boolean_type_node in lieu of integer_type_node for boolean operations.

	* gcc-interface/decl.c (gnat_to_gnu_entity): Use boolean_type_node in
	lieu of integer_type_node for boolean operations.
	(choices_to_gnu): Likewise.
	* gcc-interface/trans.c (Attribute_to_gnu): Likewise.
	(Loop_Statement_to_gnu): Likewise.
	(establish_gnat_vms_condition_handler): Likewise.
	(Exception_Handler_to_gnu_sjlj): Likewise.
	(gnat_to_gnu): Likewise.
	(build_unary_op_trapv): Likewise.
	(build_binary_op_trapv): Likewise.
	(emit_range_check): Likewise.
	(emit_index_check): Likewise.
	(convert_with_check): Likewise.
	* gcc-interface/utils.c (convert_vms_descriptor64): Likewise.
	(convert_vms_descriptor32): Likewise.
	(convert_vms_descriptor): Likewise.
	* gcc-interface/utils2.c (nonbinary_modular_operation): Likewise.
	(compare_arrays): Use boolean instead of integer constants.
	(build_binary_op) <TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR, TRUTH_AND_EXPR,
	TRUTH_OR_EXPR, TRUTH_XOR_EXPR>: New case.  Check that the result type
	is a boolean type.
	<GE_EXPR, LE_EXPR, GT_EXPR, LT_EXPR>: Remove obsolete assertion.
	<EQ_EXPR, NE_EXPR>: Check that the result type is a boolean type.
	<PREINC/PREDECREMENT_EXPR, POSTINC/POSTDECREMENT_EXPR>: Delete.
	<TRUTH_NOT_EXPR>: Check that the result type is a boolean type.
	(build_unary_op): Use boolean_type_node in lieu of integer_type_node
	for boolean operations.
	(fill_vms_descriptor): Likewise.  Fix formatting nits.

From-SVN: r158411
parent d88bbbb9
2010-04-16 Eric Botcazou <ebotcazou@adacore.com> 2010-04-16 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity): Use boolean_type_node in
lieu of integer_type_node for boolean operations.
(choices_to_gnu): Likewise.
* gcc-interface/trans.c (Attribute_to_gnu): Likewise.
(Loop_Statement_to_gnu): Likewise.
(establish_gnat_vms_condition_handler): Likewise.
(Exception_Handler_to_gnu_sjlj): Likewise.
(gnat_to_gnu): Likewise.
(build_unary_op_trapv): Likewise.
(build_binary_op_trapv): Likewise.
(emit_range_check): Likewise.
(emit_index_check): Likewise.
(convert_with_check): Likewise.
* gcc-interface/utils.c (convert_vms_descriptor64): Likewise.
(convert_vms_descriptor32): Likewise.
(convert_vms_descriptor): Likewise.
* gcc-interface/utils2.c (nonbinary_modular_operation): Likewise.
(compare_arrays): Use boolean instead of integer constants.
(build_binary_op) <TRUTH_ANDIF_EXPR, TRUTH_ORIF_EXPR, TRUTH_AND_EXPR,
TRUTH_OR_EXPR, TRUTH_XOR_EXPR>: New case. Check that the result type
is a boolean type.
<GE_EXPR, LE_EXPR, GT_EXPR, LT_EXPR>: Remove obsolete assertion.
<EQ_EXPR, NE_EXPR>: Check that the result type is a boolean type.
<PREINC/PREDECREMENT_EXPR, POSTINC/POSTDECREMENT_EXPR>: Delete.
<TRUTH_NOT_EXPR>: Check that the result type is a boolean type.
(build_unary_op): Use boolean_type_node in lieu of integer_type_node
for boolean operations.
(fill_vms_descriptor): Likewise. Fix formatting nits.
2010-04-16 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/ada-tree.def (LOOP_STMT): Change to 4-operand nodes. * gcc-interface/ada-tree.def (LOOP_STMT): Change to 4-operand nodes.
* gcc-interface/ada-tree.h (LOOP_STMT_TOP_COND, LOOP_STMT_BOT_COND): * gcc-interface/ada-tree.h (LOOP_STMT_TOP_COND, LOOP_STMT_BOT_COND):
Merge into... Merge into...
......
...@@ -1916,7 +1916,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -1916,7 +1916,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* Compute the size of this dimension. */ /* Compute the size of this dimension. */
gnu_max gnu_max
= build3 (COND_EXPR, gnu_index_base_type, = build3 (COND_EXPR, gnu_index_base_type,
build2 (GE_EXPR, integer_type_node, gnu_high, gnu_low), build2 (GE_EXPR, boolean_type_node, gnu_high, gnu_low),
gnu_high, gnu_high,
build2 (MINUS_EXPR, gnu_index_base_type, build2 (MINUS_EXPR, gnu_index_base_type,
gnu_low, fold_convert (gnu_index_base_type, gnu_low, fold_convert (gnu_index_base_type,
...@@ -2214,7 +2214,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -2214,7 +2214,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
gnu_high gnu_high
= build_cond_expr (sizetype, = build_cond_expr (sizetype,
build_binary_op (GE_EXPR, build_binary_op (GE_EXPR,
integer_type_node, boolean_type_node,
gnu_orig_max, gnu_orig_max,
gnu_orig_min), gnu_orig_min),
gnu_max, gnu_high); gnu_max, gnu_high);
...@@ -6335,13 +6335,11 @@ choices_to_gnu (tree operand, Node_Id choices) ...@@ -6335,13 +6335,11 @@ choices_to_gnu (tree operand, Node_Id choices)
low = gnat_to_gnu (Low_Bound (choice)); low = gnat_to_gnu (Low_Bound (choice));
high = gnat_to_gnu (High_Bound (choice)); high = gnat_to_gnu (High_Bound (choice));
/* There's no good type to use here, so we might as well use
integer_type_node. */
this_test this_test
= build_binary_op (TRUTH_ANDIF_EXPR, integer_type_node, = build_binary_op (TRUTH_ANDIF_EXPR, boolean_type_node,
build_binary_op (GE_EXPR, integer_type_node, build_binary_op (GE_EXPR, boolean_type_node,
operand, low), operand, low),
build_binary_op (LE_EXPR, integer_type_node, build_binary_op (LE_EXPR, boolean_type_node,
operand, high)); operand, high));
break; break;
...@@ -6352,10 +6350,10 @@ choices_to_gnu (tree operand, Node_Id choices) ...@@ -6352,10 +6350,10 @@ choices_to_gnu (tree operand, Node_Id choices)
high = gnat_to_gnu (High_Bound (gnat_temp)); high = gnat_to_gnu (High_Bound (gnat_temp));
this_test this_test
= build_binary_op (TRUTH_ANDIF_EXPR, integer_type_node, = build_binary_op (TRUTH_ANDIF_EXPR, boolean_type_node,
build_binary_op (GE_EXPR, integer_type_node, build_binary_op (GE_EXPR, boolean_type_node,
operand, low), operand, low),
build_binary_op (LE_EXPR, integer_type_node, build_binary_op (LE_EXPR, boolean_type_node,
operand, high)); operand, high));
break; break;
...@@ -6373,10 +6371,10 @@ choices_to_gnu (tree operand, Node_Id choices) ...@@ -6373,10 +6371,10 @@ choices_to_gnu (tree operand, Node_Id choices)
high = TYPE_MAX_VALUE (type); high = TYPE_MAX_VALUE (type);
this_test this_test
= build_binary_op (TRUTH_ANDIF_EXPR, integer_type_node, = build_binary_op (TRUTH_ANDIF_EXPR, boolean_type_node,
build_binary_op (GE_EXPR, integer_type_node, build_binary_op (GE_EXPR, boolean_type_node,
operand, low), operand, low),
build_binary_op (LE_EXPR, integer_type_node, build_binary_op (LE_EXPR, boolean_type_node,
operand, high)); operand, high));
break; break;
} }
...@@ -6386,7 +6384,7 @@ choices_to_gnu (tree operand, Node_Id choices) ...@@ -6386,7 +6384,7 @@ choices_to_gnu (tree operand, Node_Id choices)
case N_Character_Literal: case N_Character_Literal:
case N_Integer_Literal: case N_Integer_Literal:
single = gnat_to_gnu (choice); single = gnat_to_gnu (choice);
this_test = build_binary_op (EQ_EXPR, integer_type_node, operand, this_test = build_binary_op (EQ_EXPR, boolean_type_node, operand,
single); single);
break; break;
...@@ -6398,8 +6396,8 @@ choices_to_gnu (tree operand, Node_Id choices) ...@@ -6398,8 +6396,8 @@ choices_to_gnu (tree operand, Node_Id choices)
gcc_unreachable (); gcc_unreachable ();
} }
result = build_binary_op (TRUTH_ORIF_EXPR, integer_type_node, result = build_binary_op (TRUTH_ORIF_EXPR, boolean_type_node, result,
result, this_test); this_test);
} }
return result; return result;
......
...@@ -1212,7 +1212,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) ...@@ -1212,7 +1212,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
gnu_expr = gnat_protect_expr (gnu_expr); gnu_expr = gnat_protect_expr (gnu_expr);
gnu_expr gnu_expr
= emit_check = emit_check
(build_binary_op (EQ_EXPR, integer_type_node, (build_binary_op (EQ_EXPR, boolean_type_node,
gnu_expr, gnu_expr,
attribute == Attr_Pred attribute == Attr_Pred
? TYPE_MIN_VALUE (gnu_result_type) ? TYPE_MIN_VALUE (gnu_result_type)
...@@ -1677,7 +1677,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) ...@@ -1677,7 +1677,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
gnu_result gnu_result
= build_cond_expr (comp_type, = build_cond_expr (comp_type,
build_binary_op (GE_EXPR, build_binary_op (GE_EXPR,
integer_type_node, boolean_type_node,
hb, lb), hb, lb),
gnu_result, gnu_result,
convert (comp_type, integer_zero_node)); convert (comp_type, integer_zero_node));
...@@ -2259,7 +2259,7 @@ Loop_Statement_to_gnu (Node_Id gnat_node) ...@@ -2259,7 +2259,7 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
test_code = NE_EXPR; test_code = NE_EXPR;
gnu_cond_expr gnu_cond_expr
= build3 (COND_EXPR, void_type_node, = build3 (COND_EXPR, void_type_node,
build_binary_op (LE_EXPR, integer_type_node, build_binary_op (LE_EXPR, boolean_type_node,
gnu_low, gnu_high), gnu_low, gnu_high),
NULL_TREE, alloc_stmt_list ()); NULL_TREE, alloc_stmt_list ());
set_expr_location_from_node (gnu_cond_expr, gnat_loop_spec); set_expr_location_from_node (gnu_cond_expr, gnat_loop_spec);
...@@ -2280,7 +2280,7 @@ Loop_Statement_to_gnu (Node_Id gnat_node) ...@@ -2280,7 +2280,7 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
/* Set either the top or bottom exit condition. */ /* Set either the top or bottom exit condition. */
LOOP_STMT_COND (gnu_loop_stmt) LOOP_STMT_COND (gnu_loop_stmt)
= build_binary_op (test_code, integer_type_node, gnu_loop_var, = build_binary_op (test_code, boolean_type_node, gnu_loop_var,
gnu_last); gnu_last);
/* Set either the top or bottom update statement and give it the source /* Set either the top or bottom update statement and give it the source
...@@ -2359,7 +2359,7 @@ establish_gnat_vms_condition_handler (void) ...@@ -2359,7 +2359,7 @@ establish_gnat_vms_condition_handler (void)
gnat_vms_condition_handler_decl gnat_vms_condition_handler_decl
= create_subprog_decl (get_identifier ("__gnat_handle_vms_condition"), = create_subprog_decl (get_identifier ("__gnat_handle_vms_condition"),
NULL_TREE, NULL_TREE,
build_function_type_list (integer_type_node, build_function_type_list (boolean_type_node,
ptr_void_type_node, ptr_void_type_node,
ptr_void_type_node, ptr_void_type_node,
NULL_TREE), NULL_TREE),
...@@ -3386,7 +3386,7 @@ Exception_Handler_to_gnu_sjlj (Node_Id gnat_node) ...@@ -3386,7 +3386,7 @@ Exception_Handler_to_gnu_sjlj (Node_Id gnat_node)
else else
this_choice this_choice
= build_binary_op = build_binary_op
(EQ_EXPR, integer_type_node, (EQ_EXPR, boolean_type_node,
convert convert
(integer_type_node, (integer_type_node,
build_component_ref build_component_ref
...@@ -3413,7 +3413,7 @@ Exception_Handler_to_gnu_sjlj (Node_Id gnat_node) ...@@ -3413,7 +3413,7 @@ Exception_Handler_to_gnu_sjlj (Node_Id gnat_node)
this_choice this_choice
= build_binary_op = build_binary_op
(EQ_EXPR, integer_type_node, TREE_VALUE (gnu_except_ptr_stack), (EQ_EXPR, boolean_type_node, TREE_VALUE (gnu_except_ptr_stack),
convert (TREE_TYPE (TREE_VALUE (gnu_except_ptr_stack)), convert (TREE_TYPE (TREE_VALUE (gnu_except_ptr_stack)),
build_unary_op (ADDR_EXPR, NULL_TREE, gnu_expr))); build_unary_op (ADDR_EXPR, NULL_TREE, gnu_expr)));
...@@ -3430,8 +3430,8 @@ Exception_Handler_to_gnu_sjlj (Node_Id gnat_node) ...@@ -3430,8 +3430,8 @@ Exception_Handler_to_gnu_sjlj (Node_Id gnat_node)
this_choice this_choice
= build_binary_op = build_binary_op
(TRUTH_ORIF_EXPR, integer_type_node, (TRUTH_ORIF_EXPR, boolean_type_node,
build_binary_op (EQ_EXPR, integer_type_node, gnu_comp, build_binary_op (EQ_EXPR, boolean_type_node, gnu_comp,
build_int_cst (TREE_TYPE (gnu_comp), 'V')), build_int_cst (TREE_TYPE (gnu_comp), 'V')),
this_choice); this_choice);
} }
...@@ -3439,7 +3439,7 @@ Exception_Handler_to_gnu_sjlj (Node_Id gnat_node) ...@@ -3439,7 +3439,7 @@ Exception_Handler_to_gnu_sjlj (Node_Id gnat_node)
else else
gcc_unreachable (); gcc_unreachable ();
gnu_choice = build_binary_op (TRUTH_ORIF_EXPR, integer_type_node, gnu_choice = build_binary_op (TRUTH_ORIF_EXPR, boolean_type_node,
gnu_choice, this_choice); gnu_choice, this_choice);
} }
...@@ -4166,14 +4166,14 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -4166,14 +4166,14 @@ gnat_to_gnu (Node_Id gnat_node)
gnu_expr_type = get_base_type (gnu_index_type); gnu_expr_type = get_base_type (gnu_index_type);
/* Test whether the minimum slice value is too small. */ /* Test whether the minimum slice value is too small. */
gnu_expr_l = build_binary_op (LT_EXPR, integer_type_node, gnu_expr_l = build_binary_op (LT_EXPR, boolean_type_node,
convert (gnu_expr_type, convert (gnu_expr_type,
gnu_min_expr), gnu_min_expr),
convert (gnu_expr_type, convert (gnu_expr_type,
gnu_base_min_expr)); gnu_base_min_expr));
/* Test whether the maximum slice value is too large. */ /* Test whether the maximum slice value is too large. */
gnu_expr_h = build_binary_op (GT_EXPR, integer_type_node, gnu_expr_h = build_binary_op (GT_EXPR, boolean_type_node,
convert (gnu_expr_type, convert (gnu_expr_type,
gnu_max_expr), gnu_max_expr),
convert (gnu_expr_type, convert (gnu_expr_type,
...@@ -4182,7 +4182,7 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -4182,7 +4182,7 @@ gnat_to_gnu (Node_Id gnat_node)
/* Build a slice index check that returns the low bound, /* Build a slice index check that returns the low bound,
assuming the slice is not empty. */ assuming the slice is not empty. */
gnu_expr = emit_check gnu_expr = emit_check
(build_binary_op (TRUTH_ORIF_EXPR, integer_type_node, (build_binary_op (TRUTH_ORIF_EXPR, boolean_type_node,
gnu_expr_l, gnu_expr_h), gnu_expr_l, gnu_expr_h),
gnu_min_expr, CE_Index_Check_Failed, gnat_node); gnu_min_expr, CE_Index_Check_Failed, gnat_node);
...@@ -4621,7 +4621,7 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -4621,7 +4621,7 @@ gnat_to_gnu (Node_Id gnat_node)
gnu_result gnu_result
= build_cond_expr = build_cond_expr
(gnu_type, (gnu_type,
build_binary_op (GE_EXPR, integer_type_node, build_binary_op (GE_EXPR, boolean_type_node,
gnu_rhs, gnu_rhs,
convert (TREE_TYPE (gnu_rhs), convert (TREE_TYPE (gnu_rhs),
TYPE_SIZE (gnu_type))), TYPE_SIZE (gnu_type))),
...@@ -6523,7 +6523,7 @@ build_unary_op_trapv (enum tree_code code, tree gnu_type, tree operand, ...@@ -6523,7 +6523,7 @@ build_unary_op_trapv (enum tree_code code, tree gnu_type, tree operand,
operand = gnat_protect_expr (operand); operand = gnat_protect_expr (operand);
return emit_check (build_binary_op (EQ_EXPR, integer_type_node, return emit_check (build_binary_op (EQ_EXPR, boolean_type_node,
operand, TYPE_MIN_VALUE (gnu_type)), operand, TYPE_MIN_VALUE (gnu_type)),
build_unary_op (code, gnu_type, operand), build_unary_op (code, gnu_type, operand),
CE_Overflow_Check_Failed, gnat_node); CE_Overflow_Check_Failed, gnat_node);
...@@ -6567,8 +6567,8 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left, ...@@ -6567,8 +6567,8 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left,
} }
rhs_lt_zero = tree_expr_nonnegative_p (rhs) rhs_lt_zero = tree_expr_nonnegative_p (rhs)
? integer_zero_node ? boolean_false_node
: build_binary_op (LT_EXPR, integer_type_node, rhs, zero); : build_binary_op (LT_EXPR, boolean_type_node, rhs, zero);
/* ??? Should use more efficient check for operand_equal_p (lhs, rhs, 0) */ /* ??? Should use more efficient check for operand_equal_p (lhs, rhs, 0) */
...@@ -6604,10 +6604,10 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left, ...@@ -6604,10 +6604,10 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left,
convert (wide_type, rhs)); convert (wide_type, rhs));
tree check = build_binary_op tree check = build_binary_op
(TRUTH_ORIF_EXPR, integer_type_node, (TRUTH_ORIF_EXPR, boolean_type_node,
build_binary_op (LT_EXPR, integer_type_node, wide_result, build_binary_op (LT_EXPR, boolean_type_node, wide_result,
convert (wide_type, type_min)), convert (wide_type, type_min)),
build_binary_op (GT_EXPR, integer_type_node, wide_result, build_binary_op (GT_EXPR, boolean_type_node, wide_result,
convert (wide_type, type_max))); convert (wide_type, type_max)));
tree result = convert (gnu_type, wide_result); tree result = convert (gnu_type, wide_result);
...@@ -6630,9 +6630,9 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left, ...@@ -6630,9 +6630,9 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left,
/* Overflow when (rhs < 0) ^ (wrapped_expr < lhs)), for addition /* Overflow when (rhs < 0) ^ (wrapped_expr < lhs)), for addition
or when (rhs < 0) ^ (wrapped_expr > lhs) for subtraction. */ or when (rhs < 0) ^ (wrapped_expr > lhs) for subtraction. */
tree check = build_binary_op tree check = build_binary_op
(TRUTH_XOR_EXPR, integer_type_node, rhs_lt_zero, (TRUTH_XOR_EXPR, boolean_type_node, rhs_lt_zero,
build_binary_op (code == PLUS_EXPR ? LT_EXPR : GT_EXPR, build_binary_op (code == PLUS_EXPR ? LT_EXPR : GT_EXPR,
integer_type_node, wrapped_expr, lhs)); boolean_type_node, wrapped_expr, lhs));
return return
emit_check (check, result, CE_Overflow_Check_Failed, gnat_node); emit_check (check, result, CE_Overflow_Check_Failed, gnat_node);
...@@ -6643,24 +6643,24 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left, ...@@ -6643,24 +6643,24 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left,
{ {
case PLUS_EXPR: case PLUS_EXPR:
/* When rhs >= 0, overflow when lhs > type_max - rhs. */ /* When rhs >= 0, overflow when lhs > type_max - rhs. */
check_pos = build_binary_op (GT_EXPR, integer_type_node, lhs, check_pos = build_binary_op (GT_EXPR, boolean_type_node, lhs,
build_binary_op (MINUS_EXPR, gnu_type, build_binary_op (MINUS_EXPR, gnu_type,
type_max, rhs)), type_max, rhs)),
/* When rhs < 0, overflow when lhs < type_min - rhs. */ /* When rhs < 0, overflow when lhs < type_min - rhs. */
check_neg = build_binary_op (LT_EXPR, integer_type_node, lhs, check_neg = build_binary_op (LT_EXPR, boolean_type_node, lhs,
build_binary_op (MINUS_EXPR, gnu_type, build_binary_op (MINUS_EXPR, gnu_type,
type_min, rhs)); type_min, rhs));
break; break;
case MINUS_EXPR: case MINUS_EXPR:
/* When rhs >= 0, overflow when lhs < type_min + rhs. */ /* When rhs >= 0, overflow when lhs < type_min + rhs. */
check_pos = build_binary_op (LT_EXPR, integer_type_node, lhs, check_pos = build_binary_op (LT_EXPR, boolean_type_node, lhs,
build_binary_op (PLUS_EXPR, gnu_type, build_binary_op (PLUS_EXPR, gnu_type,
type_min, rhs)), type_min, rhs)),
/* When rhs < 0, overflow when lhs > type_max + rhs. */ /* When rhs < 0, overflow when lhs > type_max + rhs. */
check_neg = build_binary_op (GT_EXPR, integer_type_node, lhs, check_neg = build_binary_op (GT_EXPR, boolean_type_node, lhs,
build_binary_op (PLUS_EXPR, gnu_type, build_binary_op (PLUS_EXPR, gnu_type,
type_max, rhs)); type_max, rhs));
break; break;
...@@ -6678,19 +6678,31 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left, ...@@ -6678,19 +6678,31 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left,
tmp1 = build_binary_op (TRUNC_DIV_EXPR, gnu_type, type_max, rhs); tmp1 = build_binary_op (TRUNC_DIV_EXPR, gnu_type, type_max, rhs);
tmp2 = build_binary_op (TRUNC_DIV_EXPR, gnu_type, type_min, rhs); tmp2 = build_binary_op (TRUNC_DIV_EXPR, gnu_type, type_min, rhs);
check_pos = build_binary_op (TRUTH_ANDIF_EXPR, integer_type_node, check_pos
build_binary_op (NE_EXPR, integer_type_node, zero, rhs), = build_binary_op (TRUTH_ANDIF_EXPR, boolean_type_node,
build_binary_op (TRUTH_ORIF_EXPR, integer_type_node, build_binary_op (NE_EXPR, boolean_type_node, zero,
build_binary_op (GT_EXPR, integer_type_node, lhs, tmp1), rhs),
build_binary_op (LT_EXPR, integer_type_node, lhs, tmp2))); build_binary_op (TRUTH_ORIF_EXPR, boolean_type_node,
build_binary_op (GT_EXPR,
check_neg = fold_build3 (COND_EXPR, integer_type_node, boolean_type_node,
build_binary_op (EQ_EXPR, integer_type_node, rhs, lhs, tmp1),
build_binary_op (LT_EXPR,
boolean_type_node,
lhs, tmp2)));
check_neg
= fold_build3 (COND_EXPR, boolean_type_node,
build_binary_op (EQ_EXPR, boolean_type_node, rhs,
build_int_cst (gnu_type, -1)), build_int_cst (gnu_type, -1)),
build_binary_op (EQ_EXPR, integer_type_node, lhs, type_min), build_binary_op (EQ_EXPR, boolean_type_node, lhs,
build_binary_op (TRUTH_ORIF_EXPR, integer_type_node, type_min),
build_binary_op (GT_EXPR, integer_type_node, lhs, tmp2), build_binary_op (TRUTH_ORIF_EXPR, boolean_type_node,
build_binary_op (LT_EXPR, integer_type_node, lhs, tmp1))); build_binary_op (GT_EXPR,
boolean_type_node,
lhs, tmp2),
build_binary_op (LT_EXPR,
boolean_type_node,
lhs, tmp1)));
break; break;
default: default:
...@@ -6704,8 +6716,8 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left, ...@@ -6704,8 +6716,8 @@ build_binary_op_trapv (enum tree_code code, tree gnu_type, tree left,
if (TREE_CONSTANT (gnu_expr)) if (TREE_CONSTANT (gnu_expr))
return gnu_expr; return gnu_expr;
check = fold_build3 (COND_EXPR, integer_type_node, check = fold_build3 (COND_EXPR, boolean_type_node, rhs_lt_zero, check_neg,
rhs_lt_zero, check_neg, check_pos); check_pos);
return emit_check (check, gnu_expr, CE_Overflow_Check_Failed, gnat_node); return emit_check (check, gnu_expr, CE_Overflow_Check_Failed, gnat_node);
} }
...@@ -6739,19 +6751,18 @@ emit_range_check (tree gnu_expr, Entity_Id gnat_range_type, Node_Id gnat_node) ...@@ -6739,19 +6751,18 @@ emit_range_check (tree gnu_expr, Entity_Id gnat_range_type, Node_Id gnat_node)
/* Checked expressions must be evaluated only once. */ /* Checked expressions must be evaluated only once. */
gnu_expr = gnat_protect_expr (gnu_expr); gnu_expr = gnat_protect_expr (gnu_expr);
/* There's no good type to use here, so we might as well use /* Note that the form of the check is
integer_type_node. Note that the form of the check is
(not (expr >= lo)) or (not (expr <= hi)) (not (expr >= lo)) or (not (expr <= hi))
the reason for this slightly convoluted form is that NaNs the reason for this slightly convoluted form is that NaNs
are not considered to be in range in the float case. */ are not considered to be in range in the float case. */
return emit_check return emit_check
(build_binary_op (TRUTH_ORIF_EXPR, integer_type_node, (build_binary_op (TRUTH_ORIF_EXPR, boolean_type_node,
invert_truthvalue invert_truthvalue
(build_binary_op (GE_EXPR, integer_type_node, (build_binary_op (GE_EXPR, boolean_type_node,
convert (gnu_compare_type, gnu_expr), convert (gnu_compare_type, gnu_expr),
convert (gnu_compare_type, gnu_low))), convert (gnu_compare_type, gnu_low))),
invert_truthvalue invert_truthvalue
(build_binary_op (LE_EXPR, integer_type_node, (build_binary_op (LE_EXPR, boolean_type_node,
convert (gnu_compare_type, gnu_expr), convert (gnu_compare_type, gnu_expr),
convert (gnu_compare_type, convert (gnu_compare_type,
gnu_high)))), gnu_high)))),
...@@ -6788,15 +6799,13 @@ emit_index_check (tree gnu_array_object, tree gnu_expr, tree gnu_low, ...@@ -6788,15 +6799,13 @@ emit_index_check (tree gnu_array_object, tree gnu_expr, tree gnu_low,
gnu_low = SUBSTITUTE_PLACEHOLDER_IN_EXPR (gnu_low, gnu_array_object); gnu_low = SUBSTITUTE_PLACEHOLDER_IN_EXPR (gnu_low, gnu_array_object);
gnu_high = SUBSTITUTE_PLACEHOLDER_IN_EXPR (gnu_high, gnu_array_object); gnu_high = SUBSTITUTE_PLACEHOLDER_IN_EXPR (gnu_high, gnu_array_object);
/* There's no good type to use here, so we might as well use
integer_type_node. */
return emit_check return emit_check
(build_binary_op (TRUTH_ORIF_EXPR, integer_type_node, (build_binary_op (TRUTH_ORIF_EXPR, boolean_type_node,
build_binary_op (LT_EXPR, integer_type_node, build_binary_op (LT_EXPR, boolean_type_node,
gnu_expr_check, gnu_expr_check,
convert (TREE_TYPE (gnu_expr_check), convert (TREE_TYPE (gnu_expr_check),
gnu_low)), gnu_low)),
build_binary_op (GT_EXPR, integer_type_node, build_binary_op (GT_EXPR, boolean_type_node,
gnu_expr_check, gnu_expr_check,
convert (TREE_TYPE (gnu_expr_check), convert (TREE_TYPE (gnu_expr_check),
gnu_high))), gnu_high))),
...@@ -6909,7 +6918,7 @@ convert_with_check (Entity_Id gnat_type, tree gnu_expr, bool overflowp, ...@@ -6909,7 +6918,7 @@ convert_with_check (Entity_Id gnat_type, tree gnu_expr, bool overflowp,
: 1)) : 1))
gnu_cond gnu_cond
= invert_truthvalue = invert_truthvalue
(build_binary_op (GE_EXPR, integer_type_node, (build_binary_op (GE_EXPR, boolean_type_node,
gnu_input, convert (gnu_in_basetype, gnu_input, convert (gnu_in_basetype,
gnu_out_lb))); gnu_out_lb)));
...@@ -6920,9 +6929,9 @@ convert_with_check (Entity_Id gnat_type, tree gnu_expr, bool overflowp, ...@@ -6920,9 +6929,9 @@ convert_with_check (Entity_Id gnat_type, tree gnu_expr, bool overflowp,
TREE_REAL_CST (gnu_in_lb)) TREE_REAL_CST (gnu_in_lb))
: 1)) : 1))
gnu_cond gnu_cond
= build_binary_op (TRUTH_ORIF_EXPR, integer_type_node, gnu_cond, = build_binary_op (TRUTH_ORIF_EXPR, boolean_type_node, gnu_cond,
invert_truthvalue invert_truthvalue
(build_binary_op (LE_EXPR, integer_type_node, (build_binary_op (LE_EXPR, boolean_type_node,
gnu_input, gnu_input,
convert (gnu_in_basetype, convert (gnu_in_basetype,
gnu_out_ub)))); gnu_out_ub))));
...@@ -6980,7 +6989,7 @@ convert_with_check (Entity_Id gnat_type, tree gnu_expr, bool overflowp, ...@@ -6980,7 +6989,7 @@ convert_with_check (Entity_Id gnat_type, tree gnu_expr, bool overflowp,
gnu_result = gnat_protect_expr (gnu_result); gnu_result = gnat_protect_expr (gnu_result);
gnu_conv = convert (calc_type, gnu_result); gnu_conv = convert (calc_type, gnu_result);
gnu_comp gnu_comp
= fold_build2 (GE_EXPR, integer_type_node, gnu_result, gnu_zero); = fold_build2 (GE_EXPR, boolean_type_node, gnu_result, gnu_zero);
gnu_add_pred_half gnu_add_pred_half
= fold_build2 (PLUS_EXPR, calc_type, gnu_conv, gnu_pred_half); = fold_build2 (PLUS_EXPR, calc_type, gnu_conv, gnu_pred_half);
gnu_subtract_pred_half gnu_subtract_pred_half
......
...@@ -3025,7 +3025,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) ...@@ -3025,7 +3025,7 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
/* Test that we really have a SB descriptor, like DEC Ada. */ /* Test that we really have a SB descriptor, like DEC Ada. */
t = build3 (COMPONENT_REF, TREE_TYPE (klass), desc, klass, NULL); t = build3 (COMPONENT_REF, TREE_TYPE (klass), desc, klass, NULL);
u = convert (TREE_TYPE (klass), DECL_INITIAL (klass)); u = convert (TREE_TYPE (klass), DECL_INITIAL (klass));
u = build_binary_op (EQ_EXPR, integer_type_node, t, u); u = build_binary_op (EQ_EXPR, boolean_type_node, t, u);
/* If so, there is already a template in the descriptor and /* If so, there is already a template in the descriptor and
it is located right after the POINTER field. The fields are it is located right after the POINTER field. The fields are
64bits so they must be repacked. */ 64bits so they must be repacked. */
...@@ -3063,12 +3063,12 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) ...@@ -3063,12 +3063,12 @@ convert_vms_descriptor64 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
/* Raise CONSTRAINT_ERROR if either more than 1 dimension /* Raise CONSTRAINT_ERROR if either more than 1 dimension
or FL_COEFF or FL_BOUNDS not set. */ or FL_COEFF or FL_BOUNDS not set. */
u = build_int_cst (TREE_TYPE (aflags), 192); u = build_int_cst (TREE_TYPE (aflags), 192);
u = build_binary_op (TRUTH_OR_EXPR, integer_type_node, u = build_binary_op (TRUTH_OR_EXPR, boolean_type_node,
build_binary_op (NE_EXPR, integer_type_node, build_binary_op (NE_EXPR, boolean_type_node,
dimct, dimct,
convert (TREE_TYPE (dimct), convert (TREE_TYPE (dimct),
size_one_node)), size_one_node)),
build_binary_op (NE_EXPR, integer_type_node, build_binary_op (NE_EXPR, boolean_type_node,
build2 (BIT_AND_EXPR, build2 (BIT_AND_EXPR,
TREE_TYPE (aflags), TREE_TYPE (aflags),
aflags, u), aflags, u),
...@@ -3173,7 +3173,7 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) ...@@ -3173,7 +3173,7 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
/* Test that we really have a SB descriptor, like DEC Ada. */ /* Test that we really have a SB descriptor, like DEC Ada. */
t = build3 (COMPONENT_REF, TREE_TYPE (klass), desc, klass, NULL); t = build3 (COMPONENT_REF, TREE_TYPE (klass), desc, klass, NULL);
u = convert (TREE_TYPE (klass), DECL_INITIAL (klass)); u = convert (TREE_TYPE (klass), DECL_INITIAL (klass));
u = build_binary_op (EQ_EXPR, integer_type_node, t, u); u = build_binary_op (EQ_EXPR, boolean_type_node, t, u);
/* If so, there is already a template in the descriptor and /* If so, there is already a template in the descriptor and
it is located right after the POINTER field. */ it is located right after the POINTER field. */
t = TREE_CHAIN (pointer); t = TREE_CHAIN (pointer);
...@@ -3196,12 +3196,12 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog) ...@@ -3196,12 +3196,12 @@ convert_vms_descriptor32 (tree gnu_type, tree gnu_expr, Entity_Id gnat_subprog)
/* Raise CONSTRAINT_ERROR if either more than 1 dimension /* Raise CONSTRAINT_ERROR if either more than 1 dimension
or FL_COEFF or FL_BOUNDS not set. */ or FL_COEFF or FL_BOUNDS not set. */
u = build_int_cst (TREE_TYPE (aflags), 192); u = build_int_cst (TREE_TYPE (aflags), 192);
u = build_binary_op (TRUTH_OR_EXPR, integer_type_node, u = build_binary_op (TRUTH_OR_EXPR, boolean_type_node,
build_binary_op (NE_EXPR, integer_type_node, build_binary_op (NE_EXPR, boolean_type_node,
dimct, dimct,
convert (TREE_TYPE (dimct), convert (TREE_TYPE (dimct),
size_one_node)), size_one_node)),
build_binary_op (NE_EXPR, integer_type_node, build_binary_op (NE_EXPR, boolean_type_node,
build2 (BIT_AND_EXPR, build2 (BIT_AND_EXPR,
TREE_TYPE (aflags), TREE_TYPE (aflags),
aflags, u), aflags, u),
...@@ -3263,11 +3263,11 @@ convert_vms_descriptor (tree gnu_type, tree gnu_expr, tree gnu_expr_alt_type, ...@@ -3263,11 +3263,11 @@ convert_vms_descriptor (tree gnu_type, tree gnu_expr, tree gnu_expr_alt_type,
mbo = build3 (COMPONENT_REF, TREE_TYPE (mbo), desc, mbo, NULL_TREE); mbo = build3 (COMPONENT_REF, TREE_TYPE (mbo), desc, mbo, NULL_TREE);
mbmo = build3 (COMPONENT_REF, TREE_TYPE (mbmo), desc, mbmo, NULL_TREE); mbmo = build3 (COMPONENT_REF, TREE_TYPE (mbmo), desc, mbmo, NULL_TREE);
is64bit is64bit
= build_binary_op (TRUTH_ANDIF_EXPR, integer_type_node, = build_binary_op (TRUTH_ANDIF_EXPR, boolean_type_node,
build_binary_op (EQ_EXPR, integer_type_node, build_binary_op (EQ_EXPR, boolean_type_node,
convert (integer_type_node, mbo), convert (integer_type_node, mbo),
integer_one_node), integer_one_node),
build_binary_op (EQ_EXPR, integer_type_node, build_binary_op (EQ_EXPR, boolean_type_node,
convert (integer_type_node, mbmo), convert (integer_type_node, mbmo),
integer_minus_one_node)); integer_minus_one_node));
......
...@@ -242,11 +242,11 @@ find_common_type (tree t1, tree t2) ...@@ -242,11 +242,11 @@ find_common_type (tree t1, tree t2)
static tree static tree
compare_arrays (tree result_type, tree a1, tree a2) compare_arrays (tree result_type, tree a1, tree a2)
{ {
tree result = convert (result_type, boolean_true_node);
tree a1_is_null = convert (result_type, boolean_false_node);
tree a2_is_null = convert (result_type, boolean_false_node);
tree t1 = TREE_TYPE (a1); tree t1 = TREE_TYPE (a1);
tree t2 = TREE_TYPE (a2); tree t2 = TREE_TYPE (a2);
tree result = convert (result_type, integer_one_node);
tree a1_is_null = convert (result_type, integer_zero_node);
tree a2_is_null = convert (result_type, integer_zero_node);
bool a1_side_effects_p = TREE_SIDE_EFFECTS (a1); bool a1_side_effects_p = TREE_SIDE_EFFECTS (a1);
bool a2_side_effects_p = TREE_SIDE_EFFECTS (a2); bool a2_side_effects_p = TREE_SIDE_EFFECTS (a2);
bool length_zero_p = false; bool length_zero_p = false;
...@@ -310,7 +310,7 @@ compare_arrays (tree result_type, tree a1, tree a2) ...@@ -310,7 +310,7 @@ compare_arrays (tree result_type, tree a1, tree a2)
length_zero_p = true; length_zero_p = true;
this_a1_is_null = comparison; this_a1_is_null = comparison;
this_a2_is_null = convert (result_type, integer_one_node); this_a2_is_null = convert (result_type, boolean_true_node);
} }
/* If the length is some other constant value, we know that the /* If the length is some other constant value, we know that the
...@@ -339,7 +339,7 @@ compare_arrays (tree result_type, tree a1, tree a2) ...@@ -339,7 +339,7 @@ compare_arrays (tree result_type, tree a1, tree a2)
this_a1_is_null = build_binary_op (LT_EXPR, result_type, ub1, lb1); this_a1_is_null = build_binary_op (LT_EXPR, result_type, ub1, lb1);
if (EXPR_P (this_a1_is_null)) if (EXPR_P (this_a1_is_null))
SET_EXPR_LOCATION (this_a1_is_null, input_location); SET_EXPR_LOCATION (this_a1_is_null, input_location);
this_a2_is_null = convert (result_type, integer_zero_node); this_a2_is_null = convert (result_type, boolean_false_node);
} }
/* Otherwise compare the computed lengths. */ /* Otherwise compare the computed lengths. */
...@@ -491,7 +491,7 @@ nonbinary_modular_operation (enum tree_code op_code, tree type, tree lhs, ...@@ -491,7 +491,7 @@ nonbinary_modular_operation (enum tree_code op_code, tree type, tree lhs,
{ {
result = gnat_protect_expr (result); result = gnat_protect_expr (result);
result = fold_build3 (COND_EXPR, op_type, result = fold_build3 (COND_EXPR, op_type,
fold_build2 (LT_EXPR, integer_type_node, result, fold_build2 (LT_EXPR, boolean_type_node, result,
convert (op_type, integer_zero_node)), convert (op_type, integer_zero_node)),
fold_build2 (PLUS_EXPR, op_type, result, modulus), fold_build2 (PLUS_EXPR, op_type, result, modulus),
result); result);
...@@ -502,7 +502,7 @@ nonbinary_modular_operation (enum tree_code op_code, tree type, tree lhs, ...@@ -502,7 +502,7 @@ nonbinary_modular_operation (enum tree_code op_code, tree type, tree lhs,
{ {
result = gnat_protect_expr (result); result = gnat_protect_expr (result);
result = fold_build3 (COND_EXPR, op_type, result = fold_build3 (COND_EXPR, op_type,
fold_build2 (GE_EXPR, integer_type_node, fold_build2 (GE_EXPR, boolean_type_node,
result, modulus), result, modulus),
fold_build2 (MINUS_EXPR, op_type, fold_build2 (MINUS_EXPR, op_type,
result, modulus), result, modulus),
...@@ -716,16 +716,28 @@ build_binary_op (enum tree_code op_code, tree result_type, ...@@ -716,16 +716,28 @@ build_binary_op (enum tree_code op_code, tree result_type,
modulus = NULL_TREE; modulus = NULL_TREE;
break; break;
case TRUTH_ANDIF_EXPR:
case TRUTH_ORIF_EXPR:
case TRUTH_AND_EXPR:
case TRUTH_OR_EXPR:
case TRUTH_XOR_EXPR:
#ifdef ENABLE_CHECKING
gcc_assert (TREE_CODE (get_base_type (result_type)) == BOOLEAN_TYPE);
#endif
operation_type = left_base_type;
left_operand = convert (operation_type, left_operand);
right_operand = convert (operation_type, right_operand);
break;
case GE_EXPR: case GE_EXPR:
case LE_EXPR: case LE_EXPR:
case GT_EXPR: case GT_EXPR:
case LT_EXPR: case LT_EXPR:
gcc_assert (!POINTER_TYPE_P (left_type));
/* ... fall through ... */
case EQ_EXPR: case EQ_EXPR:
case NE_EXPR: case NE_EXPR:
#ifdef ENABLE_CHECKING
gcc_assert (TREE_CODE (get_base_type (result_type)) == BOOLEAN_TYPE);
#endif
/* If either operand is a NULL_EXPR, just return a new one. */ /* If either operand is a NULL_EXPR, just return a new one. */
if (TREE_CODE (left_operand) == NULL_EXPR) if (TREE_CODE (left_operand) == NULL_EXPR)
return build2 (op_code, result_type, return build2 (op_code, result_type,
...@@ -842,13 +854,6 @@ build_binary_op (enum tree_code op_code, tree result_type, ...@@ -842,13 +854,6 @@ build_binary_op (enum tree_code op_code, tree result_type,
modulus = NULL_TREE; modulus = NULL_TREE;
break; break;
case PREINCREMENT_EXPR:
case PREDECREMENT_EXPR:
case POSTINCREMENT_EXPR:
case POSTDECREMENT_EXPR:
/* These operations are not used anymore. */
gcc_unreachable ();
case LSHIFT_EXPR: case LSHIFT_EXPR:
case RSHIFT_EXPR: case RSHIFT_EXPR:
case LROTATE_EXPR: case LROTATE_EXPR:
...@@ -1001,7 +1006,9 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand) ...@@ -1001,7 +1006,9 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
break; break;
case TRUTH_NOT_EXPR: case TRUTH_NOT_EXPR:
gcc_assert (result_type == base_type); #ifdef ENABLE_CHECKING
gcc_assert (TREE_CODE (get_base_type (result_type)) == BOOLEAN_TYPE);
#endif
result = invert_truthvalue (operand); result = invert_truthvalue (operand);
break; break;
...@@ -1259,7 +1266,7 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand) ...@@ -1259,7 +1266,7 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
result = fold_build3 (COND_EXPR, operation_type, result = fold_build3 (COND_EXPR, operation_type,
fold_build2 (NE_EXPR, fold_build2 (NE_EXPR,
integer_type_node, boolean_type_node,
operand, operand,
convert convert
(operation_type, (operation_type,
...@@ -2088,12 +2095,11 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc, ...@@ -2088,12 +2095,11 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc,
tree tree
fill_vms_descriptor (tree expr, Entity_Id gnat_formal, Node_Id gnat_actual) fill_vms_descriptor (tree expr, Entity_Id gnat_formal, Node_Id gnat_actual)
{ {
tree field;
tree parm_decl = get_gnu_tree (gnat_formal); tree parm_decl = get_gnu_tree (gnat_formal);
tree const_list = NULL_TREE;
tree record_type = TREE_TYPE (TREE_TYPE (parm_decl)); tree record_type = TREE_TYPE (TREE_TYPE (parm_decl));
int do_range_check = tree const_list = NULL_TREE, field;
strcmp ("MBO", const bool do_range_check
= strcmp ("MBO",
IDENTIFIER_POINTER (DECL_NAME (TYPE_FIELDS (record_type)))); IDENTIFIER_POINTER (DECL_NAME (TYPE_FIELDS (record_type))));
expr = maybe_unconstrained_array (expr); expr = maybe_unconstrained_array (expr);
...@@ -2105,19 +2111,19 @@ fill_vms_descriptor (tree expr, Entity_Id gnat_formal, Node_Id gnat_actual) ...@@ -2105,19 +2111,19 @@ fill_vms_descriptor (tree expr, Entity_Id gnat_formal, Node_Id gnat_actual)
SUBSTITUTE_PLACEHOLDER_IN_EXPR SUBSTITUTE_PLACEHOLDER_IN_EXPR
(DECL_INITIAL (field), expr)); (DECL_INITIAL (field), expr));
/* Check to ensure that only 32bit pointers are passed in /* Check to ensure that only 32-bit pointers are passed in
32bit descriptors */ 32-bit descriptors */
if (do_range_check && if (do_range_check
strcmp (IDENTIFIER_POINTER (DECL_NAME (field)), "POINTER") == 0) && strcmp (IDENTIFIER_POINTER (DECL_NAME (field)), "POINTER") == 0)
{ {
tree pointer64type = tree pointer64type
build_pointer_type_for_mode (void_type_node, DImode, false); = build_pointer_type_for_mode (void_type_node, DImode, false);
tree addr64expr = build_unary_op (ADDR_EXPR, pointer64type, expr); tree addr64expr = build_unary_op (ADDR_EXPR, pointer64type, expr);
tree malloc64low = tree malloc64low
build_int_cstu (long_integer_type_node, 0x80000000); = build_int_cstu (long_integer_type_node, 0x80000000);
add_stmt (build3 (COND_EXPR, void_type_node, add_stmt (build3 (COND_EXPR, void_type_node,
build_binary_op (GE_EXPR, long_integer_type_node, build_binary_op (GE_EXPR, boolean_type_node,
convert (long_integer_type_node, convert (long_integer_type_node,
addr64expr), addr64expr),
malloc64low), malloc64low),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment