Intel® C++ Compiler Classic Developer Guide and Reference

ID 767249
Date 12/16/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

GAP Message (Diagnostic ID 30535)

Message

Removing Exception-Handling code associated with the loop-body may enable more optimizations for the loop at line %d.

Advice

Loop optimizations could not be performed because of exception-handling code inside the loop body. You can remove the exception-handling code or use different libraries, etc.

Example

Consider the following:

#include <boost/numeric/ublas/vector.hpp> 
#include <boost/numeric/ublas/io.hpp>
 
namespace ublas = boost::numeric::ublas;
 
int main () {
  unsigned size = 1000;   
  ublas::vector<double> dest(size), src(size), arg(src);
 
  for (int i = 0; i < size; ++ i) {
    src(i) = i * 1.2;
    arg(i) = i * 2.3;
  }
   
  // Loop to be vectorized
  dest = src + 1.5 * arg;
 
  return 0; 
};

In this case, the compiler is unable to vectorize the loop at setting O2, the default. Remove the exception-handling code or recode using different libraries.

Verify

Make sure that the restructured code without exception-handling code inside the loop-body follows original program semantics.