gcc/fortran/ChangeLog: 2015-10-05 Mikhail Maltsev <malts...@gmail.com>
* trans-common.c (create_common): Adjust to use flag_checking. * trans.c (gfc_add_modify_loc): Use gcc_checking_assert.
>From 8113b4d5bc943772145abdd6562d4af6093d9718 Mon Sep 17 00:00:00 2001 From: Mikhail Maltsev <malts...@gmail.com> Date: Sat, 3 Oct 2015 10:02:21 +0300 Subject: [PATCH 4/9] Fortran --- gcc/fortran/trans-common.c | 15 +++++++-------- gcc/fortran/trans.c | 6 ++---- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index 7f4bfe5..ae336c1 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -686,14 +686,13 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv) TREE_STATIC (ctor) = 1; DECL_INITIAL (decl) = ctor; -#ifdef ENABLE_CHECKING - { - tree field, value; - unsigned HOST_WIDE_INT idx; - FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (ctor), idx, field, value) - gcc_assert (TREE_CODE (field) == FIELD_DECL); - } -#endif + if (flag_checking) + { + tree field, value; + unsigned HOST_WIDE_INT idx; + FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (ctor), idx, field, value) + gcc_assert (TREE_CODE (field) == FIELD_DECL); + } } /* Build component reference for each variable. */ diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c index f30809a..4eaea53 100644 --- a/gcc/fortran/trans.c +++ b/gcc/fortran/trans.c @@ -151,7 +151,6 @@ gfc_add_modify_loc (location_t loc, stmtblock_t * pblock, tree lhs, tree rhs) { tree tmp; -#ifdef ENABLE_CHECKING tree t1, t2; t1 = TREE_TYPE (rhs); t2 = TREE_TYPE (lhs); @@ -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 similar for aggregates, but right now removing that check just breaks everything. */ - gcc_assert (t1 == t2 - || AGGREGATE_TYPE_P (TREE_TYPE (lhs))); -#endif + gcc_checking_assert (t1 == t2 + || AGGREGATE_TYPE_P (TREE_TYPE (lhs))); tmp = fold_build2_loc (loc, MODIFY_EXPR, void_type_node, lhs, rhs); -- 2.1.4