re PR tree-optimization/92596 (ICE in exact_div, at poly-int.h:2162 since r278406)
authorRichard Biener <rguenther@suse.de>
Thu, 21 Nov 2019 15:01:17 +0000 (15:01 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 21 Nov 2019 15:01:17 +0000 (15:01 +0000)
2019-11-21  Richard Biener  <rguenther@suse.de>

PR tree-optimization/92596
* tree-vect-slp.c (vect_build_slp_tree): Fix pasto.

* gcc.dg/torture/pr92596-1.c: New testcase.

From-SVN: r278555

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr92596-1.c [new file with mode: 0644]
gcc/tree-vect-slp.c

index 063cc01..5ffe57d 100644 (file)
@@ -1,3 +1,8 @@
+2019-11-21  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/92596
+       * tree-vect-slp.c (vect_build_slp_tree): Fix pasto.
+
 2019-11-21  Jan Hubicka  <jh@suse.cz>
 
        * ipa-fnsummary.c (evaluate_conditions_for_known_args): Be
index 5af1de3..8197698 100644 (file)
@@ -1,3 +1,8 @@
+2019-11-21  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/92596
+       * gcc.dg/torture/pr92596-1.c: New testcase.
+
 2019-11-21  Tamar Christina  <tamar.christina@arm.com>
 
        * gcc.dg/torture/fp-int-convert-timode-1.c: Add check for FE_TONEAREST.
diff --git a/gcc/testsuite/gcc.dg/torture/pr92596-1.c b/gcc/testsuite/gcc.dg/torture/pr92596-1.c
new file mode 100644 (file)
index 0000000..9d2a223
--- /dev/null
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-ftree-slp-vectorize" } */
+
+typedef struct {
+  long n[5];
+} secp256k1_fe;
+
+void *a, *b;
+int c;
+static void
+fn1(secp256k1_fe *p1, int p2)
+{
+  p1->n[2] = p1->n[3] = p1->n[4] = p2;
+}
+void
+fn2()
+{
+  fn1(b, !c);
+  fn1(a, !c);
+}
index dfbde1a..a94d2d4 100644 (file)
@@ -1247,7 +1247,8 @@ vect_build_slp_tree (vec_info *vinfo,
       return *leader;
     }
   poly_uint64 this_max_nunits = 1;
-  slp_tree res = vect_build_slp_tree_2 (vinfo, stmts, group_size, max_nunits,
+  slp_tree res = vect_build_slp_tree_2 (vinfo, stmts, group_size,
+                                       &this_max_nunits,
                                        matches, npermutes, tree_size, bst_map);
   if (res)
     {