https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86850

--- Comment #3 from rguenther at suse dot de <rguenther at suse dot de> ---
On Tue, 21 Aug 2018, dcb314 at hotmail dot com wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86850
> 
> --- Comment #2 from David Binderman <dcb314 at hotmail dot com> ---
> Indeed it does look like vectorizer code. Here are 20 frames,
> found by using the UBSAN_OPTIONS=print_stacktrace=1 option:

OK, I suppose we're creating a SLP node for a PHI where there are zero
operands and thus no children and

SLP_TREE_CHILDREN (node).create (nops);

will not create a vector but a splice of an empty vector will barf
when splicing into it.

Index: gcc/tree-vect-slp.c
===================================================================
--- gcc/tree-vect-slp.c (revision 263656)
+++ gcc/tree-vect-slp.c (working copy)
@@ -1489,7 +1489,9 @@ fail:

   node = vect_create_new_slp_node (stmts);
   SLP_TREE_TWO_OPERATORS (node) = two_operators;
-  SLP_TREE_CHILDREN (node).splice (children);
+  gcc_assert (children.length () == nops);
+  if (!children.is_empty ())
+    SLP_TREE_CHILDREN (node).splice (children);
   return node;
 }

Reply via email to