https://godbolt.org/z/sSSdjw
You do need -fopenmp of course.
edit:
strangely, it still fails to vectorize the original vector example.