diff options
author | Ira Rosen <irar@il.ibm.com> | 2005-03-08 11:12:00 +0000 |
---|---|---|
committer | Ira Rosen <irar@gcc.gnu.org> | 2005-03-08 11:12:00 +0000 |
commit | 6cd3dd5b400118501adb120511128e772494bfda (patch) | |
tree | 30d5b23102a5d34d1cd60781d1132cca58e12209 | |
parent | e561e5685285946d787a7e185b7739685fdecb53 (diff) | |
download | gcc-6cd3dd5b400118501adb120511128e772494bfda.zip gcc-6cd3dd5b400118501adb120511128e772494bfda.tar.gz gcc-6cd3dd5b400118501adb120511128e772494bfda.tar.bz2 |
tree-vect-analyze.c (vect_object_analysis): Analyze initial condition of access function instead of base.
* tree-vect-analyze.c (vect_object_analysis): Analyze initial
condition of access function instead of base.
From-SVN: r96092
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/pr20122.c | 38 | ||||
-rw-r--r-- | gcc/tree-vect-analyze.c | 7 |
4 files changed, 52 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d525af9..192220b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-03-08 Ira Rosen <irar@il.ibm.com> + + PR tree-optimization/20122 + * tree-vect-analyze.c (vect_object_analysis): Analyze initial + condition of access function instead of base. + 2005-03-07 Jeff Law <law@redhat.com> Steven Bosscher <stevenb@suse.de> diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8073879..5ad5eed 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2005-03-08 Ira Rosen <irar@il.ibm.com> + + * gcc.dg/vect/pr20122.c: New test. + 2005-03-07 Jeff Law <law@redhat.com> * gcc.dg/tree-ssa/20030821-1.c: Verify that the computed goto diff --git a/gcc/testsuite/gcc.dg/vect/pr20122.c b/gcc/testsuite/gcc.dg/vect/pr20122.c new file mode 100644 index 0000000..ff6ec75 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr20122.c @@ -0,0 +1,38 @@ +/* { dg-require-effective-target vect_int } */ + +#include <stdarg.h> +#include "tree-vect.h" + +typedef short ashort __attribute__ ((__aligned__(16))); +ashort Kernshort[24]; +static void VecBug(ashort Kernel[8][24]) __attribute__((noinline)); +static void VecBug(ashort Kernel[8][24]); + +/* Doesn't occur of only inner-loop. */ +static void VecBug(ashort Kernel[8][24]) +{ + int k,i; + for (k = 0; k<8; k++) + for (i = 0; i<24; i++) + Kernshort[i] = Kernel[k][i]; +} + +int main (int argc, char **argv) +{ + check_vect (); + + ashort Kernel[8][24]; + int k,i; + + for (k = 0; k<8; k++) + for (i = 0; i<24; i++) + Kernel[k][i] = 0; + + VecBug(Kernel); + + return 0; +} + + +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */ + diff --git a/gcc/tree-vect-analyze.c b/gcc/tree-vect-analyze.c index 4736f1b..3744504 100644 --- a/gcc/tree-vect-analyze.c +++ b/gcc/tree-vect-analyze.c @@ -1654,10 +1654,11 @@ vect_object_analysis (tree memref, tree stmt, bool is_read, fprintf (vect_dump, "not vectorized: ptr is loop invariant."); return NULL_TREE; } - /* Since there exists DR for MEMREF, we are analyzing the base of - handled component, which not necessary has evolution in the + /* Since there exists DR for MEMREF, we are analyzing the init of + the access function, which not necessary has evolution in the loop. */ - address_to_analyze = TREE_OPERAND (base, 0); + address_to_analyze = initial_condition_in_loop_num (access_fn, + loop->num); } /* 3.3 set data-reference structure for MEMREF. */ |