https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113358
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Created attachment 57055 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57055&action=edit testcase that does vectorize with openmp though So what is happening is loop invariant motion is not happening with the openmp version, I have not looked into why exactly. BUT you can manually it for the loop and get a vectorized version of the loop.