aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMikhail Maltsev <maltsevm@gmail.com>2015-10-23 22:36:12 +0000
committerJeff Law <law@gcc.gnu.org>2015-10-23 16:36:12 -0600
commitc86db055fb12b463bb49802ea9691c908e44f7ce (patch)
treeac9f8f4ec23550f1c7051ab424688f90af50735f /gcc
parent9447d255f44d763533cd25ca464665fa806aeb66 (diff)
downloadgcc-c86db055fb12b463bb49802ea9691c908e44f7ce.zip
gcc-c86db055fb12b463bb49802ea9691c908e44f7ce.tar.gz
gcc-c86db055fb12b463bb49802ea9691c908e44f7ce.tar.bz2
[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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/trans-common.c15
-rw-r--r--gcc/fortran/trans.c6
3 files changed, 14 insertions, 12 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 4dc4fdd..7ed2bc5 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,8 @@
+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>
PR driver/68043
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);