Closed
Description
#define _GLIBCXX_ASSERTIONS
#include <vector>
void foo(std::vector<double> &vec)
{
auto count = size(vec);
for (decltype(count) i = 0; i != count; ++i)
vec[i] += 1;
}
-mllvm -enable-constraint-elimination
does not help.
With i < count
bounds check is eliminated.
https://godbolt.org/z/s6Gbsqvor