aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorFritz Reese <foreese@gcc.gnu.org>2020-04-15 11:44:40 -0400
committerFritz Reese <foreese@gcc.gnu.org>2020-04-15 11:44:40 -0400
commit49795733fdcc3a804dab59b63f86d5ebe4541374 (patch)
tree1ce951a765fb58f85c6a97c998bdd3c2414eaa0a /gcc/fortran
parentd4f655724c6e19ef0aeb5ac9e8d04abd962ccde7 (diff)
downloadgcc-49795733fdcc3a804dab59b63f86d5ebe4541374.zip
gcc-49795733fdcc3a804dab59b63f86d5ebe4541374.tar.gz
gcc-49795733fdcc3a804dab59b63f86d5ebe4541374.tar.bz2
Simplify recently introduced check to simplify_bound.
gcc/fortran/ChangeLog: 2020-04-15 Fritz Reese <foreese@gcc.gnu.org> Linus Koenig <link@sig-st.de> PR fortran/94192 * simplify.c (simplify_bound): Simplify condition for error check.
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/simplify.c8
2 files changed, 10 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 9473ecb..515b912 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2020-04-15 Fritz Reese <foreese@gcc.gnu.org>
+ Linus Koenig <link@sig-st.de>
+
+ PR fortran/94192
+ * simplify.c (simplify_bound): Simplify condition for error check.
+
2020-04-14 Tobias Burnus <tobias@codesourcery.com>
* module.c (gfc_match_use): Fix name-conflict check for use-associating
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index 807565b..d5703e3 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -4159,10 +4159,6 @@ simplify_bound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind, int upper)
gfc_array_spec *as;
int d;
- /* Do not attempt to resolve if error has already been issued. */
- if (array->symtree && array->symtree->n.sym->error)
- return NULL;
-
if (array->ts.type == BT_CLASS)
return NULL;
@@ -4173,6 +4169,10 @@ simplify_bound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind, int upper)
goto done;
}
+ /* Do not attempt to resolve if error has already been issued. */
+ if (array->symtree->n.sym->error)
+ return NULL;
+
/* Follow any component references. */
as = array->symtree->n.sym->as;
for (ref = array->ref; ref; ref = ref->next)