Skip to content

Commit

Permalink
Fix compiler crash on gcore/overview.cpp with ICC 2024.0.2.29 (fixes O…
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Mar 20, 2024
1 parent 39cfaf5 commit b620c87
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gcore/overview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2582,13 +2582,18 @@ GDALResampleConvolutionHorizontal(const T *pChunk, const double *padfWeights,
double dfVal1 = 0.0;
double dfVal2 = 0.0;
int i = 0; // Used after for.
// Intel Compiler 2024.0.2.29 (maybe other versions?) crashes on this
// manually (untypical) unrolled loop in -O2 and -O3:
// https://github.com/OSGeo/gdal/issues/9508
#if !defined(__INTEL_CLANG_COMPILER)
for (; i + 3 < nSrcPixelCount; i += 4)
{
dfVal1 += pChunk[i] * padfWeights[i];
dfVal1 += pChunk[i + 1] * padfWeights[i + 1];
dfVal2 += pChunk[i + 2] * padfWeights[i + 2];
dfVal2 += pChunk[i + 3] * padfWeights[i + 3];
}
#endif
for (; i < nSrcPixelCount; ++i)
{
dfVal1 += pChunk[i] * padfWeights[i];
Expand Down

0 comments on commit b620c87

Please sign in to comment.