This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/49795] New: vectorization of conditional code happens only on local variables
- From: "vincenzo.innocente at cern dot ch" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 20 Jul 2011 11:45:51 +0000
- Subject: [Bug tree-optimization/49795] New: vectorization of conditional code happens only on local variables
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49795
Summary: vectorization of conditional code happens only on
local variables
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: vincenzo.innocente@cern.ch
in this example loop1 does not vectorize, loop2 does
const int N=64;
float c[N];
float d[N];
void loop1() {
for (int i=0; i!=N; ++i) {
if (c[i]<0) d[i] = -d[i];
}
}
void loop2() {
for (int i=0; i!=N; ++i) {
float tmp = d[i];
if (c[i]<0) tmp = -tmp;
d[i]=tmp;
}
}