[Patch, Fortran] F2003: More ASSOCIATE stuff
Daniel Kraft
d@domob.eu
Mon Aug 16 19:06:00 GMT 2010
Hi all,
here's another ASSOCIATE patch. It shifts handling of the variables and
their initialization to the trans-* phase. This fixes the problems with
array boundaries and implements association to variables. I think most
of the useful stuff should work with this now.
What does not work (at least not in the complicated cases, like the one
commented out in associate_1.f03 for now) is association to strings. I
could not figure this out, and would like to get the basic handling in
this patch in to start cleanly with the remaining other bits :)
What also does not work is parsing of component references if you
associate a variable to a derived-type value; the parser does not yet
know that it should expect something like '%comp' following this name,
and unfortunately the type of the target expression and thus of the
associate-name is not known until resolution in certain cases (I think)
-- and I do not see a solution at the moment, how we can still parse the
component references cleanly before resolution without substantial
reworks (like resolving the variables before parsing the executable
statements -- which should work in theory?). Any ideas? But for now,
I'd also like to leave this open.
And finally, names associated to expressions may not appear in "variable
definition contexts"; currently, this is diagnosed for things like "a =
5" but misses a lot of other cases (i.e., passing to INTENT([IN]OUT)
dummys). I do not think we currently have a general implementation of
"variable definition context" as defined in the standard; do we? Maybe
this would be worthwhile to implement as a follow-up patch, too -- and
in general, not just special-coding the checks for associate names.
What do you think there?
But for now, the test was regtested on GNU/Linux-x86-32. I saw two
failures, namely array_memcpy_3.f90 and bind_c_dts_3.f90 -- but don't
see how those can be related to ASSOCIATE. Is this currently broken?
Or maybe something changed recently and I got caught in a partial svn
update? (Although I don't think so.)
Ok for trunk when this is figured out?
Yours,
Daniel
--
http://www.pro-vegan.info/
--
Done: Arc-Bar-Cav-Ran-Rog-Sam-Tou-Val-Wiz
To go: Hea-Kni-Mon-Pri
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.changelog
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20100816/eca0357e/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.diff
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20100816/eca0357e/attachment-0001.ksh>
More information about the Fortran
mailing list