[PATCH] PR fortran/102816 - [12 Regression] ICE in resolve_structure_cons, at fortran/resolve.c:1467

Harald Anlauf anlauf@gmx.de
Fri Oct 22 19:36:23 GMT 2021


Dear Fortranners,

the recently introduced shape validation for array components
in DT constructors did not properly deal with invalid code
created by ingenious testers.

Obvious solution: replace the gcc_assert by a suitable error message.

Regarding the error message: before the shape validation, gfortran
would emit the same error message twice referring to the same line,
namely the bad declaration of the component.  With the attached patch
we get one error message for the bad declaration of the component,
and one for the structure constructor referring to that DT component.
One could easily change that and make the second message refer to the
same as the declaration, giving two errors for the same line.

Comments / opinions?

Regtested on x86_64-pc-linux-gnu.  OK?

Thanks,
Harald

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr102816.diff
Type: text/x-patch
Size: 1631 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20211022/50286280/attachment.bin>


More information about the Gcc-patches mailing list