https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66580
Bug ID: 66580 Summary: max reduction does not auto vectorize Product: gcc Version: 5.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: dejan.crnila at dewesoft dot si Target Milestone: --- following code does (max reduction) not auto vectorize on x64/mingw gcc #include <stdio.h> #include <float.h> int main() { float a[] __attribute__((aligned(0x20))) = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; float maxval = -FLT_MAX; for (size_t i = 0; i < 16; i++) maxval = a[i] > maxval ? a[i] : maxval; printf("%g\n", maxval); } compiled as gcc test.c -O3 -Wall -o test.exe -ftree-vectorizer-verbose=6 -fopt-info-vec-all -ffast-math -mavx not supported or bug?