+2018-04-02 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/85102
+ * decl.c (variable_decl): If upper or lower bounds simplify
+ to a constant, use that.
+
2018-03-30 Paul Thomas <pault@gcc.gnu.org>
PR fortran/84931
goto cleanup;
}
}
+ if (as->type == AS_EXPLICIT)
+ {
+ for (int i = 0; i < as->rank; i++)
+ {
+ gfc_expr *e, *n;
+ e = as->lower[i];
+ if (e->expr_type != EXPR_CONSTANT)
+ {
+ n = gfc_copy_expr (e);
+ gfc_simplify_expr (n, 1);
+ if (n->expr_type == EXPR_CONSTANT)
+ gfc_replace_expr (e, n);
+ else
+ gfc_free_expr (n);
+ }
+ e = as->upper[i];
+ if (e->expr_type != EXPR_CONSTANT)
+ {
+ n = gfc_copy_expr (e);
+ gfc_simplify_expr (n, 1);
+ if (n->expr_type == EXPR_CONSTANT)
+ gfc_replace_expr (e, n);
+ else
+ gfc_free_expr (n);
+ }
+ }
+ }
}
char_len = NULL;
+2018-04-02 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/85102
+ * gfortran.dg/array_simplify_2.f90: New test.
+
2018-04-01 Jakub Jelinek <jakub@redhat.com>
PR middle-end/85090
--- /dev/null
+! { dg-do run }
+! PR 85102 - this used to ICE
+! Original test case by Gerhard Steinmetz
+program p
+ integer, parameter :: a((1+2)) = 1
+ integer, parameter :: b((1+1)+1) = 1
+ integer, parameter :: c = dot_product(a, a)
+ integer, parameter :: d = dot_product(b,b)
+ if (c /= 3) stop 1
+ if (d /= 3) stop 2
+ end program p