[Patch, Fortran] PR56138 - fix deferred-length character funcs w/o result variable

Tobias Burnus burnus@net-b.de
Tue Jan 29 22:36:00 GMT 2013


For allocatable string lengths (deferred length strings), the current 
code generates a local integer variable to which the the length is assigned.

For some reason, that doesn't work for some functions which do not use a 
result variable - leading to failures as the pass-by-reference variable 
is not dereferenced. That's fixed by the attached patch. I have to admit 
that I do not understand why it works without the patch for the examples 
in gfortran.dg/allocatable_function_5.f90, where - for some tests - also 
no result variable is used.

Build and regtested on x86-64-gnu-linux.
OK for the trunk?

Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: alloc-length-func.diff
Type: text/x-patch
Size: 1617 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20130129/2d07de8c/attachment.bin>


More information about the Fortran mailing list