https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86557
Bug ID: 86557
Summary: missed vectorization with std::vector compared to icc
18
Product: gcc
Version: 8.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: nightstrike at gmail dot com
Target Milestone: ---
ICC 18 is able to vectorize this loop, while GCC 8 is not.
#include <vector>
std::size_t f(std::vector<std::vector<float>> const & v) {
std::size_t ret = 0;
for (std::size_t i = 0; i < v.size(); ++i)
ret += v[i].size();
return ret;
}