Command line: $ gcc -O[123] -ftree-vectorize gcc.dg/pr44838.c && ./a.out Output: $ /mnt/svn/gcc-trunk/binary-162056-lto-fortran-checking-yes-rtl-df/bin/gcc -O1 -ftree-vectorize pr44838.i $ ./a.out Aborted Tested revisions: r162056 - fail r161659 - fail r161170 - OK
This is caused by revision 161655: http://gcc.gnu.org/ml/gcc-cvs/2010-07/msg00006.html
Confirmed. We end up vectorizing void foo (int *a, int n) { int *lasta = a + n; for (; a != lasta; a++) { *a *= 2; a[1] = a[-1] + a[-2]; } } not seeing the dependence of *a vs a[-1] because via initialize_data_dependence_relation we ask the alias-oracle whether *a may alias a[-1] (which it doesn't). So we end up not computing a dependence distance. May we not use the alias-oracle (on the full ref) here?
Mine.
Author: rguenth Date: Thu Oct 14 15:51:15 2010 New Revision: 165473 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=165473 Log: 2010-10-14 Richard Guenther <rguenther@suse.de> PR tree-optimization/44913 * tree-data-ref.c (disjoint_objects_p): Remove. (dr_may_alias_p): Simplify. Only hand the base object to the alias-oracle. * tree-ssa-alias.c (ptr_deref_may_alias_decl_p): Handle some more trees, bail out instead of asserting. (ptr_derefs_may_alias_p): Likewise. Export. (refs_may_alias_p_1): Handle STRING_CSTs. * tree-ssa-alias.h (ptr_derefs_may_alias_p): Declare. * gcc.dg/torture/pr44913.c: New testcase. Added: trunk/gcc/testsuite/gcc.dg/torture/pr44913.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-data-ref.c trunk/gcc/tree-ssa-alias.c trunk/gcc/tree-ssa-alias.h
Fixed.