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

ifort 9.1.036 and -check all

tonio
Beginner
1,694 Views
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 :
module m_test
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
Compiling this with -check all will output :
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.
0 Kudos
5 Replies
Steven_L_Intel1
Employee
1,694 Views
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.


0 Kudos
tonio
Beginner
1,694 Views
Thank you Steve.

The html documentation needs to be updated, there's no -check pointer in the check section.
0 Kudos
Steven_L_Intel1
Employee
1,694 Views
We don't update the documentation except at full releases. Please refer to the Release Notes for changes in updates.
0 Kudos
David2
Beginner
1,694 Views

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

0 Kudos
Steven_L_Intel1
Employee
1,694 Views
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.
0 Kudos
Reply