https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82990
Bug ID: 82990 Summary: Add -mprefer-vzeroupper Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: hjl.tools at gmail dot com CC: pavel.v.chupin at gmail dot com Target Milestone: --- Target: x86 Should we have a separate patch to add -mprefer-vzeroupper to cover all bases in the future, like /* opt_pass methods: */ virtual bool gate (function *) { return TARGET_AVX && (!TARGET_AVX512ER || TARGET_PREFER_VZEROUPPER) && TARGET_VZEROUPPER && flag_expensive_optimizations && !optimize_size; } Should explicit -mprefer-vzeroupper or -mno-prefer-vzeroupper override whatever other optimization conditions there are (i.e. everything other than TARGET_AVX and TARGET_VZEROUPPER)? I.e. use !TARGET_AVX512ER && flag_expensive_optimizations && !optimize_size only when the explicit bit is not set for it?