Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

bug of handling complex number in ICC when using "-O3 -ip" on IA64

yager
Beginner
274 Views

testcomplex.cpp:

#include
int main()
{
using namespace std;
complex < double > c(1,2);
double d[2];
d[0] = c.real();
d[1] = c.imag();
return 0;
}

Compile it,

icc -V -O3 -tpp2 -ip testcomplex.cpp
Intel C Itanium Compiler for Itanium-based applications
Version 9.0 Build 20050430 Package ID: l_cc_p_9.0.021
Copyright (C) 1985-2005 Intel Corporation. All rights reserved.

Edison Design Group C/C++ Front End, version 3.4.1 (Apr 29 2005 17:52:57)
Copyright 1988-2004 Edison Design Group, Inc.

(0): internal error: 20000_1

compilation aborted for testcomplex.cpp (code 4)

But old ICC works fine,

/opt/intel_cc_80/bin/icc -V -O3 -tpp2 -ip testcomplex.cpp
Intel C Itanium Compiler for Itanium-based applications
Version 8.1 Build 20050518 Package ID: l_cc_pc_8.1.032
Copyright (C) 1985-2005 Intel Corporation. All rights reserved.

Edison Design Group C/C++ Front End, version 3.3 (May 19 2005 08:33:56)
Copyright 1988-2003 Edison Design Group, Inc.

GNU ld version 2.15.92.0.2 20040927
Supported emulations:
elf64_ia64
elf_i386
i386linuxh

==============================================

Now add the following at the beginning,

#include < vector >
#include < iostream >

and the following before "return 0;",

vector < complex < double > > vc;
vc.resize(5);
double vd[10];
for (int i=0; i<5; i++) vc = sqrt(complex < double > (-i));
for (int i=0; i<5; i++) vd[i*2] = vc.real();
for (int i=0; i<5; i++) vd[i*2+1] = vc.imag();
for (int i=0; i<10; i++) cout << vd << " ";
cout << endl;

Then both versions refuse to work,

/opt/intel_cc_80/bin/icc -V -O3 -tpp2 -ip testcomplex.cpp
Intel C Itanium Compiler for Itanium-based applications
Version 8.1 Build 20050518 Package ID: l_cc_pc_8.1.032
Copyright (C) 1985-2005 Intel Corporation. All rights reserved.

Edison Design Group C/C++ Front End, version 3.3 (May 19 2005 08:33:56)
Copyright 1988-2003 Edison Design Group, Inc.


FATAL ERROR : Compiler Internal Error
compilation aborted for testcomplex.cpp (code 2)

icc -V -O3 -tpp2 -ip testcomplex.cpp Intel C Itanium Compiler for
Itanium-based applications
Version 9.0 Build 20050430 Package ID: l_cc_p_9.0.021
Copyright (C) 1985-2005 Intel Corporation. All rights reserved.

Edison Design Group C/C++ Front End, version 3.4.1 (Apr 29 2005 17:52:57)
Copyright 1988-2004 Edison Design Group, Inc.

(0): internal error: 20000_1

compilation aborted for testcomplex.cpp (code 4)

Message Edited by yager@netease.com on 06-25-2005 04:59 PM

 

0 Kudos
0 Replies
Reply