- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found the following bug in compiling by ifort 10.1.
-O3 gives a wrong answer.
I hope that a bug fix will be done as soon as possible.
K. Iwano
***
implicit real*8 (a-h,o-z)
c
parameter(nn0=4,nz0=4)
parameter(n=1,nb=n*2,nbm=nb-1,num=2**nb-1)
c
common /jg/ jg4(-nn0-1:nn0+1,-nz0-1:nz0+1)
c
open(60,file='test.out')
c
write(60,*) 'block_1sites'
write(60,*) 'num, nbm=',num,nbm
c
jg4=0
c
do i=0,num
do ib=0,nbm,2
write(60,*) i, ib, ishft(i,-ib), iand(ishft(i,-ib),1)
enddo
enddo
c
stop
end
-O3 gives a wrong answer.
I hope that a bug fix will be done as soon as possible.
K. Iwano
***
implicit real*8 (a-h,o-z)
c
parameter(nn0=4,nz0=4)
parameter(n=1,nb=n*2,nbm=nb-1,num=2**nb-1)
c
common /jg/ jg4(-nn0-1:nn0+1,-nz0-1:nz0+1)
c
open(60,file='test.out')
c
write(60,*) 'block_1sites'
write(60,*) 'num, nbm=',num,nbm
c
jg4=0
c
do i=0,num
do ib=0,nbm,2
write(60,*) i, ib, ishft(i,-ib), iand(ishft(i,-ib),1)
enddo
enddo
c
stop
end
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please be more specific - when I try this with a current 10.1, I get the same result from -O3 as I do from lower levels.
Which specific ifort do you have? Please show the command line you use, adding -V to display the version, then show running the program with the good and bad results.
Which specific ifort do you have? Please show the command line you use, adding -V to display the version, then show running the program with the good and bad results.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much for your concern.
Below I show the requested results, with the replacement
of the file output with the standard output. As you will see
easily, the latter is correct.
[***@*** ~]$ ifort -O3 -V test.f
Intel Fortran Compiler for applications running on Intel 64, Version 10.1 Build 20080112 Package ID: l_fc_p_10.1.012
Copyright (C) 1985-2007 Intel Corporation. All rights reserved.
Intel Fortran 10.1-2041
test.f(13): (col. 7) remark: LOOP WAS VECTORIZED.
GNU ld version 2.15.92.0.2 20040927
[***@*** ~]$ ./a.out
block_1sites
num, nbm= 3 1
0 0 0 0
1 0 0 0
2 0 0 0
3 0 0 0
[***@*** ~]$ ifort -O0 -V test.f
Intel Fortran Compiler for applications running on Intel 64, Version 10.1 Build 20080112 Package ID: l_fc_p_10.1.012
Copyright (C) 1985-2007 Intel Corporation. All rights reserved.
Intel Fortran 10.1-2041
GNU ld version 2.15.92.0.2 20040927
[***@*** ~]$ ./a.out
block_1sites
num, nbm= 3 1
0 0 0 0
1 0 1 1
2 0 2 0
3 0 3 1
Below I show the requested results, with the replacement
of the file output with the standard output. As you will see
easily, the latter is correct.
[***@*** ~]$ ifort -O3 -V test.f
Intel Fortran Compiler for applications running on Intel 64, Version 10.1 Build 20080112 Package ID: l_fc_p_10.1.012
Copyright (C) 1985-2007 Intel Corporation. All rights reserved.
Intel Fortran 10.1-2041
test.f(13): (col. 7) remark: LOOP WAS VECTORIZED.
GNU ld version 2.15.92.0.2 20040927
[***@*** ~]$ ./a.out
block_1sites
num, nbm= 3 1
0 0 0 0
1 0 0 0
2 0 0 0
3 0 0 0
[***@*** ~]$ ifort -O0 -V test.f
Intel Fortran Compiler for applications running on Intel 64, Version 10.1 Build 20080112 Package ID: l_fc_p_10.1.012
Copyright (C) 1985-2007 Intel Corporation. All rights reserved.
Intel Fortran 10.1-2041
GNU ld version 2.15.92.0.2 20040927
[***@*** ~]$ ./a.out
block_1sites
num, nbm= 3 1
0 0 0 0
1 0 1 1
2 0 2 0
3 0 3 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks - I can reproduce this now. It requires that the compiler do vectorization on the loop. What I find very strange, and you obviously saw this too, is that removing the assignment to jg4 prevents vectorization and therefore the bug does not appear, even though jg4 is not used elsewhere in the program. I can reproduce this on IA-32 if I use -xW or higher and it doesn't need -O3 there.
I have escalated this to development to be fixed, but the priority will be lower because you did not file a support request with Intel Premier Support. If you want to do that, please add a reference to "T84154-CP".
I have escalated this to development to be fixed, but the priority will be lower because you did not file a support request with Intel Premier Support. If you want to do that, please add a reference to "T84154-CP".

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