https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65930
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- Created attachment 42730 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42730&action=edit WIP patch What I have sitting in my tree. Steps to make this clean is 1) refactor things to record the original scalar reduction code somewhere (add place in stmt vinfo?) 2) make it less awkward ... 3) somehow merge SLP reduction detection with the more generic path detection (the cases that interest us are SLP reductions, I think the case with just a path is handled already) Oh, the patch exposes lots of ICEs, I didn't really finish it.