This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Boundaries of arrays with deferred shape


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]