bug of handling complex numbers on Opteron

bug of handling complex numbers on Opteron

yager@netease.com's picture

Here is a very simple program:

#include
#include
typedef std::complex dcomplex;

int main()
{
using namespace std;

dcomplex s(11,22);
dcomplex ss(33,44);
dcomplex dIJ = ss + s;
cerr<<"HAHA:"<
return 0;
}

Apparently the correct result is (44,66), but on Opteron it runs funny,

~/test$ icc aa.cpp && ./a.out
HAHA:(44,66)
~/test$ icc -g aa.cpp && ./a.out
HAHA:(33,44)
~/test$ icc -xW aa.cpp && ./a.out
HAHA:(44,66)
~/test$ icc -g -xW aa.cpp && ./a.out
HAHA:(44,66)
~/test$ icc -g -axW aa.cpp && ./a.out
HAHA:(66,44)
~/test$ icc -axW aa.cpp && ./a.out
HAHA:(66,44)
~/test$ icc -O3 -axW aa.cpp && ./a.out
HAHA:(66,44)
~/test$ icc -O3 -xW aa.cpp && ./a.out
HAHA:(44,66)
~/test$ icc -O3 -xW -ip aa.cpp && ./a.out
HAHA:(44,66)
~/test$ icc -O3 -axW -ip aa.cpp && ./a.out
HAHA:(44,66)

~/test$ icc --version
8.1
~/test$ icc -V
Intel C Compiler for Intel EM64T-based applications, Version 8.1 Build 20050203
Copyright (C) 1985-2005 Intel Corporation. All rights reserved.

icc: Command line error: no files specified; for help type "icc -help"

It seems that it works fine on Pentium 4 and Xeon EM64T CPUs. And the programs complied on Pentium 4 or em64t also runs properly.

1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.