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*

Optimization bug in icx and icpx

RasmusV
Novice
250 Views

Hey.

I think I have stumbled upon an optimization bug in the Intel C and C++ compilers. I have attached a minimal example consisting of the files

main.c

bug.c

Makefile

The loop structure is still a bit complicated after reducing the example as much as possible. The problem is that the two variables

size_t bbb1;

size_t bbb2;

in bug.c seem to get optimized away or remain uninitialized or something when compiling with -O3.

I ran on 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz with operating system Debian 13 and compiler version Intel(R) oneAPI DPC++/C++ Compiler 2025.3.0 (2025.3.0.20251010).

 

Best regards,

Rasmus

0 Kudos
0 Replies
Reply