This fixes a place where I missed to use SLP_TREE_REPRESENTATIVE
after its introduction.
2020-06-03 Richard Biener <rguenther@suse.de>
PR tree-optimization/95495
* tree-vect-slp.c (vect_slp_analyze_node_operations): Use
SLP_TREE_REPRESENTATIVE in the shift assertion.
* gcc.dg/vect/pr95495.c: New testcase.
--- /dev/null
+/* { dg-do compile } */
+
+typedef struct {
+ int a;
+ int b;
+} c;
+int d, f, g;
+c e[4];
+void
+h()
+{
+ for (; f; f++) {
+ g += e[f].a >> 1 | e[f].a & 1;
+ d += e[f].b >> 1 | e[f].b & 1;
+ }
+}
/* For shifts with a scalar argument we don't need
to cost or code-generate anything.
??? Represent this more explicitely. */
- gcc_assert ((STMT_VINFO_TYPE (SLP_TREE_SCALAR_STMTS (node)[0])
+ gcc_assert ((STMT_VINFO_TYPE (SLP_TREE_REPRESENTATIVE (node))
== shift_vec_info_type)
&& j == 1);
continue;