aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-11-09 14:47:09 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-11-09 14:47:09 +0000
commit0b3ecf755196df79c795c8b9bbcb735adbb604d0 (patch)
treecf3f65bdad884a645e8bf1be9f6ea15bef4aca49
parent64900538f13699c0dc3e314ad35d4b172425d964 (diff)
downloadgcc-0b3ecf755196df79c795c8b9bbcb735adbb604d0.zip
gcc-0b3ecf755196df79c795c8b9bbcb735adbb604d0.tar.gz
gcc-0b3ecf755196df79c795c8b9bbcb735adbb604d0.tar.bz2
re PR tree-optimization/68248 (ICE on valid code at -O3 on x86_64-linux-gnu in uniform_vector_p, at tree.c:10807)
2015-11-09 Richard Biener <rguenther@suse.de> PR tree-optimization/68248 * tree-vect-generic.c (expand_vector_operations_1): Handle scalar rhs2. * gcc.dg/torture/pr68248.c: New testcase. From-SVN: r230021
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr68248.c20
-rw-r--r--gcc/tree-vect-generic.c2
4 files changed, 33 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 56c609f..e7d7c4b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2015-11-09 Richard Biener <rguenther@suse.de>
+ PR tree-optimization/68248
+ * tree-vect-generic.c (expand_vector_operations_1): Handle
+ scalar rhs2.
+
+2015-11-09 Richard Biener <rguenther@suse.de>
+
PR tree-optimization/56118
* tree-vectorizer.h (vect_find_last_scalar_stmt_in_slp): Declare.
* tree-vect-slp.c (vect_find_last_scalar_stmt_in_slp): Export.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3809a72..d64a0a2 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2015-11-09 Richard Biener <rguenther@suse.de>
+ PR tree-optimization/68248
+ * gcc.dg/torture/pr68248.c: New testcase.
+
+2015-11-09 Richard Biener <rguenther@suse.de>
+
PR tree-optimization/56118
* gcc.dg/vect/no-tree-sra-bb-slp-pr50730.c: Adjust.
diff --git a/gcc/testsuite/gcc.dg/torture/pr68248.c b/gcc/testsuite/gcc.dg/torture/pr68248.c
new file mode 100644
index 0000000..0e8ab49
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr68248.c
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+
+int a, b, c, d;
+
+int
+fn1 (int p1)
+{
+ return a > 0 ? p1 : p1 >> a;
+}
+
+void
+fn2 ()
+{
+ char e;
+ for (; c; c++)
+ {
+ e = fn1 (!d ^ 2);
+ b ^= e;
+ }
+}
diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c
index c64fdc4..f82b669 100644
--- a/gcc/tree-vect-generic.c
+++ b/gcc/tree-vect-generic.c
@@ -1527,6 +1527,8 @@ expand_vector_operations_1 (gimple_stmt_iterator *gsi)
tree srhs1, srhs2 = NULL_TREE;
if ((srhs1 = ssa_uniform_vector_p (rhs1)) != NULL_TREE
&& (rhs2 == NULL_TREE
+ || (! VECTOR_TYPE_P (TREE_TYPE (rhs2))
+ && (srhs2 = rhs2))
|| (srhs2 = ssa_uniform_vector_p (rhs2)) != NULL_TREE)
/* As we query direct optabs restrict to non-convert operations. */
&& TYPE_MODE (TREE_TYPE (type)) == TYPE_MODE (TREE_TYPE (srhs1)))