Commit e5e85f2b by Tobias Burnus Committed by Tobias Burnus

re PR fortran/40472 (Simplification of spread intrinsic takes a long time)

2009-06-22  Tobias Burnus  <burnus@net-b.de>

        PR fortran/40472
        PR fortran/50520
        * simplify.c (gfc_simplify_spread): Fix the case that source=
        is a scalar.

From-SVN: r148814
parent c986683b
2009-06-22 Tobias Burnus <burnus@net-b.de>
PR fortran/40472
PR fortran/50520
* simplify.c (gfc_simplify_spread): Fix the case that source=
is a scalar.
2009-06-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/40443
......
......@@ -5117,7 +5117,14 @@ gfc_simplify_spread (gfc_expr *source, gfc_expr *dim_expr, gfc_expr *ncopies_exp
/* Do not allow the array size to exceed the limit for an array
constructor. */
gfc_array_size (source, &size);
if (source->expr_type == EXPR_ARRAY)
{
if (gfc_array_size (source, &size) == FAILURE)
gfc_internal_error ("Failure getting length of a constant array.");
}
else
mpz_init_set_ui (size, 1);
if (mpz_get_si (size)*ncopies > gfc_option.flag_max_array_constructor)
return NULL;
......
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