This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/28496] New: Error during array initialization with gfortran
- From: "snordin_ng at yahoo dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Jul 2006 17:15:42 -0000
- Subject: [Bug fortran/28496] New: Error during array initialization with gfortran
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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