https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110472
--- Comment #2 from Ryan Holt <ryanpholt at me dot com> --- (In reply to Andrew Pinski from comment #1) > I think it is just wrong iv-opt choices. > > Works just fine on aarch64-linux-gnu too: > ubuntu@ubuntu:~/src/upstream-gcc-aarch64\# ~/upstream-gcc/bin/gcc t4.c -O2 > -fopenmp > ubuntu@ubuntu:~/src/upstream-gcc-aarch64\# ./a.out ;echo > time: 15.191220 > ubuntu@ubuntu:~/src/upstream-gcc-aarch64\# ~/upstream-gcc/bin/gcc t4.c -O2 > -fopenmp -fwrapv > ubuntu@ubuntu:~/src/upstream-gcc-aarch64\# ./a.out ;echo > time: 18.854280 > ubuntu@ubuntu:~/src/upstream-gcc-aarch64\# ./a.out ;echo > time: 16.705876 > ubuntu@ubuntu:~/src/upstream-gcc-aarch64\# ~/upstream-gcc/bin/gcc t4.c -O2 > -fopenmp > ubuntu@ubuntu:~/src/upstream-gcc-aarch64\# ./a.out ;echo > time: 17.491387 > ubuntu@ubuntu:~/src/upstream-gcc-aarch64\# ./a.out ;echo > time: 17.519264 I forgot to explicitly call out that I can only reproduce the big speedup without fwrapv when compiling with -O3. I noticed you were using O2 on aarch64-linux-gnu.