https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68492
--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> --- mol.fppized.f90:8342:0: note: Final SLP tree for instance: mol.fppized.f90:8342:0: note: node mol.fppized.f90:8342:0: note: stmt 0 REALPART_EXPR <MEM[(complex double[0:D.9703] *)res.0_195][_465]> = _834; mol.fppized.f90:8342:0: note: stmt 1 IMAGPART_EXPR <MEM[(complex double[0:D.9703] *)res.0_195][_465]> = _1273; mol.fppized.f90:8342:0: note: node mol.fppized.f90:8342:0: note: stmt 0 _834 = _1171 + _1225; mol.fppized.f90:8342:0: note: stmt 1 _1273 = _1057 + _151; mol.fppized.f90:8342:0: note: node mol.fppized.f90:8342:0: note: stmt 0 _1171 = z_393 * _1205; mol.fppized.f90:8342:0: note: stmt 1 _1057 = z_393 * _1188; mol.fppized.f90:8342:0: note: node mol.fppized.f90:8342:0: note: stmt 0 _1225 = REALPART_EXPR <MEM[(complex double[0:D.9703] *)res.0_195][_465]>; mol.fppized.f90:8342:0: note: stmt 1 _151 = IMAGPART_EXPR <MEM[(complex double[0:D.9703] *)res.0_195][_465]>; and mol.fppized.f90:8342:0: note: Final SLP tree for instance: mol.fppized.f90:8342:0: note: node mol.fppized.f90:8342:0: note: stmt 0 REALPART_EXPR <MEM[(complex double[0:D.9703] *)res.0_195][_433]> = _962; mol.fppized.f90:8342:0: note: stmt 1 IMAGPART_EXPR <MEM[(complex double[0:D.9703] *)res.0_195][_433]> = _852; mol.fppized.f90:8342:0: note: node mol.fppized.f90:8342:0: note: stmt 0 _962 = _1171 + _1637; mol.fppized.f90:8342:0: note: stmt 1 _852 = _1057 + _1645; mol.fppized.f90:8342:0: note: node mol.fppized.f90:8342:0: note: stmt 0 _1637 = REALPART_EXPR <MEM[(complex double[0:D.9703] *)res.0_195][_433]>; mol.fppized.f90:8342:0: note: stmt 1 _1645 = IMAGPART_EXPR <MEM[(complex double[0:D.9703] *)res.0_195][_433]>; shows that we indeed build _1171 from scalars in one instance but not in the other. Ah, so it's because we do mol.fppized.f90:8342:0: note: Re-trying with swapped operands of stmts 1 mol.fppized.f90:8342:0: note: Build SLP for _1171 = z_393 * _1205; mol.fppized.f90:8342:0: note: Build SLP for _1057 = z_393 * _1188; in one case and that one doesn't do the "all operands are built from scalars thus promote myself". I have a patch.