Diagnostic 15042: Pragma Supersedes Previous Setting


This diagnostic message comes when the parameters of the pragma contradicts each other. In this case the #pragma loop count has two clauses, avg() and max(). But max() parameter is lesser than the avg() clause value. Below is an example for this scenario.


void foo(float *A, int n){
  int i;
#pragma loop count avg(30) max(10)
  for (i=0;i<n;i++){
    A[i] = i;

$ icpc -vec-report6 example22.cc -c
example22.cc(4): (col. 3) remark: pragma supersedes previous setting
example22.cc(5): (col. 5) remark: vectorization support: reference A has unaligned access
example22.cc(5): (col. 5) remark: vectorization support: unaligned access used inside loop body
example22.cc(4): (col. 3) remark: LOOP WAS VECTORIZED


Make sure the max() clause is always greater than avg() clause value.