This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
bug in Intel V7 Linux compiler?
- From: GATMKORN at aol dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 9 Feb 2003 08:51:41 EST
- Subject: bug in Intel V7 Linux compiler?
-enclosure has what I think is a bug description for the Intel/Linux compiler
V7.
best regasds GAK
- I get wrong results when compiling
double relval[n] ;
cadd: relval[gjj+1]+=relval[gjj++] ;
with the Intel/Linux compiler, using
icc -c -march=pentium4 -O2 adder2.c
Substituting -S for -c, my Intel/Linux compiler (Version 7, Build 2002 1021 Z) produces
cadd:
..B1.1: # Preds ..B1.0
movl gjj, %edx #5.37
fldl relval+16(,%edx,8) #5.22 is +16 correct??
faddl relval(,%edx,8) #5.22
fstpl relval+16(,%edx,8) #5.22 is +16 correct??
lea 1(%edx), %eax #5.37
movl %eax, gjj #5.37
ret #5.46
.align 4,0x90
But
gcc -S -march=pentium4 -O3 -pipe -fomit-frame-pointer adder2.c
produces:
cadd:
movl gjj, %ecx
movl $relval, %eax
fldl (%eax,%ecx,8)
faddl 8(%eax,%ecx,8)
fstpl 8(%eax,%ecx,8)
addl $1, %ecx
movl %ecx, gjj
ret
.Lfe1:
.size cadd,.Lfe1-cadd
.align 2
This is different. The gcc compiler produces correct results in my (much larger)
application, and the Intel compiler does not. Am I doing something wrong, or is
this a compiler bug?
Best regards
Granino A. KORN (professor Emeritus, U. of AZ)
gatmkorn@aol.com