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

Is it a bug of Intel Fortran Compiler 11?

haifeng2009
Beginner
703 Views
[sectionBody]
Hello,

I am developing a complicated CFD code. During the development, I found that the codes generated by
Intel Fortran 10 and 11 produced different results, and the code from 11 seems obvious wrong. This puzzled
me for some time. Recently, I was able to reproduce the problem in the following simple code.

The expected output from the code is
1. 1. 1. 1. 1. 1. 1. 1.
-2. -2. -2. -2. -2. -2. -2. -2.
-3. -3. -3. -3. -3. -3. -3. -3.

However, the output with compiler 11 is

-1. -1. -1. -1. -1. -1. -1. -1.
-2. -2. -2. -2. -2. -2. -2. -2.
3. 3. 3. 3. 3. 3. 3. 3.


The problem occurs for win32 and x64 with or without optimization. Is it a bug of the compiler or a bug of our coding.

The compiler I have the problem is 11.0.3451.2005.


Thanks,
Haifeng

----------------------------------------------------------------------
module sd_data_mod

    type mydattype
        real,pointer    :: fld(:,:,:,:)
    end type mydattype
    
    type(mydattype)     :: mt

end module sd_data_mod

program main

    use sd_data_mod

    allocate(mt%fld(2,2,2,3))
    mt%fld(:,:,:,1) = 1
    mt%fld(:,:,:,2) = 2
    mt%fld(:,:,:,3) = 3

    call view(mt%fld(:,:,:,2:3),2)
    write(*,'(100f4.0)') mt%fld(:,:,:,1)
    write(*,'(100f4.0)') mt%fld(:,:,:,2)
    write(*,'(100f4.0)') mt%fld(:,:,:,3)
    
! expected correct output are:
!   1.  1.  1.  1.  1.  1.  1.  1.
!  -2. -2. -2. -2. -2. -2. -2. -2.
!  -3. -3. -3. -3. -3. -3. -3. -3.

end program main

subroutine view(fld,ns)
    use sd_data_mod
    integer     :: ns
    real        :: fld(2,2,2,ns)
    
    fld = -fld
    
end subroutine view[/sectionBody]
-----------------------------------------------------------------------
0 Kudos
6 Replies
TimP
Honored Contributor III
703 Views
With 11.1.046 32-bit I have your expected result. with all options I can think of.
0 Kudos
Steven_L_Intel1
Employee
703 Views
11.0.3451.2005 is not the compiler version - that's the Visual Studio integration version. Please download and install 11.1.046 and try your program again.
0 Kudos
haifeng2009
Beginner
703 Views
11.0.3451.2005 is not the compiler version - that's the Visual Studio integration version. Please download and install 11.1.046 and try your program again.

Thenhere is the compiler version I am using: 11.0.061.
0 Kudos
haifeng2009
Beginner
703 Views
Quoting - tim18
With 11.1.046 32-bit I have your expected result. with all options I can think of.

With w_cprof_p_11.1.046, I have the right result. It seems that this is a compiler bug in the old version, and It has been fixed in the current version. Thanks.

0 Kudos
abhimodak
New Contributor I
703 Views
Hi

Which version has this "bug"?

Abhi
0 Kudos
haifeng2009
Beginner
703 Views
Quoting - abhimodak
Hi

Which version has this "bug"?

Abhi

I am using w_cprof_p_11.0.061 which gives the error. So at least this version has the problem, and maybe other versions before and after this vresion.

Haifeng
0 Kudos
Reply