[Patch, Fortran] PR57596 - Fix OPTIONAL handling of deferred-length strings

Tobias Burnus burnus@net-b.de
Thu Jun 13 09:13:00 GMT 2013


A rather simple patch. I wonder why we didn't get in trouble before - 
the "*dummy = NULL;" part should affect also other optional allocatable 
dummy arguments.

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

Tobias

PS: Pending patches:
* Unreviewed: Print exception status at STOP, 
http://gcc.gnu.org/ml/fortran/2013-06/msg00077.html
* Uncommitted: Mikael's CLASS+function patch, 
http://gcc.gnu.org/ml/fortran/2013-06/msg00079.html

PPS: The old dump (GCC 4.8, 4.9 w/o patch should be the same) produced:

get (character(kind=1)[1:(integer(kind=4)) _c_val] * * c_val, 
integer(kind=4) * _c_val)
{
       *c_val = 0B;
...
   finally
     {
       *_c_val = .c_val;
     }
}

and with intent(inout):
       .c_val = *_c_val;

-------------- next part --------------
A non-text attachment was scrubbed...
Name: optional-deferred.diff
Type: text/x-patch
Size: 3539 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20130613/8d795ea7/attachment.bin>


More information about the Fortran mailing list