[Patch, Fortran] ICE with PROCEDURE using a complicated interface (PR36322 & PR36275)
Janus Weil
jaydub66@googlemail.com
Wed Jun 4 19:30:00 GMT 2008
>> 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.)
In gfortran.h one can find the following comment:
/* Character length structures hold the expression that gives the
length of a character variable. We avoid putting these into
gfc_typespec because doing so prevents us from doing structure
copies and forces us to deallocate any typespecs we create, as well
as structures that contain typespecs. They also can have multiple
character typespecs pointing to them.
These structures form a singly linked list within the current
namespace and are deallocated with the namespace. It is possible to
end up with gfc_charlen structures that have nothing pointing to them. */
I'm not really sure how to read this, but if I interpret it correctly
it says that doing structure copies of gfc_typespec should be fine,
right? Or maybe it says just the opposite?
If this is an indeed an issue, we should also have problems e.g. in
"copy_formal_args", and it seems simple structure copies of
gfc_typespec are done in many other places, too.
I have tried to find a failing test case which uses the PROCEDURE
statement and CHARACTER variables, but have found nothing so far.
Cheers,
Janus
More information about the Fortran
mailing list