Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.
29314 Discussions

Serious bug in SELECT CASE - Intel Fortran Compiler on Intel 64

e745200
Beginner
538 Views
I think I came across a serious bug in how Intel Fortran Intel 64 Compiler Professional deals with SELECT CASE. 

The problem arises when using a CASE in the form :       
   CASE (:max,value,min:) 
None of the specified values will be matched correctly. 
The error does not occur when using        
   CASE (:max,min:)  
A former 32 bit version I used to work with, works fine. 

Here is my sample test, with the different results given by the two versions of the compiler.

$ cat tcase2.f90
INTEGER, DIMENSION(5) :: ival=(/ -5,-3,0,3,5 /)
INTEGER :: i , ik
  DO i=1,5
    ik=ival(i)
    SELECT CASE(ik)
      CASE (:-5,0,5:)
           write (*,*) ik,' special case '
      CASE DEFAULT
           write (*,*) ik,'       default case '
    END SELECT
  END DO
END

$ ifort -logo  tcase2.f90 -o tcase2 && tcase2
Intel Fortran Compiler Professional for applications running on IA-32, Version 11.0    Build 20081105 Package ID: l_cprof_p_11.0.074
...
 Intel Fortran 11.0-1558
GNU ld version 2.17.50.0.6-12.el5 20061020
          -5  special case
          -3        default case
           0  special case
           3        default case
           5  special case


$ ifort64 -logo  tcase2.f90 -o tcase2 && tcase2
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1    Build 20091012 Package ID: l_cprof_p_11.1.059
...
 Intel Fortran 11.1-2620
GNU ld version 2.17.50.0.6-12.el5 20061020
          -5        default case
          -3        default case
           0        default case
           3        default case
           5        default case


Has this been fixed since the date of the build I have used  (20091012) ?
Thanks.


G.M.
0 Kudos
2 Replies
Kevin_D_Intel
Employee
538 Views

Appears to be an optimization related bug introduced in 11.1. The program produces expected results with 11.1 with no optimizations (-O0). I'll report to the appropriate compiler component Development team and keep this post updated as I learn more.

(Internal tracking id: DPD200148788)

(Resolution Update on 4/21/2010): This defect is fixed in the Intel Fortran Compiler Professional Edition 11.1 Update 5 (11.1.069 - Linux).


$ ifort -V u70738.f90 && a.out
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20091130 Package ID: l_cprof_p_11.1.064
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.

Intel Fortran 11.1-2649
GNU ld version 2.17.50.0.6-5.el5 20061020
-5 default case
-3 default case
0 default case
3 default case
5 default case

$ ifort -V -O0 u70738.f90 && a.out
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20091130 Package ID: l_cprof_p_11.1.064
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.

Intel Fortran 11.1-2649
GNU ld version 2.17.50.0.6-5.el5 20061020
-5 special case
-3 default case
0 special case
3 default case
5 special case
0 Kudos
e745200
Beginner
538 Views
Thanks, for your prompt answer.

You are right, I tried with no optimizations and it worked fine. Good to know.

Not to renounce to a minimum level of optimization, while waiting for the fix, I'll try to split the cases so that the misfunction does not occur.

However, I would have never expected such a kind of regression trouble with a Professional Compiler by Intel ...

Regards
G.M.
0 Kudos
Reply