https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104340
Bug ID: 104340
Summary: Derived type interface Array spec clobbered
Product: gcc
Version: 11.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: river.02.soles at icloud dot com
Target Milestone: ---
Created attachment 52326
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52326&action=edit
A minimum working example for compiler failure on derived type interfaces.
Trying to use gfortran to compile a Fortran program that uses derived types.
gfortran crashes and requests a bug report. The program code
`derived_type_err.f03` that triggers the error is attached.
Another issue can be observed, when the line `EXTERNAL :: COPY_TYPE` is
commented and the `INTERFACE` block that precedes it is uncommented (this is
valid code), gfortran complains about NX not having an implicit type (an
incorrect error message). Executing the following command gives:
$ gfortran -o test derived_type_issue.f03
f951: internal compiler error: gfc_compare_array_spec(): Array spec clobbered
Attempting to explicitly define the `INTERFACE` by commenting out the
`EXTERNAL` line yields a different (incorrect) error raised by the compiler:
$ gfortran -o test derived_type_issue.f03
derived_type_error.f03:35:28:
35 | REAL, DIMENSION(NX) :: X
| 1
Error: Symbol 'nx' at (1) has no IMPLICIT type; did you mean 'n'?
Both of these errors indicate that the semantics of the source code are not
correctly being parsed.