[patch. fortran] PR102595 ICE in var_element, at fortran/decl.c

Jerry D jvdelisle2@gmail.com
Sat Jan 21 01:46:39 GMT 2023


A PARAMETER value is not allowed in a DATA statement, similar to an 
EQUIVALENCE.

The check for this was in gfc_assign_data_value() in data.cc which turns 
out to be too late when trying to assign a zero sized array.

To correct this, the check is moved to match_variable() in primary.cc 
where  a similar check for EQUIVALENCE is already being performed.

Regression tested on x86_64-linux-gnu.  I will create a test case from 
the case presented in the PR which is trivial.  There are already two 
other tests in the test suite that exercise this check.

OK for trunk?

Regards,

Jerry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr102595.diff
Type: text/x-patch
Size: 1189 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20230120/08a04211/attachment.bin>


More information about the Fortran mailing list