This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/58927] New: Despite loop->safelen=INT_MAX / GCC ivdep: loop versioned for vectorization because of possible aliasing
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 30 Oct 2013 18:58:10 +0000
- Subject: [Bug middle-end/58927] New: Despite loop->safelen=INT_MAX / GCC ivdep: loop versioned for vectorization because of possible aliasing
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58927
Bug ID: 58927
Summary: Despite loop->safelen=INT_MAX / GCC ivdep: loop
versioned for vectorization because of possible
aliasing
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: burnus at gcc dot gnu.org
Compiling the testsuite's pr33426-ivdep-4.cc
g++ -std=c++11 -O3 -fopt-info-vec-optimized g++.dg/vect/pr33426-ivdep-4.cc
shows that the C++11 range-based loop has loop versioning, even though it
shouldn't due to GCC ivdep:
g++.dg/vect/pr33426-ivdep-4.cc:13:19: note: loop vectorized
g++.dg/vect/pr33426-ivdep-4.cc:13:19: note: loop versioned for vectorization
because of possible aliasing
g++.dg/vect/pr33426-ivdep-4.cc:13:19: note: loop peeled for vectorization to
enhance alignment
The function is simply:
#include <vector>
template<class T, class T2>
void Loop(T *b, T2 c) {
#pragma GCC ivdep
for (auto &i : *b) {
i *= *c;
}
}
void foo(std::vector<int> *ar, int *b) {
Loop<std::vector<int>, int*>(ar, b);
}