https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122236
Bug ID: 122236
Summary: final reduction step not optimal for "omp simd"
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: vincenzo.innocente at cern dot ch
Target Milestone: ---
float sum3(float const * v ) {
float s=0;
#pragma omp simd reduction(+:s)
for (int i=0; i<1024; ++i) s += v[i];
return s;
}
produces a not optimal final step when compiled with
-O3 -march=x86-64-v3 -fopenmp-simd
compared with
-O3 -march=x86-64-v3 -ffast-math
see https://godbolt.org/z/drs8h6qY5