- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I discovered that ICC 2021.10.0 sometimes overlooks memory size directives.
I found that ICC incorrectly checks memory size for 11 opcodes when compiling x64 or x86 binaries.
The buggy code contains 11 opcodes.
void bug(int num) { __asm__(".intel_syntax noprefix\n" "cldemote ZMMWORD PTR [1]\n" "clflush ZMMWORD PTR [1]\n" "clflushopt ZMMWORD PTR [1]\n" "clwb ZMMWORD PTR [1]\n" "invlpg ZMMWORD PTR [1]\n" "prefetch ZMMWORD PTR [1]\n" "prefetchw ZMMWORD PTR [1]\n" "prefetcht0 ZMMWORD PTR [1]\n" "prefetcht1 ZMMWORD PTR [1]\n" "prefetcht2 ZMMWORD PTR [1]\n" "prefetchwt1 ZMMWORD PTR [1]\n" ); } |
Compiled Code
bug: push rbp mov rbp,rsp sub rsp,0x10 mov DWORD PTR [rbp-0x10],edi cldemote BYTE PTR ds:0x1 clflush BYTE PTR ds:0x1 clflushopt BYTE PTR ds:0x1 clwb BYTE PTR ds:0x1 invlpg BYTE PTR ds:0x1 prefetch BYTE PTR ds:0x1 prefetchw BYTE PTR ds:0x1 prefetcht0 BYTE PTR ds:0x1 prefetcht1 BYTE PTR ds:0x1 prefetcht2 BYTE PTR ds:0x1 prefetchwt1 BYTE PTR ds:0x1 leave ret |
You can replay the bug through the godbolt.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ICC has been deprecated and removed from our oneAPI Base Toolkit since later versions in 2023. Please migrate to using ICX compiler instead.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page