- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I updated ifort from a 9.0 version (I don't remember exactly the version) to 9.1.036 on linux.
To compile my code, among other flags I use -check all and there was no problem before updating ifort.
With the new ifort version, the code no longer works. The symptoms could be shown with this little code :
F
forrtl: severe (408): fort: (8): Attempt to fetch from allocatable variable COEF when it is not allocated
Besides, I tried each -check flags separately, and for all of them the code works. Moreover, it works if I use all -check flags together :
-check bounds -check format -check arg_temp_created -check uninit -check output_conversion
Isn't -check all supposed to be the sum of all individual -check flags ?
Why using isalloc works and not allocated() ?
Where is the problem ? code or compiler ?
Thanks a lot.
I updated ifort from a 9.0 version (I don't remember exactly the version) to 9.1.036 on linux.
To compile my code, among other flags I use -check all and there was no problem before updating ifort.
With the new ifort version, the code no longer works. The symptoms could be shown with this little code :
module m_testCompiling this with -check all will output :
implicit none
type t_test
real*8, allocatable :: coef(:)
end type t_test
public :: f_test, t_test
contains
function f_test() result(t)
type(t_test) :: t
print*,isalloc(t%coef)
print*,allocated( t%coef )
allocate( t%coef(1) )
t%coef = 0.D0
end function f_test
logical function isalloc(t)
real*8, allocatable, intent(inout) :: t(:)
isalloc = allocated(t)
end function isalloc
end module m_test
program test
use m_test
implicit none
type(t_test) :: t
t = f_test( )
end program test
F
forrtl: severe (408): fort: (8): Attempt to fetch from allocatable variable COEF when it is not allocated
Besides, I tried each -check flags separately, and for all of them the code works. Moreover, it works if I use all -check flags together :
-check bounds -check format -check arg_temp_created -check uninit -check output_conversion
Isn't -check all supposed to be the sum of all individual -check flags ?
Why using isalloc works and not allocated() ?
Where is the problem ? code or compiler ?
Thanks a lot.
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The new version implements a new run-time check, -check pointer, which complains when you try to fetch from an unallocated pointer. For some reason, it is doing this check for the allocated call when it isn't supposed to - that's a bug and I'll send it to the developers. When you use -check all, you get -check pointer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Steve.
The html documentation needs to be updated, there's no -check pointer in the check section.
The html documentation needs to be updated, there's no -check pointer in the check section.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We don't update the documentation except at full releases. Please refer to the Release Notes for changes in updates.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Doc Fortran
I have found a bug which I think is an expression of the one you describe here... Using check all with allocatable defined types causes problems if the defined types have initialized values.
The problem only occurs on our intel 9.1.X install:
Intel Fortran Compiler for Intel EM64T-based applications, Version 9.1 Build 20061101 Package ID: l_fc_c_9.1.040
It seems to be fixed in:
Intel Fortran Compiler for applications running on Intel 64, Version 10.1 Build 20071116 Package ID: l_fc_p_10.1.011
Can you help me find out if this issue is resolved in all versions of V 10.1.X ? I want to know if the ROCKS INTEL DEVELOPER roll has this bug?
Please see attached code for an example.
Thanks
David
!Compile with: ifort -check all
module types
implicit none
type stupid
integer :: pqr = 2
end type stupid
contains
subroutine does_this
implicit none
type(stupid), allocatable :: test(:)
write(6,*) 'does_this'
end subroutine does_this
end module types
program main
use types
implicit none
! this is okay?
! type(stupid), allocatable :: test(:)
write(6,*) 'running: '
! this is not okay
call does_this
end program main
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As far as I know, it is fixed in all 10.1 versions. I'd be surprised if any current ROCKS roll includes the old 9.1 compiler.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page