aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-12-17 14:30:53 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-12-17 14:30:53 +0000
commit6379dfb5fee9253b65af8db5cca6b8a6f71e457e (patch)
treedd75a3b7a7467cbc5216d82bed2901709164e826
parentb1dc39e5ec29e2d587b722efac4e7742ddc581c4 (diff)
downloadgcc-6379dfb5fee9253b65af8db5cca6b8a6f71e457e.zip
gcc-6379dfb5fee9253b65af8db5cca6b8a6f71e457e.tar.gz
gcc-6379dfb5fee9253b65af8db5cca6b8a6f71e457e.tar.bz2
re PR tree-optimization/68946 (ICE at -O3 on x86_64-linux-gnu in both 32- and 64-bit modes (in vect_analyze_stmt, at tree-vect-stmts.c:8013))
2015-12-17 Richard Biener <rguenther@suse.de> PR tree-optimization/68946 * tree-vect-slp.c (vect_slp_analyze_node_operations): Push SLP def type to stmt operands one stmt at a time. * gcc.dg/torture/pr68946.c: New testcase. From-SVN: r231770
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr68946.c24
-rw-r--r--gcc/tree-vect-slp.c30
4 files changed, 48 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 405d8b0..e1c5228 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2015-12-17 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/68946
+ * tree-vect-slp.c (vect_slp_analyze_node_operations): Push
+ SLP def type to stmt operands one stmt at a time.
+
2015-12-17 Pierre-Marie de Rodat <derodat@adacore.com>
* langhooks.h (struct lang_hooks_for_types): New get_bias_field.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e299f0c..976356d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-12-17 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/68946
+ * gcc.dg/torture/pr68946.c: New testcase.
+
2015-12-17 Nathan Sidwell <nathan@acm.org>
* c-c++-common/Wunused-var-13.c: Requires label values.
diff --git a/gcc/testsuite/gcc.dg/torture/pr68946.c b/gcc/testsuite/gcc.dg/torture/pr68946.c
new file mode 100644
index 0000000..3a1cff4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr68946.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-fno-vect-cost-model" } */
+
+int printf (const char *, ...);
+
+int a, b, g;
+short c, e, h, i;
+int f[8];
+void fn1() {
+ short j;
+ for (; a;) {
+ printf("%d", g);
+ b = 7;
+ for (; b >= 0; b--) {
+ i = 1;
+ short k = f[b];
+ e = k ? k : 3;
+ j = (i && (c |= e)) << 3;
+ int l = j, m = 0;
+ h = l < 0 || l >> m;
+ f[b] = h;
+ }
+ }
+}
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 6955e15..7ec2046 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -2221,12 +2221,6 @@ vect_slp_analyze_node_operations (slp_tree node)
if (!vect_slp_analyze_node_operations (child))
return false;
- /* Push SLP node def-type to stmts. */
- FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child)
- if (SLP_TREE_DEF_TYPE (child) != vect_internal_def)
- FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (child), j, stmt)
- STMT_VINFO_DEF_TYPE (vinfo_for_stmt (stmt)) = SLP_TREE_DEF_TYPE (child);
-
bool res = true;
FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), i, stmt)
{
@@ -2234,19 +2228,21 @@ vect_slp_analyze_node_operations (slp_tree node)
gcc_assert (stmt_info);
gcc_assert (STMT_SLP_TYPE (stmt_info) != loop_vect);
- if (!vect_analyze_stmt (stmt, &dummy, node))
- {
- res = false;
- break;
- }
+ /* Push SLP node def-type to stmt operands. */
+ FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), j, child)
+ if (SLP_TREE_DEF_TYPE (child) != vect_internal_def)
+ STMT_VINFO_DEF_TYPE (vinfo_for_stmt (SLP_TREE_SCALAR_STMTS (child)[i]))
+ = SLP_TREE_DEF_TYPE (child);
+ res = vect_analyze_stmt (stmt, &dummy, node);
+ /* Restore def-types. */
+ FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), j, child)
+ if (SLP_TREE_DEF_TYPE (child) != vect_internal_def)
+ STMT_VINFO_DEF_TYPE (vinfo_for_stmt (SLP_TREE_SCALAR_STMTS (child)[i]))
+ = vect_internal_def;
+ if (! res)
+ break;
}
- /* Restore stmt def-types. */
- FOR_EACH_VEC_ELT (SLP_TREE_CHILDREN (node), i, child)
- if (SLP_TREE_DEF_TYPE (child) != vect_internal_def)
- FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (child), j, stmt)
- STMT_VINFO_DEF_TYPE (vinfo_for_stmt (stmt)) = vect_internal_def;
-
return res;
}