diff options
author | Tobias Burnus <burnus@net-b.de> | 2010-07-06 22:56:07 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2010-07-06 22:56:07 +0200 |
commit | 928f04908265767255978321f42e9b2957bcb2f4 (patch) | |
tree | b8fbc94bf1493b37215f6ba423694942689b25f4 /gcc/fortran/array.c | |
parent | c829d0163dc338b0c12d27c6e7aedb6da5f7f4c5 (diff) | |
download | gcc-928f04908265767255978321f42e9b2957bcb2f4.zip gcc-928f04908265767255978321f42e9b2957bcb2f4.tar.gz gcc-928f04908265767255978321f42e9b2957bcb2f4.tar.bz2 |
re PR fortran/44742 (ICE in gfc_conv_array_initializer)
2010-07-06 Tobias Burnus <burnus@net-b.de>
PR fortran/44742
* array.c (gfc_expand_constructor): Add optional diagnostic.
* gfortran.h (gfc_expand_constructor): Update prototype.
* expr.c (gfc_simplify_expr, check_init_expr,
gfc_reduce_init_expr): Update gfc_expand_constructor call.
* resolve.c (gfc_resolve_expr): Ditto.
2010-07-06 Tobias Burnus <burnus@net-b.de>
PR fortran/44742
* gfortran.dg/parameter_array_init_6.f90: New.
* gfortran.dg/initialization_20.f90: Update dg-error.
* gfortran.dg/initialization_24.f90: Ditto.
From-SVN: r161888
Diffstat (limited to 'gcc/fortran/array.c')
-rw-r--r-- | gcc/fortran/array.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index 64816f2..0c36f54 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -1545,7 +1545,7 @@ gfc_get_array_element (gfc_expr *array, int element) constructor if they are small enough. */ gfc_try -gfc_expand_constructor (gfc_expr *e) +gfc_expand_constructor (gfc_expr *e, bool fatal) { expand_info expand_save; gfc_expr *f; @@ -1557,6 +1557,15 @@ gfc_expand_constructor (gfc_expr *e) if (f != NULL) { gfc_free_expr (f); + if (fatal) + { + gfc_error ("The number of elements in the array constructor " + "at %L requires an increase of the allowed %d " + "upper limit. See -fmax-array-constructor " + "option", &e->where, + gfc_option.flag_max_array_constructor); + return FAILURE; + } return SUCCESS; } |