https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115070
Paul Thomas <pault at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fxcoudert at gmail dot com, | |pault at gcc dot gnu.org --- Comment #3 from Paul Thomas <pault at gcc dot gnu.org> --- (In reply to anlauf from comment #2) > Replacing the scalar argument 'obs' by something with rank > 0 avoids the > ICE, > but then assumed-rank is not accepted with intent(out). Another bug... The tree output with 12-branch is: __attribute__((fn spec (". r w "))) void __copy_my_mod_My_type (struct my_type & restrict src, struct my_type & restrict dst) { *dst = *src; } __attribute__((fn spec (". w "))) void my_sub (struct __class_my_mod_My_type_t & restrict obs) { c_char fpstate.0[33]; try { _gfortran_ieee_procedure_entry ((void *) &fpstate.0); if (obs->_vptr->_final != 0B) { { struct array00_my_type desc.1; desc.1.dtype = {.elem_len=4, .rank=0, .type=5}; desc.1.data = (void * restrict) obs->_data; desc.1.span = (integer(kind=8)) desc.1.dtype.elem_len; obs->_vptr->_final (&desc.1, obs->_vptr->_size, 0); } } (void) __builtin_memcpy ((void *) obs->_data, (void *) obs->_vptr->_def_init, (unsigned long) obs->_vptr->_size); } finally { _gfortran_ieee_procedure_exit ((void *) &fpstate.0); } } 13- through 15-branches lack the default copy of the default initializer. This disappeared with the fix for pr112407 and is required by the standard if the derived type has no default initializer. This suggests a workaround, which indeed "works": type my_type integer :: a = 0 end type my_type I cannot see anything in the ieee procedures that would cause this but then I know zip-all about ieee. Putting Francois-Xavier in copy in the hope that he can shed some light. Cheers Paul