Commit 586dc38b by Steven G. Kargl

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

2015-11-18  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/59910
	* primary.c (gfc_match_structure_constructor): Reduce a structure
	constructor in a DATA statement.

2015-11-18  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/59910
	* gfortran.dg/pr59910.f90: New test.

From-SVN: r230580
parent 9231aa17
2015-11-18 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/59910
* primary.c (gfc_match_structure_constructor): Reduce a structure
constructor in a DATA statement.
2015-11-18 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/43996
* simplify.c (gfc_simplify_spread): Issue error for too large array
constructor in a PARAMETER statement.
......
......@@ -2722,6 +2722,12 @@ gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result)
return MATCH_ERROR;
}
/* If a structure constructor is in a DATA statement, then each entity
in the structure constructor must be a constant. Try to reduce the
expression here. */
if (gfc_in_match_data ())
gfc_reduce_init_expr (e);
*result = e;
return MATCH_YES;
}
......
2015-11-18 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/59910
* gfortran.dg/pr59910.f90: New test.
2015-11-18 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/43996
* gfortran.dg/pr43996.f90: New test.
......
! { dg-do compile }
! PR fortran/59910
!
program main
implicit none
type bar
integer :: limit(1)
end type
type (bar) :: testsuite
data testsuite / bar(reshape(source=[10],shape=[1])) /
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