Regression with parameter_array_init_3.f90
Paul Thomas
paulthomas2@wanadoo.fr
Sun Jan 13 14:24:00 GMT 2008
Steve,
> The below allows parameter_array_init_3.f90 to compile on
> amd64-*-freebsd. I have no idea why no one else sees this
> regression, but my gdb sessions and the patch suggest that
> ar->as->upper[i] isn't an EXPR_CONSTANT even though the
> claims it is. Note, there are no other patches in my tree.
>
>
> Index: expr.c
> ===================================================================
> --- expr.c (revision 131471)
> +++ expr.c (working copy)
> @@ -1046,8 +1046,12 @@ find_array_element (gfc_constructor *con
> mpz_add (offset, offset, delta);
>
> mpz_set_ui (tmp, 1);
> - mpz_add (tmp, tmp, ar->as->upper[i]->value.integer);
> mpz_sub (tmp, tmp, ar->as->lower[i]->value.integer);
> +
> + if (!gfc_is_constant_expr (ar->as->upper[i]))
> + goto depart;
> +
> + mpz_add (tmp, tmp, ar->as->upper[i]->value.integer);
> mpz_mul (span, span, tmp);
> }
>
>
On the principle that it cannot do any harm, I will apply it as 'obvious'.
Thanks for persevering on that one, Steve.
Cheers
Paul
More information about the Fortran
mailing list