Commit b7b848f5 by Jakub Jelinek Committed by Jakub Jelinek

re PR fortran/91944 (ICE in gfc_conv_array_initializer, at fortran/trans-array.c:6156)

	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
parent 90ca6847
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
......
......@@ -7656,7 +7656,7 @@ gfc_simplify_spread (gfc_expr *source, gfc_expr *dim_expr, gfc_expr *ncopies_exp
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.
......
! 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment