--- Begin Message ---
Subject: |
Vectorization in gcc 4.1.1 |
Date: |
Mon, 02 Jul 2007 14:27:11 -0700 |
User-agent: |
G2/1.0 |
Hi,
I was trying to get gcc to vectorize a simple loop:
#include <vector>
int test(double *x , int size);
int test(double *x, int size)
{
int ret = 1;
std::vector<double> v;
v.resize(size);
double *a = &v[0];
for(int i = 0;i < size; ++i )
{
a[i ] = 1/x[i];
}
}
I get the following message:
test.cpp:13: note: not vectorized: can't determine dependence between
*D.11390_169 and *D.11389_164
test.cpp:13: note: vectorized 0 loops in function.
The details of my Compiler BUILD:
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /sbcimp/build/pd-rhel3/gcc/gcc-4.1.1/configure --
prefix=/sbcimp/run/pd/gcc/4.1.1-32bit --with-gnu-as --with-as=/sbcimp/
run/pd/binutils/2.16.1-32bit/bin/as --with-gnu-ld --with-ld=/sbcimp/
run/pd/binutils/2.16.1-32bit/bin/ld --enable-shared --enable-
threads=posix --with-cpu=i686 --with-tune=i686 --with-arch=i686 --
enable-languages=c,c++ --disable-checking --enable-version-specific-
runtime-libs --enable-__cxa_atexit
Thread model: posix
gcc version 4.1.1
I was a bit surprised as I believe it is a fairly simple loop to
optimize and vectorize. I would appreciate the help.
Regards,
Ramesh
--- End Message ---
--- Begin Message ---
Subject: |
confirm 4a238a307e228fe30eac0196cc76869bb91e1d4e |
If you reply to this message, keeping the Subject: header intact,
Mailman will discard the held message. Do this if the message is
spam. If you reply to this message and include an Approved: header
with the list password in it, the message will be approved for posting
to the list. The Approved: header can also appear in the first line
of the body of the reply.
--- End Message ---