[Bug fortran/46678] [4.6 Regression] Wrong code with strings
burnus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Nov 27 11:15:00 GMT 2010
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46678
--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-11-27 10:00:38 UTC ---
I think one needs to define the type as
character(kind=1) string[1:];
(unknown upper bound, as for allocatable arrays) and work with the length as a
separate variable - as we do with arrays. In principle, ts->u.cl can point to
the variable/expression while the type tree should have a NULL_TREE as upper
bound; the string_length tree again can point to the expression (tree).
Currently, the whole stuff is a bit mangled.
At least for allocatable string lengths, I think we have to handle it like
that. For automatic arrays, one could do as before by defining first the length
and then the string variable; however, one should then only define the string
variable once and not twice as one currently does.
More information about the Gcc-bugs
mailing list