[Patch, part1] PR fortran/49278 - ICE when combining DATA with default initialization
Harald Anlauf
anlauf@gmx.de
Mon Mar 1 22:15:26 GMT 2021
Dear all,
the present PR has two issues. The first one, addressed by this patch,
was about accepting invalid code where a variable appeared both in a
declaration with PARAMETER as well as in a DATA statement, which could
lead to an ICE. We now reject this.
(There is a separate issue about combining default initialization with
DATA leading to a wrong constructor and thus wrong code. I'd prefer to
have this addressed separately.)
Regtested on x86_64-pc-linux-gnu. OK for mainline?
Thanks,
Harald
PR fortran/49278 - ICE when combining DATA with default initialization
A variable with the PARAMETER attribute may not appear in a DATA statement.
gcc/fortran/ChangeLog:
PR fortran/49278
* data.c (gfc_assign_data_value): Reject variable with PARAMETER
attribute in DATA statement.
gcc/testsuite/ChangeLog:
PR fortran/49278
* gfortran.dg/parameter_data.f90: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr49278-part1.patch
Type: text/x-patch
Size: 1218 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210301/bfcca7e4/attachment.bin>
More information about the Gcc-patches
mailing list