[Patch, Fortran] ICE with PROCEDURE using a complicated interface (PR36322 & PR36275)

Janus Weil jaydub66@googlemail.com
Tue Jun 3 21:27:00 GMT 2008


> I might be mistaken, but I think with yesterday's patch you were effectively
> doing the same: You copied all elements.

Ok, sure, you're right. I somehow assumed the ts member of gfc_symbol
would be a pointer, which of course it is not!

> Unless I overlooked something, the following is equivalent to your patch:
>
>         sym->ts = sym->ts.interface->ts;
>         sym->attr.function = ifc->attr.function;
>         sym->attr.subroutine = ifc->attr.subroutine;
>         copy_formal_args (sym, ifc);
>
> and much more readable.

I agree that it's much more elegant. But in this form it's not 100%
equivalent. The little difference is that in your version the
sym->ts.interface will be lost after the assignment. I'm not sure if
it matters, since the link to the interface is probably not needed any
more after all the attributes have been copied. Just to be on the safe
side, the attached patch maintains the pointer to the interface. If
you think that it's not needed we can also leave it out.

> The question is whether one needs to additionally
> copy the gfc_charlen instead of only assigning the pointer, i.e. sym->ts.cl
> = gfc_get_charlen (); ... (and now one could continue with cl->length,
> cl->next etc.)

Ok, I will try to implement this, assuming it is indeed necessary.
Cheers,
Janus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr36322_v2.diff
Type: text/x-patch
Size: 2203 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080603/d43f107f/attachment.bin>


More information about the Gcc-patches mailing list