Diagnostic 15123: loop was not vectorized: the freestanding compiler flag prevents vector library calls

Cause:
This diagnostic message comes up when using -ffreestanding compiler option when building the program. This compiler option is used for compiling targets for a freestanding environment. Freestanding environment will have any library calls and program startup doesn't need to happen from main function. Below is an example for this scenario.


Examples:
 

float foo(int *A, int *B, int n){
  int i;
#pragma ivdep
  for 
(i=0;i<n;i++){
    A[i] /= B[i];
  }
}


$ icc example1.cc -ffreestanding -vec-report2 -c
example1.cc(5): (col. 5) remark: loop was not vectorized: the freestanding compiler flag prevents vector library calls

Recommendation:

Not using the -ffreestanding compiler option will avoid this problem and vector library calls won't be hindered. Thus loop vectorizes.

For more complete information about compiler optimizations, see our Optimization Notice.