http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57090
--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2013-04-27 21:51:53 UTC --- If in the reduced test I print also the size of x%ib, the output becomes 1 6 expected 1 4 6 -1 1 expected -1 2 3 1 5 expected 1 4 5 1 5 expected 1 4 5 This also explains the failure of alloc_comp_constructor_1.f90. With the following changes --- /opt/gcc/for_work/gcc/testsuite/gfortran.dg/alloc_comp_constructor_1.f90 2010-04-06 17:08:13.000000000 +0200 +++ alloc_comp_constructor_1_db_2.f90 2013-04-27 23:50:22.000000000 +0200 @@ -40,7 +40,8 @@ Program test_constructor if (any(lbound(x%a) /= lbound(y))) call abort() if (any(ubound(x%a) /= ubound(y))) call abort() if (any(x%a /= y)) call abort() - if (size(x%q) /= 2) call abort() + print *, size(x%q) +! if (size(x%q) /= 2) call abort() do i = 1, 2 if (any(x%q(i)%a /= foo%a)) call abort() end do @@ -81,7 +82,8 @@ contains if (any(lbound(x%a) /= lbound(y))) call abort() if (any(ubound(x%a) /= ubound(y))) call abort() if (any(x%a /= y)) call abort() - if (size(x%q) /= 2) call abort() + print *, size(x%q) +! if (size(x%q) /= 2) call abort() do i = 1, 2 if (any(x%q(i)%a /= foo%a)) call abort() end do the test passes and output 3 3