Search code examples
gccvectorizationssesimdauto-vectorization

How can I disable vectorization while using GCC?


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.


Solution

  • 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).