diff options
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr83847.c | 32 | ||||
-rw-r--r-- | gcc/tree-vect-data-refs.c | 6 |
4 files changed, 44 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9cf937b..f83d351 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2018-01-16 Richard Sandiford <richard.sandiford@linaro.org> + + * tree-vect-data-refs.c (vect_analyze_data_ref_accesses): + 2018-01-16 Jakub Jelinek <jakub@redhat.com> PR rtl-optimization/86620 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b4f3837..9bc4d7b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2018-01-16 Richard Sandiford <richard.sandiford@linaro.org> + + * gcc.dg/torture/pr83847.c: New test. + 2018-01-16 Jakub Jelinek <jakub@redhat.com> PR rtl-optimization/86620 diff --git a/gcc/testsuite/gcc.dg/torture/pr83847.c b/gcc/testsuite/gcc.dg/torture/pr83847.c new file mode 100644 index 0000000..e42541e --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr83847.c @@ -0,0 +1,32 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=bdver4" { target i?86-*-* x86_64-*-* } } */ + +typedef struct { + struct { + int a; + int b; + } c; +} * d; +typedef struct { + unsigned e; + d f[]; +} g; +g h; +d *k; +int i(int j) { + if (j) { + *k = *h.f; + return 1; + } + return 0; +} +int l; +int m; +int n; +d o; +void p() { + for (; i(l); l++) { + n += o->c.a; + m += o->c.b; + } +} diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 684b7c5..01f7138 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -2923,7 +2923,8 @@ vect_analyze_data_ref_accesses (vec_info *vinfo) data_reference_p dra = datarefs_copy[i]; stmt_vec_info stmtinfo_a = vinfo_for_stmt (DR_STMT (dra)); stmt_vec_info lastinfo = NULL; - if (! STMT_VINFO_VECTORIZABLE (stmtinfo_a)) + if (!STMT_VINFO_VECTORIZABLE (stmtinfo_a) + || STMT_VINFO_GATHER_SCATTER_P (stmtinfo_a)) { ++i; continue; @@ -2932,7 +2933,8 @@ vect_analyze_data_ref_accesses (vec_info *vinfo) { data_reference_p drb = datarefs_copy[i]; stmt_vec_info stmtinfo_b = vinfo_for_stmt (DR_STMT (drb)); - if (! STMT_VINFO_VECTORIZABLE (stmtinfo_b)) + if (!STMT_VINFO_VECTORIZABLE (stmtinfo_b) + || STMT_VINFO_GATHER_SCATTER_P (stmtinfo_b)) break; /* ??? Imperfect sorting (non-compatible types, non-modulo |