[patch, fortran] Fix character length in constructors

Thomas Koenig tkoenig@netcologne.de
Mon Feb 19 22:41:00 GMT 2018


Hello world,

when putting in a seemingly innocent simplification for PR 56342,
I caused a regression in PR 82823, in PACK. The root cause of
this one turned out to be PR 48890, in which structure
constructors containing characters were not handled correctly
if the lengths did not match.

The attached patch fixes that.

Regression-tested. OK for trunk?

Regards

	Thomas

2018-02-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/48890
         PR fortran/83823
         * primary.c (gfc_convert_to_structure_constructor):
         For a constant string constructor, make sure the length
         is correct.

2018-02-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/48890
         PR fortran/83823
         * gfortran.dg/structure_constructor_14.f90: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: structure_constructor_14.f90
Type: text/x-fortran
Size: 741 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20180219/c13cacba/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p2.diff
Type: text/x-patch
Size: 1373 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20180219/c13cacba/attachment-0001.bin>


More information about the Fortran mailing list