https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96370
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> --- OK, so rewrite_expr_tree isn't prepared to see ops with a three component "leaf" as try_special_add_to_ops produces which turns { -b, b } into { b, b, -1 }. Instead it recurses into the apperant non-leaf _1 which is the negate. /* Recurse on the LHS of the binary operator, which is guaranteed to be the non-leaf side. */ tree new_rhs1 = rewrite_expr_tree (SSA_NAME_DEF_STMT (rhs1), opindex + 1, ops, changed || oe->op != rhs2 || next_changed, false); But I have a simple fix.