Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

allocatable in derived type

tonio
Beginner
353 Views

Hello,

my code works ok with ifort 9.0.021.
I've just installed 9.0.031 and it no more works.
I've found what was going wrong, which can be illustrated with this little example :

program test

type t
real*8, allocatable :: d(:,:)
end type t

type(t) :: tab(2)

call alloc(tab)

contains

subroutine alloc(tab)

type(t), intent(out) :: tab(:)

end subroutine alloc

end program test


I get a segmentation fault.
If
type(t), intent(out) :: tab(:)
is changed to
type(t), intent(inout) :: tab(:)
or
type(t), intent(out) :: tab(2)
it works fine.

What's going on ?
Thanks.

0 Kudos
3 Replies
Steven_L_Intel1
Employee
353 Views
With INTENT(OUT), the compiler is supposed to ensure that all of the allocatable components are deallocated. It is making a mistake apparently while doing so. I have passed this on to the developers. If you choose to file a support request, please reference T65004.
0 Kudos
tonio
Beginner
353 Views
Thank you.
0 Kudos
Steven_L_Intel1
Employee
353 Views
This bug has been fixed for a future update (late May at the earliest.)
0 Kudos
Reply