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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-07-20
     Ever confirmed|0                           |1

--- Comment #2 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Compiling the code in comment 0 still gives an ICE with gfortran 4.10.0 r212833
(the same ICE as for pr53653):

pr51864.f90: In function 'MAIN__':
pr51864.f90:12:0: internal compiler error: in gfc_conv_array_constructor_expr,
at fortran/trans-expr.c:5668
 allocate(c(8), source=[ a, b ])
 ^

I also get the same ICE with the following code

  call pr53876
end

subroutine pr53876
  IMPLICIT NONE
  TYPE :: individual
    integer :: icomp ! Add an extra component to test offset
    REAL, DIMENSION(:), ALLOCATABLE :: genes
  END TYPE
  CLASS(individual), DIMENSION(:), ALLOCATABLE :: indv, indv1
  allocate (indv(2), source = [individual(1, [99,999]), &
                               individual(2, [999,9999])])
  allocate (indv1(2), source = [indv])
END

If I understand correctly comment 1, this code should be valid. Replacing
'[indv]' with '[indv(1),indv(2)]' does not fix the ICE, but replacing it with
'imdv' does.

Reply via email to