[Bug fortran/88304] [9 Regression] ICE in use_pointer_in_frame, at tree-nested.c:267

anlauf at gmx dot de gcc-bugzilla@gcc.gnu.org
Tue Dec 4 21:55:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88304

--- Comment #7 from Harald Anlauf <anlauf at gmx dot de> ---
(In reply to kargl from comment #6)
> (In reply to Harald Anlauf from comment #5)
> > 
> > A derived type with component initialization (like t_fileinfo) should
> > implicitly get the SAVE attribute, which appears to be lost here.
> > Adding it explicitly removes the ICE.  Thus a front-end issue?
> 
> The F2018 standard (n2146.pdf, p. 78) says
> 
> Explicit initialization in a type declaration statement (8.2)
> overrides default initialization (see NOTE 7.32).  Unlike explicit
> initialization, default initialization does not imply that the object
> has the SAVE attribute.
> 
> HTH

Thanks for pointing this out.  And replacing

    type(t_fileinfo), save :: gattr ! No ICE

by

    type(t_fileinfo)       :: gattr = t_fileinfo() ! No ICE

produces identical code.  So I take back the possible wrong-code issue.
Only the ICE remains.


More information about the Gcc-bugs mailing list