------- Comment #2 from paul dot richard dot thomas at cea dot fr 2006-09-15 14:16 ------- Created an attachment (id=12276) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12276&action=view) A fix for the problem
The handling of default initializers can never have been quite right. The moment that there is an interface assignement, this is called by ALLOCATE, for example. Adding a dimension(2) array to your structure, ALLOCATE produces, with the patch applied: { void * * ptr.1; ptr.1 = (void * *) &matrix; _gfortran_allocate (ptr.1, 80, 0); } { struct block D.943; struct block block.2; { int4 S.3; S.3 = 1; while (1) { if (S.3 > 2) goto L.2; else (void) 0; block.2.blank[NON_LVALUE_EXPR <S.3> + -1] = 0; S.3 = S.3 + 1; } L.2:; } block.2.r.data = 0B; block.2.c.data = 0B; block.2.no.data = 0B; D.943 = block.2; blassign (matrix, &D.943); } If I now make formal argument a INTENT(OUT), this last block of code is repeated but with a structure assignment this time, rather than blassign! Some furthr sorting out is needed! Paul -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29098