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*
655 Discussions

Compiler errors occurs when emitting 32bit binaries

hyungseok
Beginner
336 Views

I discovered that the latest x86-64 ICX 2024.0.0 emits invalid registers when it generates x86 binaries. 

This error has been identified in 2 opcodes.

 

Buggy code.

```

void bug(int num) {
__asm__(
".intel_syntax noprefix\n"
"enqcmd SP, ZMMWORD PTR [EAX]\n"
"enqcmds SP, ZMMWORD PTR [EAX]\n"
);
}
```

 

Compile Option: -m32

 

Compiled code

```

bug:
push ebp
mov ebp,esp
mov eax,DWORD PTR [ebp+0x8]
enqcmd sp,[bx+si]
enqcmds sp,[bx+si]
pop ebp
ret
```
 
I tested it through godbolt.

https://godbolt.org/z/TqEKnrTYj

 

0 Kudos
4 Replies
Alex_Y_Intel
Moderator
215 Views

Your question has been escalated to our internal team. 

0 Kudos
Alex_Y_Intel
Moderator
187 Views

2024.2 compiler will soon be released, please try it with the newer compiler.

0 Kudos
Alex_Y_Intel
Moderator
105 Views

The issues had been fixed in 2024.2.


"SP" in the original reproducer should be changed to "ESP" to be able to compile successfully with compiler 2024.2:


repro.c

void bug(int num)

{

__asm__(

".intel_syntax noprefix\n"

"enqcmd ESP, ZMMWORD PTR [EAX]\n"

"enqcmds ESP, ZMMWORD PTR [EAX]\n"

);

}


icx -m32 repro.c -S


Assembly output:

.text

.file "repro.c"

.globl bug # -- Begin function bug

.p2align 4, 0x90

.type bug,@function

bug: #

.cfi_startproc

# %bb.0:

#APP


enqcmd (%eax), %esp

enqcmds (%eax), %esp


#NO_APP

retl

.Lfunc_end0:

.size bug, .Lfunc_end0-bug

.cfi_endproc

# -- End function

.ident "Intel(R) oneAPI DPC++/C++ Compiler 2024.2.0 (2024.2.0.20240602)"

.section ".note.GNU-stack","",@progbits




0 Kudos
Alex_Y_Intel
Moderator
105 Views

Please also note that 32-bit support has been deprecated.

 

0 Kudos
Reply