How can I disable vectorization while using GCC?

PhantomM picture PhantomM · Oct 15, 2011 · Viewed 12k times · Source

I am compiling my code using following command:

gcc -O3 -ftree-vectorizer-verbose=6 -msse4.1 -ffast-math 

With this all the optimizations are enabled.

But I want to disable vectorization while keeping the other optimizations.

Answer

Mat picture Mat · Oct 15, 2011

Most of the GCC switches can be used with a no prefix to disable their behavior. Try with -fno-tree-vectorize (after -O3 on the command line).