This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, Fortran] ICE with PROCEDURE using a complicated interface (PR36322 & PR36275)
- From: "Janus Weil" <jaydub66 at googlemail dot com>
- To: "Tobias Burnus" <burnus at net-b dot de>
- 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>
- Date: Wed, 4 Jun 2008 21:30:09 +0200
- Subject: Re: [Patch, Fortran] ICE with PROCEDURE using a complicated interface (PR36322 & PR36275)
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=ndGcbfGKfCkDIKQyp9b/KOQ7v10qh77U4vG5IPdebNc=; b=LS+fya1kWOb3DHzwHdOQQbFzUk1HYb00yZt6ttVUxrjsIPjSzgiBdL2o5ecQLrgbr0 gg4NCiQAuJajjv34VdIzUSArxe7XqbMAW4o/mQ1g4m1bFouCqaKmIQoGOPYEuzoB7rQ5 OXMhC990fF8usWI9efztblLp5LMuQskX0HnpY=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=uh38QV5bCIEs18GjoOHoO9ImV/fYVnXcJ/zgT71ZzZEISibx6tlg7zXHPceCM4TLEy xAq7J9ItCsHJwgzO30CJORP47aRLWD+VH9xKrVNzc/hd8prAkPQeX5kl75rNWxlIV+Ks p+kckBBIGo9IyJnPpYNFfqGhjOhVWJY9YfI/g=
- References: <854832d40806031021y598db915kbb69742b0b396dd9@mail.gmail.com> <484589A7.70209@net-b.de> <854832d40806031427h3ee0c8cbj9fb7368870af04af@mail.gmail.com>
>> 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