[Patch, fortran] PR51976 - [F2003] Support deferred-length character components of derived types (allocatable string length)

Tobias Burnus burnus@net-b.de
Tue Mar 19 21:17:00 GMT 2013

Dear Paul, dear all,

On February 24, 2013 Paul Richard Thomas wrote:
> The attached patch represents progress to date.  It fixes the original
> problem in this PR and allows John Reid's version of
> iso_varying_string/vocabulary_word_count.f90 to compile and run
> correctly.  It even bootstraps and regtests!

Attached is a re-diffed patch; I have additionally fixed some indenting 

Additionally, I have tested the patch - and it fails with 
deferred-length *array* character components. See attached test case. 
Also, the following line of the included test case leaks memory:
     allocate (array(2), source = [t("abcedefg","hi"), t("jkl","mnop")])

I think at least the array bug should be fixed prior committal. (Fixing 
the memory leak and some of the below-mentioned issues would be nice, 
too.) Otherwise, I think the patch looks fine. For completeness, I have 
some naming remarks, which I would also like to considered: 


> However, it doe not fix:
> PR51976 comment #6 and PR51550 - allocate with typespec ICEs
> PR51976 comment #6 FORALL assignment is messed up and ICEs..
> PR47545 the compiler complains about the lack of an initializer for
> the hidden character length field.
> PR45170 will need going through from one end to the other - there is a
> lot of "stuff" here!
> Of these, I consider the fix of the PR47545 problem to be a must and
> the allocate with typespec desirable.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.f90
Type: text/x-fortran
Size: 506 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130319/ecce791f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: deferred-len-comp.diff
Type: text/x-patch
Size: 16857 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130319/ecce791f/attachment-0001.bin>

More information about the Gcc-patches mailing list