The following deals with reduction detection handling a non-noop
conversion as reduction operation and makes the reduction chain
chain re-discovery handle this situation the same.
PR tree-optimization/122419
* tree-vect-slp.cc (vect_analyze_slp_reduc_chain): Only
skip noop conversions.
* gcc.dg/vect/pr122419.c: New testcase.
--- /dev/null
+/* { dg-do compile } */
+
+int a;
+long b;
+void c()
+{
+ for (; b; b--)
+ a = (char)a;
+}
if (!gimple_extract_op (STMT_VINFO_STMT (vect_orig_stmt (stmt)), &op))
gcc_unreachable ();
if (CONVERT_EXPR_CODE_P (op.code)
+ && tree_nop_conversion_p (op.type, TREE_TYPE (op.ops[0]))
&& (first
|| is_a <gphi *> (STMT_VINFO_STMT (next_stmt))))
;