https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81647
amker at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Target|aarch64 |aarch64,x86_64 --- Comment #2 from amker at gcc dot gnu.org --- So the same issue happens on x86_64 too: $ ./g++ -O3 -fdump-tree-optimized uneq.cc -o uneq.O3.exe -mavx2 $ ./uneq.O3.exe $ echo $? 1 And: $ ./g++ -O2 -fdump-tree-optimized uneq.cc -o uneq.O2.exe -mavx2 $ ./uneq.O2.exe $ echo $? 0 Note I increased iteration number to get it vectorized.