This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/43996] ICE in gfc_conv_array_initializer due to incomplete simplification of init expressions
- From: "dominiq at lps dot ens.fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 30 Apr 2014 12:30:52 +0000
- Subject: [Bug fortran/43996] ICE in gfc_conv_array_initializer due to incomplete simplification of init expressions
- Auto-submitted: auto-generated
- References: <bug-43996-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43996
--- Comment #16 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
The following patch fixes the ICE without reverting the fix for pr40472:
--- ../_clean/gcc/fortran/simplify.c 2014-04-27 12:52:10.000000000 +0200
+++ gcc/fortran/simplify.c 2014-04-30 14:23:46.000000000 +0200
@@ -5939,7 +6021,8 @@ gfc_simplify_spread (gfc_expr *source, g
else
mpz_init_set_ui (size, 1);
- if (mpz_get_si (size)*ncopies > gfc_option.flag_max_array_constructor)
+ if (!gfc_init_expr_flag
+ && mpz_get_si (size)*ncopies > gfc_option.flag_max_array_constructor)
return NULL;
if (source->expr_type == EXPR_CONSTANT)
Indeed compiling the test in comment 8 gives
Error: The number of elements in the array constructor at (1) requires an
increase of the allowed 65535 upper limit. See -fmax-array-constructor option
even if ", PARAMETER" is removed in the line
INTEGER, PARAMETER :: C(N, N) = MATMUL(A, B)
IMO the fix for SPREAD should be extended to all the intrinsics allowed for
initialization.