diff options
author | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-06 20:56:07 +0000 |
---|---|---|
committer | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-06 20:56:07 +0000 |
commit | 58b069a099182c5367587d098eda613ee3947fec (patch) | |
tree | b8fbc94bf1493b37215f6ba423694942689b25f4 /gcc/fortran/array.c | |
parent | 7cbc820e16a5c752351dd7db7150b2f128bc21e1 (diff) | |
download | gcc-58b069a099182c5367587d098eda613ee3947fec.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161888 138bc75d-0d04-0410-961f-82ee72b054a4
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 64816f28abb..0c36f544e6d 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; } |