This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Boundaries of arrays with deferred shape
- From: Daniel Kraft <domob1812 at gmail dot com>
- To: Fortran List <fortran at gcc dot gnu dot org>
- Date: Fri, 20 Jun 2008 17:10:38 +0200
- Subject: Boundaries of arrays with deferred shape
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:user-agent :mime-version:to:subject:content-type:content-transfer-encoding:from; bh=B8A1ze9odXYaWjIIBDZK9eZKvjXgJkeyGIM08FGqu0g=; b=htZFbTuE1Z7vgGMKCtrkiQsilmpZGDNM+ww31hhmHVLe/PgCyKUy776Vlv4b+nmoQl +BwTHMDtPViT6kqh2pjB+Vw70S3q4CCHsJYJUKRH58qSMixK6sBZL/AiqEDizfYUtlnI AHAOzP5amYIeAceSoGTuW9VF+dyk7bmID/xtw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:user-agent:mime-version:to:subject:content-type :content-transfer-encoding:from; b=no51KbSTi9UM3aFiSn8hdDKe1E4cdxNplUToSuVhBmzWx++3rq+Ti9vLqbn2bA7BtW 0hWKpeqMPg1fu0/9dlz+CgSx7nqX7DR1TPSlEeFQdbTV5J123m6YhkJ0hie22+DtRFlK f8J4isgpVJQ7/3HVCEaUYyp+QVJPRCkTrtmtU=
Hi,
I already feel I've got the auto-deallocation thing near finishing with
finalization, and then only the deallocation of temporary function
results after they've been used will be left.
But at the moment I've got this problem: When finalizing a derived-type
array, I'm building a DO-loop to scalarize finalization of
finalizable/ALLOCATABLE components of the elements of the array. That's
working basically at the moment, but in the loop-builder I'm relying on
as->type==AS_EXPLICIT because I'm currently accessing the boundaries in
the as->lower/as->upper arrays.
I need to handle arrays with deferred shape (like allocated ones) here,
too. A quick gdb check showed me that in this case lower/upper really
contains NULLs. How can I access (during resolution, not trans!) the
array boundaries of *every* array expression? Is this possible or do I
need some magic here, like generating intrinsic-calls or other "ugly"
things?
BTW, at some place I need to generate something like
IF (ALLOCATED (array)) THEN
do-some-finalization-stuff
END IF
For building the ALLOCATED-expression, at the moment I'm doing a
gfc_get_sym_tree ("allocated", ...) call which looks really, really
wrong to me; but so far that's the only partially working solution I
came up with (works basically, but I get some testsuite failures that
look like being caused by that one). How can I do this correctly? I
want a gfc_expr* representing this ALLOCATED-call given array as
gfc_expr*...
Thank you very much, hopefully I can soon submit a really working
finalization patch :)
Daniel
--
Done: Bar-Sam-Val-Wiz, Dwa-Elf-Hum-Orc, Cha-Law, Fem-Mal
Underway: Ran-Gno-Neu-Fem
To go: Arc-Cav-Hea-Kni-Mon-Pri-Rog-Tou