https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97707
Bug ID: 97707 Summary: avx12 math function invoked even if -mprefer-vector-width=256 specified Product: gcc Version: 10.2.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: --- this code will invoke _ZGVeN8v_sin instead of _ZGVdN4v_sin making use of zmm registers #include<cmath> int main() { double res=0; for (int x=0; x<1024;x++) { double y = x; res += std::sin(y); } return res > 0.5; } NOTE if I specify for (long long x=0; x<1024;x++) { it will correcty invoke _ZGVdN4v_sin (no zmm) compiler options -Ofast -march=skylake-avx512 -mprefer-vector-width=256