This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/49802] [F2003, F2008] Wrong code with VALUE, F2008: VALUE with arrays/DIMENSION
- From: "dominiq at lps dot ens.fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 20 Jul 2014 18:41:26 +0000
- Subject: [Bug fortran/49802] [F2003, F2008] Wrong code with VALUE, F2008: VALUE with arrays/DIMENSION
- Auto-submitted: auto-generated
- References: <bug-49802-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49802
--- Comment #8 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> I also confirm that compiling the test in comment #5 gives an ICE
I 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(1),indv(2)])
print *, fun([indv(1),indv(2)])
contains
elemental function fun(x) result(res)
integer :: res
class(individual), intent(in) :: x
res = x%genes(1)
end
END