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

simple inline asm makes the compiler hanging..

Gaiger_Chen
New Contributor I
366 Views
Hi

I would like use icc to complie the sample assembly, but the compile time last almost forever
with mcpcom costing one cpu core resource 100%:


#define ASM __asm
#define ENDLINE ;

int main(void)
{
int a, b;

a = 10;

ASM
{
MOV EAX, a ENDLINE
MOV b, EAX ENDLINE
}/*ASM*/

return 0;
}/*main*/


As you watch, I replace ; as ENDLINE , that is make the compile does not complete.
when I use l instead ; , that is normal;
but the code has be compiled normally by VC 8 (VS 2005).

Is there is some restriction by #define replacing on icc ?

thank you.

My environment:
OS :windows 7 (win 6.1 ) with SP1
Intel c++ complier XE 12.0
IDE : VS 2005

cpu : intel i5 2400
board : H61 (it is cheap enough to its performance for me)
0 Kudos
4 Replies
Om_S_Intel
Employee
366 Views
The Intel C++ compiler behaviour ss different in this case. It seems a bug to me.

I have submitted a report to Intel C++ compiler development team. I will update this thread when I have more information on this.

Om
0 Kudos
Om_S_Intel
Employee
366 Views
The issue is fixed in latest Intel C++ Composer XE 2011. The composer is available from "Intel Regiatration and Download Center".
0 Kudos
Om_S_Intel
Employee
366 Views
0 Kudos
levicki
Valued Contributor I
366 Views
While this is a bug, it should be noted that ; is not required in __asm block as an end-of-statement marker.

Rationale:
Assembler (even inline) is not C.
0 Kudos
Reply