summaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/gcc-interface/utils2.c')
-rw-r--r--gcc/ada/gcc-interface/utils2.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c
index 70737a9990b..47446ba8969 100644
--- a/gcc/ada/gcc-interface/utils2.c
+++ b/gcc/ada/gcc-interface/utils2.c
@@ -854,9 +854,8 @@ build_binary_op (enum tree_code op_code, tree result_type,
{
case INIT_EXPR:
case MODIFY_EXPR:
-#ifdef ENABLE_CHECKING
- gcc_assert (result_type == NULL_TREE);
-#endif
+ gcc_checking_assert (result_type == NULL_TREE);
+
/* If there were integral or pointer conversions on the LHS, remove
them; we'll be putting them back below if needed. Likewise for
conversions between array and record types, except for justified
@@ -1039,9 +1038,8 @@ build_binary_op (enum tree_code op_code, tree result_type,
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
+ gcc_checking_assert
+ (TREE_CODE (get_base_type (result_type)) == BOOLEAN_TYPE);
operation_type = left_base_type;
left_operand = convert (operation_type, left_operand);
right_operand = convert (operation_type, right_operand);
@@ -1053,9 +1051,8 @@ build_binary_op (enum tree_code op_code, tree result_type,
case LT_EXPR:
case EQ_EXPR:
case NE_EXPR:
-#ifdef ENABLE_CHECKING
- gcc_assert (TREE_CODE (get_base_type (result_type)) == BOOLEAN_TYPE);
-#endif
+ gcc_checking_assert
+ (TREE_CODE (get_base_type (result_type)) == BOOLEAN_TYPE);
/* If either operand is a NULL_EXPR, just return a new one. */
if (TREE_CODE (left_operand) == NULL_EXPR)
return build2 (op_code, result_type,
@@ -1335,9 +1332,8 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
break;
case TRUTH_NOT_EXPR:
-#ifdef ENABLE_CHECKING
- gcc_assert (TREE_CODE (get_base_type (result_type)) == BOOLEAN_TYPE);
-#endif
+ gcc_checking_assert
+ (TREE_CODE (get_base_type (result_type)) == BOOLEAN_TYPE);
result = invert_truthvalue_loc (EXPR_LOCATION (operand), operand);
/* When not optimizing, fold the result as invert_truthvalue_loc
doesn't fold the result of comparisons. This is intended to undo
@@ -2333,8 +2329,13 @@ build_call_alloc_dealloc (tree gnu_obj, tree gnu_size, tree gnu_type,
/* Check that we aren't violating the associated restriction. */
if (!(Nkind (gnat_node) == N_Allocator && Comes_From_Source (gnat_node)))
- Check_No_Implicit_Heap_Alloc (gnat_node);
-
+ {
+ Check_No_Implicit_Heap_Alloc (gnat_node);
+ if (Has_Task (Etype (gnat_node)))
+ Check_No_Implicit_Task_Alloc (gnat_node);
+ if (Has_Protected (Etype (gnat_node)))
+ Check_No_Implicit_Protected_Alloc (gnat_node);
+ }
return maybe_wrap_malloc (gnu_size, gnu_type, gnat_node);
}
}