https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86322
kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kargl at gcc dot gnu.org --- Comment #2 from kargl at gcc dot gnu.org --- (In reply to Jürgen Reuter from comment #0) > The following example from c.l.f. July 12, 2016 gives an ICE in the actual > gfortran trunk, 9.0.0. This is the ICE from gfortran: > $ gfortran f08_4.f90 > f951: internal compiler error: in record_reference, at cgraphbuild.c:64 > libbacktrace could not find executable to open > Please submit a full bug report, > with preprocessed source if appropriate. > See <https://gcc.gnu.org/bugs/> for instructions. > > > The code should be rejected apparently, as it violates F2008 C568. > Ifort rejects it with the following message: > error #8121: A data-stmt-object shall not be a subobject of a pointer. [I] > data c%i /b%i/ > > program p > type a > integer i > end type a > type(a), target, save :: b > type(a), pointer :: c > data b%i /42/ > data c%i /b%i/ > print *, c%i > end Yes, the code should be rejected. The location in data.c where one needs to do the check is easy enough to find. The correctly written code isprogram p type a integer i end type a type(a), target, save :: b type(a), pointer :: c data c /b/ b%i = 42 print *, c%i end