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*

ICC/ICX compiler bugs (change registgers)

hyungseok
Beginner
200 Views

I found that ICX 2024.0.0 and ICC 2021.10.0 change registers without any alarm messages.

 

This error has been identified in 3 opcodes (lar, movmskpd, pmovmskb) in ICX and in 6 opcodes (lar, mov, movmskpd, pmovmskb, sldt, str) in ICC.

 

Buggy Code

void bug(int num) {
__asm__(".intel_syntax noprefix\n"
"lar R11, R8W\n"
"mov R10, GS\n"
"movmskpd R9, XMM0\n"
"pmovmskb R10, MM2\n"
"sldt R15\n"
"str R8\n"
);
}

 

Compiled Code (ICX 2024.0.0)

You can reproduce the result through the godbolt: 

https://godbolt.org/z/1Md7Ysv73 

bug:
push rbp
mov rbp,rsp
mov DWORD PTR [rbp-0x4],edi
lar r11,r8
mov r10,gs
movmskpd r9d,xmm0
pmovmskb r10d,mm2
sldt r15
str r8
pop rbp
ret

 

 

Compiled Code (ICC 2021.10.0)

You can reproduce the result through the godbolt: 

https://godbolt.org/z/5os84qzWh 

bug:
push rbp
mov rbp,rsp
sub rsp,0x10
mov DWORD PTR [rbp-0x10],edi
lar r11,r8
mov r10d,gs
movmskpd r9d,xmm0
pmovmskb r10d,mm2
sldt r15d
str r8d
leave
ret

 

 

0 Kudos
2 Replies
Alex_Y_Intel
Moderator
123 Views

I've escalated your problem to our internal team. Please note that ICC has been deprecated and removed from our oneAPI Base Toolkit since later versions in 2023. Please migrate to using ICX compiler instead. 

0 Kudos
Alex_Y_Intel
Moderator
90 Views

This is not a defect. All compilers behave the same https://godbolt.org/z/TEqd7qYh9

0 Kudos
Reply