https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99693
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Loop unswitching is correctly only turned on at -O3+. So you want to move it to -O2. Note loop unswitching can cause performance problems due to increase of usage of the icache and such.