https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88717
Bug ID: 88717
Summary: Unnecessary vzeroupper
Product: gcc
Version: 9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: hjl.tools at gmail dot com
CC: ubizjak at gmail dot com, wei3.xiao at intel dot com,
xuepeng.guo at intel dot com
Target Milestone: ---
Target: i386,x86_64
[hjl@gnu-cfl-1 tmp]$ cat x.i
typedef float __v16sf __attribute__ ((__vector_size__ (64)));
typedef float __m512 __attribute__ ((__vector_size__ (64), __may_alias__));
void
foo (float *p, __m512 x)
{
*p = ((__v16sf)x)[0];
}
[hjl@gnu-cfl-1 tmp]$ gcc -mavx512f -S x.i -O2
[hjl@gnu-cfl-1 tmp]$ cat x.s
.file "x.i"
.text
.p2align 4,,15
.globl foo
.type foo, @function
foo:
.LFB0:
.cfi_startproc
vmovss %xmm0, (%rdi)
vzeroupper
ret
.cfi_endproc
.LFE0:
.size foo, .-foo
.ident "GCC: (GNU) 8.2.1 20181215 (Red Hat 8.2.1-6)"
.section .note.GNU-stack,"",@progbits
[hjl@gnu-cfl-1 tmp]$
Since __m512 is passed to foo, vzeroupper isn't needed.