This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, fortran] PR31213 , PR33888 and PR33998 - formal actual mapping problems
- From: Tobias Burnus <burnus at net-b dot de>
- To: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>, richard at codesourcery dot com
- Date: Fri, 14 Dec 2007 10:50:06 +0100
- Subject: Re: [Patch, fortran] PR31213 , PR33888 and PR33998 - formal actual mapping problems
- References: <339c37f20712130337s7e734341t75c1e2e5cefa15b6@mail.gmail.com>
Paul Richard Thomas wrote:
> The attached patch builds upon Richard Sandiford's interface mapping
> mechanism
! /* If the iterator appears in a specification exxpression in
! an interface mapping, we need to make a temp for the loop
s/exxpression/expression/ as Dominique already noted.
+ if (expr->ts.type == BT_CHARACTER
+ && expr->ts.cl->length->expr_type != EXPR_CONSTANT)
Indention looks wrong.
+ character(0) h4(1:minval([(1,i=1,0)],1))
As written, this gives a huge array size. As Dominique remarked:
> The original pr33998 had the line:
>
> character(0) sv1(size(x,1):size(h4))
+ /* TODO These implementations of lbound and ubound do not limit
if the
+ size < 0, according to 13.14.53 and 13.14.113. */
You should mention which Fortran standard you quote (F95 or F2003; it is
F95). At least when there is also F2008 it will get a bit confusing.
+ case GFC_ISYM_LBOUND:
+ case GFC_ISYM_UBOUND:
[...]
+ if (arg2 && arg2->expr_type == EXPR_CONSTANT)
+ d = mpz_get_si (arg2->value.integer) - 1;
+ else
+ d = 0;
+
+ if (expr->value.function.isym->id == GFC_ISYM_LBOUND)
+ new_expr = gfc_copy_expr (sym->as->lower[d]);
I do not understand the arg2 == NULL case; arg2 is the dimension, but
why is new_expr equal to dimension 1 and not an array with the ubounds
of all dimensions? Probably I just have not yet fully understood the patch.
Otherwise the patch looks ok and as far as I tested fixes all test cases
from the PRs.
Tobias