PR fortran/91944
* simplify.c (gfc_simplify_spread): Check gfc_init_expr_flag instead
of gfc_current_ns->sym_root->n.sym->attr.flavor == FL_PARAMETER.
* gfortran.dg/spread_size_limit_2.f90: New test.
From-SVN: r278762
+2019-11-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/91944
+ * simplify.c (gfc_simplify_spread): Check gfc_init_expr_flag instead
+ of gfc_current_ns->sym_root->n.sym->attr.flavor == FL_PARAMETER.
+
2019-11-27 Tobias Burnus <tobias@codesourcery.com>
PR middle-end/92463
nelem = mpz_get_si (size) * ncopies;
if (nelem > flag_max_array_constructor)
{
- if (gfc_current_ns->sym_root->n.sym->attr.flavor == FL_PARAMETER)
+ if (gfc_init_expr_flag)
{
gfc_error ("The number of elements (%d) in the array constructor "
"at %L requires an increase of the allowed %d upper "
2019-11-27 Jakub Jelinek <jakub@redhat.com>
+ PR fortran/91944
+ * gfortran.dg/spread_size_limit_2.f90: New test.
+
PR c++/92524
* g++.dg/cpp0x/pr92524.C: New test.
--- /dev/null
+! PR fortran/91944
+! { dg-do compile }
+! { dg-options "-fmax-array-constructor=65535" }
+
+program pr91944
+ integer, parameter :: n = 10
+ integer, parameter :: m = 65536
+ integer :: i
+ integer :: x(n,m) = spread([(i,i=1,n)], dim=2, ncopies=m) ! { dg-error "requires an increase of the allowed 65535 upper limit" }
+ print *, x(n,m)
+end