https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101202
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- So we still have failed backedge destinations in the SLP graph, those have vect_uninitialized_def and the - /* For leafs there's nothing to do - we've seeded permutes - on those above. */ - if (SLP_TREE_DEF_TYPE (node) != vect_internal_def) + + /* Handle externals and constants optimistically throughout the + iteration. */ + if (SLP_TREE_DEF_TYPE (node) == vect_external_def + || SLP_TREE_DEF_TYPE (node) == vect_constant_def) change exposed them. We do represent them in the graph though, and treating them optimistically is not exactly correct. Just propagating across them might be better, OTOH the PHI is going to be promoted external. I think it would be much better to not keep those during optimize_slp ...