When using the following test :
=========== CODE BEGIN ==============
:::::::::::::::::::
test.f90
:::::::::::::::::::

program test

implicit none


integer, dimension(3), parameter :: a=(/1,2,3/)
integer, dimension(3), parameter :: b=(/4,5,6/)
!integer, dimension(6), parameter :: y=(/ a(1), a(2), a(3), b(1), b(2), b(3) /)
integer, dimension(6), parameter :: y=(/ a(:), b(:) /)



print *, "a= ", a
print *, "b= ", b
print *, "y= ", y

end
=============== CODE END ==============


compilation with gfortran fails whith the following message :

____________________
$ gfortran test.f90
 In file test.f90:9

integer, dimension(6), parameter :: y=(/ a(:), b(:) /)
                                                     1
 Internal Error at (1):
 In file test.f90:9

integer, dimension(6), parameter :: y=(/ a(:), b(:) /)
                                                     1
 Initialization expression didn't reduce (1)
__________________________

When the initialization expression is replaced by the commented
way. All works properly.

Did I misunderstand something ? Or this way of initializing
is not supported yet ?

I also tried the "loop" initialization way, but obtained the same
message.
i.e. integer, dimension(6), parameter :: y=(/ (a(i),i=1,size(a)),
(b(i),i=1,size(b) /)


Thanks for help


-- 
           Summary: Error during array initialization with gfortran
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: snordin_ng at yahoo dot fr
 GCC build triplet: x86_64-redhat-linux
  GCC host triplet: x86_64-redhat-linux
GCC target triplet: x86_64-redhat-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28496

Reply via email to