diff options
author | Steven G. Kargl <kargl@gcc.gnu.org> | 2015-11-18 22:55:17 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2015-11-18 22:55:17 +0000 |
commit | 586dc38b3e73adcec9cb87874ee06911bcceed9a (patch) | |
tree | 1a4887980cb1965c426ca7e3018bc017d9b8f709 /gcc/fortran | |
parent | 9231aa17d6498905234d8e35216b324a1b067c8c (diff) | |
download | gcc-586dc38b3e73adcec9cb87874ee06911bcceed9a.zip gcc-586dc38b3e73adcec9cb87874ee06911bcceed9a.tar.gz gcc-586dc38b3e73adcec9cb87874ee06911bcceed9a.tar.bz2 |
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
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/primary.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 5e10387..3bd9743 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,11 @@ 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. diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index d1c17f0..841e9e1 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -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; } |