https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122236
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Keywords| |missed-optimization, openmp
CC| |jakub at gcc dot gnu.org,
| |rguenth at gcc dot gnu.org
Last reconfirmed| |2025-10-13
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
t.c:3:11: note: using an in-order (fold-left) reduction.
So it seems that OpenMP SIMD lowers reductions into two loops, only the
epilogue is a reduction and there it fails to communicate it isn't fold-left
(aka, reassociation is allowed)?
Given we cannot currently specify "-ffast-math" on individual operations we'd
need to resort to a hack like a loop->assume_fast_math_for_vectorization
flag? Different OpenMP lowering might also work, but then this would need
to be target dependent.