Commit c86db055 by Mikhail Maltsev Committed by Jeff Law

[PATCH 4/9] ENABLE_CHECKING refactoring: Fortran

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

	* trans-common.c (create_common): Adjust to use flag_checking.
	* trans.c (gfc_add_modify_loc): Use gcc_checking_assert.

From-SVN: r229273
parent 9447d255
2015-10-23 Mikhail Maltsev <maltsevm@gmail.com>
* trans-common.c (create_common): Adjust to use flag_checking.
* trans.c (gfc_add_modify_loc): Use gcc_checking_assert.
2015-10-21 Martin Sebor <msebor@redhat.com> 2015-10-21 Martin Sebor <msebor@redhat.com>
PR driver/68043 PR driver/68043
......
...@@ -686,14 +686,13 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) ...@@ -686,14 +686,13 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv)
TREE_STATIC (ctor) = 1; TREE_STATIC (ctor) = 1;
DECL_INITIAL (decl) = ctor; DECL_INITIAL (decl) = ctor;
#ifdef ENABLE_CHECKING if (flag_checking)
{ {
tree field, value; tree field, value;
unsigned HOST_WIDE_INT idx; unsigned HOST_WIDE_INT idx;
FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (ctor), idx, field, value) FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (ctor), idx, field, value)
gcc_assert (TREE_CODE (field) == FIELD_DECL); gcc_assert (TREE_CODE (field) == FIELD_DECL);
} }
#endif
} }
/* Build component reference for each variable. */ /* Build component reference for each variable. */
......
...@@ -151,7 +151,6 @@ gfc_add_modify_loc (location_t loc, stmtblock_t * pblock, tree lhs, tree rhs) ...@@ -151,7 +151,6 @@ gfc_add_modify_loc (location_t loc, stmtblock_t * pblock, tree lhs, tree rhs)
{ {
tree tmp; tree tmp;
#ifdef ENABLE_CHECKING
tree t1, t2; tree t1, t2;
t1 = TREE_TYPE (rhs); t1 = TREE_TYPE (rhs);
t2 = TREE_TYPE (lhs); t2 = TREE_TYPE (lhs);
...@@ -159,9 +158,8 @@ gfc_add_modify_loc (location_t loc, stmtblock_t * pblock, tree lhs, tree rhs) ...@@ -159,9 +158,8 @@ gfc_add_modify_loc (location_t loc, stmtblock_t * pblock, tree lhs, tree rhs)
for scalar assignments. We should probably have something for scalar assignments. We should probably have something
similar for aggregates, but right now removing that check just similar for aggregates, but right now removing that check just
breaks everything. */ breaks everything. */
gcc_assert (t1 == t2 gcc_checking_assert (t1 == t2
|| AGGREGATE_TYPE_P (TREE_TYPE (lhs))); || AGGREGATE_TYPE_P (TREE_TYPE (lhs)));
#endif
tmp = fold_build2_loc (loc, MODIFY_EXPR, void_type_node, lhs, tmp = fold_build2_loc (loc, MODIFY_EXPR, void_type_node, lhs,
rhs); rhs);
......
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