The SLP permute optimization rewrite fixed this. PR tree-optimization/113896 * g++.dg/torture/pr113896.C: New testcase.