From 84ac01f4ffc83717bc81526e8a65826d6328226b Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 19 Mar 2024 21:40:16 +0100 Subject: [PATCH] Fix compiler crash on gcore/overview.cpp with ICC 2024.0.2.29 (fixes #9508) --- gcore/overview.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcore/overview.cpp b/gcore/overview.cpp index de44132f1671..40fa0933c72c 100644 --- a/gcore/overview.cpp +++ b/gcore/overview.cpp @@ -2582,6 +2582,10 @@ 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]; @@ -2589,6 +2593,7 @@ GDALResampleConvolutionHorizontal(const T *pChunk, const double *padfWeights, dfVal2 += pChunk[i + 2] * padfWeights[i + 2]; dfVal2 += pChunk[i + 3] * padfWeights[i + 3]; } +#endif for (; i < nSrcPixelCount; ++i) { dfVal1 += pChunk[i] * padfWeights[i];