aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndreas Krebbel <krebbel@linux.ibm.com>2018-04-24 12:18:26 +0000
committerAndreas Krebbel <krebbel@gcc.gnu.org>2018-04-24 12:18:26 +0000
commit062c0a7b2f8dc58f8bb7c6d3448866812bfc75c1 (patch)
treeb116ed1346fa4438cf90a3e37d1bd17de2f8163d /gcc
parent4149dd37d914325fd275675b29d39049612b0a76 (diff)
downloadgcc-062c0a7b2f8dc58f8bb7c6d3448866812bfc75c1.zip
gcc-062c0a7b2f8dc58f8bb7c6d3448866812bfc75c1.tar.gz
gcc-062c0a7b2f8dc58f8bb7c6d3448866812bfc75c1.tar.bz2
re PR tree-optimization/85478 (ICE with single element vector)
Fix PR85478 gcc/ChangeLog: 2018-04-24 Andreas Krebbel <krebbel@linux.ibm.com> PR tree-optimization/85478 * tree-vect-loop.c (vect_analyze_loop_2): Do not call vect_grouped_store_supported for single element vectors. gcc/testsuite/ChangeLog: 2018-04-24 Andreas Krebbel <krebbel@linux.ibm.com> PR tree-optimization/85478 * g++.dg/pr85478.C: New test. From-SVN: r259593
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/pr85478.C46
-rw-r--r--gcc/tree-vect-loop.c5
4 files changed, 60 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 933cc29..dcf0d0b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2018-04-24 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ PR tree-optimization/85478
+ * tree-vect-loop.c (vect_analyze_loop_2): Do not call
+ vect_grouped_store_supported for single element vectors.
+
2018-04-24 Richard Biener <rguenther@suse.de>
PR target/85491
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b1dfe4b..8c92593 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2018-04-24 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ PR tree-optimization/85478
+ * g++.dg/pr85478.C: New test.
+
2018-04-23 Eric Botcazou <ebotcazou@adacore.com>
* g++.dg/torture/pr85496.C: New test.
diff --git a/gcc/testsuite/g++.dg/pr85478.C b/gcc/testsuite/g++.dg/pr85478.C
new file mode 100644
index 0000000..4eb4f24
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr85478.C
@@ -0,0 +1,46 @@
+/* { dg-do compile { target { s390*-*-* } } } */
+/* { dg-options "-O3 -march=arch12 -std=c++11 -Wno-return-type" } */
+
+struct a {
+ enum { b };
+};
+struct c {
+ template <typename d, typename e> static void f(d g, e h) {
+ d i;
+ for (; i != g; ++h, ++i)
+ *h = *i;
+ }
+};
+template <int, typename d, typename e> void j(d g, e h) { c::f(g, h); }
+template <int k, typename d, typename e> void l(d g, e h) { j<k>(g, h); }
+template <typename d, typename e> void aa(d g, e h) { l<a::b>(g, h); }
+template <typename> class ab;
+template <> struct ab<float> {
+ _Complex m() { return n; }
+ _Complex n;
+};
+template <> struct ab<long double> {
+ ab(ab<float> g) : n(g.m()) {}
+ _Complex long double n;
+};
+template <int ac, typename o> class p {
+public:
+ template <typename q> p &operator=(const p<ac, q> &);
+ o *ad;
+};
+template <typename o> class r : public p<2, o> {};
+template <int ac, typename o>
+template <typename q>
+p<ac, o> &p<ac, o>::operator=(const p<ac, q> &g) {
+ aa(&g.ad[0], &ad[0]);
+}
+template <typename ae> class s : public r<ae> {
+ template <typename t> s &operator=(const s<t> &);
+};
+template <typename ae>
+template <typename t>
+s<ae> &s<ae>::operator=(const s<t> &g) {
+ p<2, ae>::operator=(g);
+}
+template s<ab<long double>> &s<ab<long double>>::
+operator=(const s<ab<float>> &);
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 7b3009a..4ce721e 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -2492,8 +2492,9 @@ again:
unsigned int size = STMT_VINFO_GROUP_SIZE (vinfo);
tree vectype = STMT_VINFO_VECTYPE (vinfo);
if (! vect_store_lanes_supported (vectype, size, false)
- && ! vect_grouped_store_supported (vectype, size))
- return false;
+ && ! known_eq (TYPE_VECTOR_SUBPARTS (vectype), 1U)
+ && ! vect_grouped_store_supported (vectype, size))
+ return false;
FOR_EACH_VEC_ELT (SLP_INSTANCE_LOADS (instance), j, node)
{
vinfo = vinfo_for_stmt (SLP_TREE_SCALAR_STMTS (node)[0]);