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 _______________________________________________ help-gplusplus mailing list help-gplusplus@gnu.org http://lists.gnu.org/mailman/listinfo/help-gplusplus