https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112457
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> --- You want to find the duplicate bugreport for the min/max + index reductions, IIRC the issue is that we fail the reduction detection because of multi-use and we should really have two conditional reductions, one on the value and one on the index without trying to be too clever combining them into a single one. That is, don't try to invent sth completely new based on what LLVM does but understand what's missing in GCCs handling of conditional reductions (it can do conditional value and conditional index reductions just fine, just not both at the same time IIRC).