https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116460
--- Comment #20 from Richard Biener <rguenth at gcc dot gnu.org> --- Unfortunately the following doesn't reproduce the issue. #include <vector> #include <algorithm> void g(); void f(int nBands, double maxZErr) { for (int iBand = 0; iBand < nBands; iBand++) { g(); std::vector<signed char> noDataCandVec; std::vector<signed char> distCandVec = {0, 1, 10, 100, 5, 6}; for (signed char dist : distCandVec) noDataCandVec.push_back(1); std::sort(noDataCandVec.begin(), noDataCandVec.end(), std::greater<double>()); } } I'll add the preprocessed source.