https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81633
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I'm afraid the tree-vect-slp.c change is completely wrong, the original change in https://gcc.gnu.org/ml/gcc-patches/2016-08/msg01090.html if the oprnd == NULL has child_index++; looks reasonable to me. It changed a fragile code into much more fragile code which will be always wrong if there are stmts with duplicated (or more) operands. Trying to recompute child_index from just oprnd is wrong, there can be multiple arguments equal to the same SSA_NAME and which exact one it is should really be derived from the index (dunno why we need child_index var, wouldn't it be sufficient to use i for that)? Are there (after the tree-vect-loop.c caller has been fixed in the same revision) any vect_get_slp_defs callers which pass arguments with gaps or where the oprnd i to child_index mapping shouldn't be identity? I wonder about COND_EXPR with non-COMPARISON_CLASS_P first argument, but am not sure. E.g. vect_create_new_slp_node counts it as 2 regardless of what the first argument is: else if (is_gimple_assign (stmt)) { nops = gimple_num_ops (stmt) - 1; if (gimple_assign_rhs_code (stmt) == COND_EXPR) nops++; } while vect_get_and_check_slp_defs has: if (gimple_assign_rhs_code (stmt) == COND_EXPR && COMPARISON_CLASS_P (gimple_assign_rhs1 (stmt))) { first_op_cond = true; number_of_oprnds++; } which then matches e.g. masked handling in tree-vect-stmts.c (vectorizable_condition).