Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
746 Discussions

ICX/ICC compiler Assembly code parsing errors.

hyungseok
Beginner
578 Views

I found that ICX 2024.0.0 and ICC 2021.10.0 identified memory operands as immediate value.

 

This error has been identified in 5 opcodes (loop, loope, loopne, jecxz, jrcxz).

Also, ICX and ICC have same errors when it generates x86 and x64 binaries.

 

Buggy Code

void bug(int num) {
__asm__(".intel_syntax noprefix\n"
"loop XMMWORD PTR [1]\n"
"loope XMMWORD PTR [1]\n"
"loopne XMMWORD PTR [1]\n"
 
"jrcxz XMMWORD PTR [1]\n"
"jecxz YMMWORD PTR [1]\n"
);
}

 

Compiled Code

bug:
push rbp
mov rbp,rsp
sub rsp,0x10
mov DWORD PTR [rbp-0x10],edi
loop d <bug+0xd>
R_X86_64_PC8 *ABS*
loope f <bug+0xf>
R_X86_64_PC8 *ABS*
loopne 11 <bug+0x11>
R_X86_64_PC8 *ABS*
 
jrcxz f <bug+0xf>
R_X86_64_PC8 *ABS*
jecxz 12 <bug+0x12>
R_X86_64_PC8 *ABS*
leave
ret

 

You can reproduce the errors through godbolt site.

ICX: https://godbolt.org/z/1TPMYMYEv  

ICC: https://godbolt.org/z/cWqbbTdEh  

0 Kudos
2 Replies
Alex_Y_Intel
Moderator
472 Views

I've escalated your issue to our internal engineering team.

0 Kudos
Alex_Y_Intel
Moderator
437 Views

All compilers ICC/ICX/GCC generate the same thing. It is not a bug.

https://godbolt.org/z/GMP7TcTeh

0 Kudos
Reply