Commit 9abe8b74 by Mikhail Maltsev Committed by Jeff Law

[PATCH 3/9] ENABLE_CHECKING refactoring: Java and Ada

[PATCH 3/9] ENABLE_CHECKING refactoring: Java and Ada
gcc/java/ChangeLog:

2015-10-05  Mikhail Maltsev  <maltsevm@gmail.com>

	* decl.c (java_mark_decl_local): Use flag_checking instead of
	ENABLE_CHECKING.

gcc/ada/ChangeLog:

2015-10-05  Mikhail Maltsev  <maltsevm@gmail.com>

	* gcc-interface/decl.c (gnat_to_gnu_entity): Use gcc_checking_assert.
	* gcc-interface/trans.c (assoc_to_constructor): Use flag_checking.
	* gcc-interface/utils.c (relate_alias_sets): Likewise.
	* gcc-interface/utils2.c (build_binary_op, build_unary_op): Use
	gcc_checking_assert

From-SVN: r229185
parent 71e558ef
2015-10-22 Mikhail Maltsev <maltsevm@gmail.com>
* gcc-interface/decl.c (gnat_to_gnu_entity): Use gcc_checking_assert.
* gcc-interface/trans.c (assoc_to_constructor): Use flag_checking.
* gcc-interface/utils.c (relate_alias_sets): Likewise.
* gcc-interface/utils2.c (build_binary_op, build_unary_op): Use
gcc_checking_assert
2015-10-20 Yannick Moy <moy@adacore.com> 2015-10-20 Yannick Moy <moy@adacore.com>
* fmap.adb, a-cihama.adb, sem_ch5.adb, make.adb, inline.adb, * fmap.adb, a-cihama.adb, sem_ch5.adb, make.adb, inline.adb,
......
...@@ -2710,10 +2710,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) ...@@ -2710,10 +2710,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
TYPE_HAS_ACTUAL_BOUNDS_P (gnu_inner) = 1; TYPE_HAS_ACTUAL_BOUNDS_P (gnu_inner) = 1;
#ifdef ENABLE_CHECKING
/* Check for other cases of overloading. */ /* Check for other cases of overloading. */
gcc_assert (!TYPE_ACTUAL_BOUNDS (gnu_inner)); gcc_checking_assert (!TYPE_ACTUAL_BOUNDS (gnu_inner));
#endif
} }
for (gnat_index = First_Index (gnat_entity); for (gnat_index = First_Index (gnat_entity);
......
...@@ -9411,11 +9411,12 @@ assoc_to_constructor (Entity_Id gnat_entity, Node_Id gnat_assoc, tree gnu_type) ...@@ -9411,11 +9411,12 @@ assoc_to_constructor (Entity_Id gnat_entity, Node_Id gnat_assoc, tree gnu_type)
gnu_result = extract_values (gnu_list, gnu_type); gnu_result = extract_values (gnu_list, gnu_type);
#ifdef ENABLE_CHECKING if (flag_checking)
/* Verify that every entry in GNU_LIST was used. */ {
for (; gnu_list; gnu_list = TREE_CHAIN (gnu_list)) /* Verify that every entry in GNU_LIST was used. */
gcc_assert (TREE_ADDRESSABLE (gnu_list)); for (; gnu_list; gnu_list = TREE_CHAIN (gnu_list))
#endif gcc_assert (TREE_ADDRESSABLE (gnu_list));
}
return gnu_result; return gnu_result;
} }
......
...@@ -1499,9 +1499,7 @@ relate_alias_sets (tree gnu_new_type, tree gnu_old_type, enum alias_set_op op) ...@@ -1499,9 +1499,7 @@ relate_alias_sets (tree gnu_new_type, tree gnu_old_type, enum alias_set_op op)
/* The alias set shouldn't be copied between array types with different /* The alias set shouldn't be copied between array types with different
aliasing settings because this can break the aliasing relationship aliasing settings because this can break the aliasing relationship
between the array type and its element type. */ between the array type and its element type. */
#ifndef ENABLE_CHECKING if (flag_checking || flag_strict_aliasing)
if (flag_strict_aliasing)
#endif
gcc_assert (!(TREE_CODE (gnu_new_type) == ARRAY_TYPE gcc_assert (!(TREE_CODE (gnu_new_type) == ARRAY_TYPE
&& TREE_CODE (gnu_old_type) == ARRAY_TYPE && TREE_CODE (gnu_old_type) == ARRAY_TYPE
&& TYPE_NONALIASED_COMPONENT (gnu_new_type) && TYPE_NONALIASED_COMPONENT (gnu_new_type)
......
...@@ -854,9 +854,8 @@ build_binary_op (enum tree_code op_code, tree result_type, ...@@ -854,9 +854,8 @@ build_binary_op (enum tree_code op_code, tree result_type,
{ {
case INIT_EXPR: case INIT_EXPR:
case MODIFY_EXPR: case MODIFY_EXPR:
#ifdef ENABLE_CHECKING gcc_checking_assert (result_type == NULL_TREE);
gcc_assert (result_type == NULL_TREE);
#endif
/* If there were integral or pointer conversions on the LHS, remove /* If there were integral or pointer conversions on the LHS, remove
them; we'll be putting them back below if needed. Likewise for them; we'll be putting them back below if needed. Likewise for
conversions between array and record types, except for justified conversions between array and record types, except for justified
...@@ -1039,9 +1038,8 @@ build_binary_op (enum tree_code op_code, tree result_type, ...@@ -1039,9 +1038,8 @@ build_binary_op (enum tree_code op_code, tree result_type,
case TRUTH_AND_EXPR: case TRUTH_AND_EXPR:
case TRUTH_OR_EXPR: case TRUTH_OR_EXPR:
case TRUTH_XOR_EXPR: case TRUTH_XOR_EXPR:
#ifdef ENABLE_CHECKING gcc_checking_assert (TREE_CODE (
gcc_assert (TREE_CODE (get_base_type (result_type)) == BOOLEAN_TYPE); get_base_type (result_type)) == BOOLEAN_TYPE);
#endif
operation_type = left_base_type; operation_type = left_base_type;
left_operand = convert (operation_type, left_operand); left_operand = convert (operation_type, left_operand);
right_operand = convert (operation_type, right_operand); right_operand = convert (operation_type, right_operand);
...@@ -1053,9 +1051,8 @@ build_binary_op (enum tree_code op_code, tree result_type, ...@@ -1053,9 +1051,8 @@ build_binary_op (enum tree_code op_code, tree result_type,
case LT_EXPR: case LT_EXPR:
case EQ_EXPR: case EQ_EXPR:
case NE_EXPR: case NE_EXPR:
#ifdef ENABLE_CHECKING gcc_checking_assert (TREE_CODE (
gcc_assert (TREE_CODE (get_base_type (result_type)) == BOOLEAN_TYPE); 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,
...@@ -1335,9 +1332,8 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand) ...@@ -1335,9 +1332,8 @@ build_unary_op (enum tree_code op_code, tree result_type, tree operand)
break; break;
case TRUTH_NOT_EXPR: case TRUTH_NOT_EXPR:
#ifdef ENABLE_CHECKING gcc_checking_assert (TREE_CODE (
gcc_assert (TREE_CODE (get_base_type (result_type)) == BOOLEAN_TYPE); get_base_type (result_type)) == BOOLEAN_TYPE);
#endif
result = invert_truthvalue_loc (EXPR_LOCATION (operand), operand); result = invert_truthvalue_loc (EXPR_LOCATION (operand), operand);
/* When not optimizing, fold the result as invert_truthvalue_loc /* When not optimizing, fold the result as invert_truthvalue_loc
doesn't fold the result of comparisons. This is intended to undo doesn't fold the result of comparisons. This is intended to undo
......
2015-10-22 Mikhail Maltsev <maltsevm@gmail.com>
* decl.c (java_mark_decl_local): Use flag_checking instead of
ENABLE_CHECKING.
2015-07-15 Andrew MacLeod <amacleod@redhat.com> 2015-07-15 Andrew MacLeod <amacleod@redhat.com>
* expr.c: Remove multiline #include comment. * expr.c: Remove multiline #include comment.
......
...@@ -1905,14 +1905,12 @@ java_mark_decl_local (tree decl) ...@@ -1905,14 +1905,12 @@ java_mark_decl_local (tree decl)
{ {
DECL_EXTERNAL (decl) = 0; DECL_EXTERNAL (decl) = 0;
#ifdef ENABLE_CHECKING
/* Double check that we didn't pass the function to the callgraph early. */ /* Double check that we didn't pass the function to the callgraph early. */
if (TREE_CODE (decl) == FUNCTION_DECL) if (flag_checking && TREE_CODE (decl) == FUNCTION_DECL)
{ {
struct cgraph_node *node = cgraph_node::get (decl); struct cgraph_node *node = cgraph_node::get (decl);
gcc_assert (!node || !node->definition); gcc_assert (!node || !node->definition);
} }
#endif
gcc_assert (!DECL_RTL_SET_P (decl)); gcc_assert (!DECL_RTL_SET_P (decl));
} }
......
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