summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-11 21:01:00 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-11 21:01:00 +0000
commit635bf3aa45823d4cba0d6f0892e0c915cb7cb921 (patch)
treecdb0adbe66fc88a9ace1d03bba0ff77d7399c28d /gcc
parent90a4a5a6078ef29b9b093bc78dac9e84cdab419d (diff)
downloadgcc-635bf3aa45823d4cba0d6f0892e0c915cb7cb921.tar.gz
PR tree-optimization/51485
* tree-vect-data-refs.c (vect_analyze_data_refs): Give up on DRs in call stmts. * g++.dg/vect/pr51485.cc: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182212 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/vect/pr51485.cc14
-rw-r--r--gcc/tree-vect-data-refs.c20
4 files changed, 45 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 26df9488ee5..7668767850d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2011-12-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/51485
+ * tree-vect-data-refs.c (vect_analyze_data_refs): Give up on
+ DRs in call stmts.
+
2011-12-11 Patrick Marlier <patrick.marlier@gmail.com>
* trans-mem.c (ipa_tm_transform_calls_redirect): Do not remove
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 750983887a6..6f2ce63f207 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-12-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/51485
+ * g++.dg/vect/pr51485.cc: New test.
+
2011-12-11 Tobias Burnus <burnus@net-b.de>
PR fortran/50923
diff --git a/gcc/testsuite/g++.dg/vect/pr51485.cc b/gcc/testsuite/g++.dg/vect/pr51485.cc
new file mode 100644
index 00000000000..d57d7596d0e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/vect/pr51485.cc
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+
+struct A { A (); unsigned int a; };
+double bar (A a) throw () __attribute__((pure));
+
+void
+foo (unsigned int x, double *y, A *z)
+{
+ unsigned int i;
+ for (i = 0; i < x; i++)
+ y[i] = bar (z[i]);
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 8111bdc61ac..6a85b7bf4aa 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -2896,6 +2896,26 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo,
return false;
}
+ if (is_gimple_call (stmt))
+ {
+ if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
+ {
+ fprintf (vect_dump, "not vectorized: dr in a call ");
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
+ }
+
+ if (bb_vinfo)
+ {
+ STMT_VINFO_VECTORIZABLE (stmt_info) = false;
+ stop_bb_analysis = true;
+ continue;
+ }
+
+ if (gather)
+ free_data_ref (dr);
+ return false;
+ }
+
/* Update DR field in stmt_vec_info struct. */
/* If the dataref is in an inner-loop of the loop that is considered for