This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/81769] New: Unnecessary stack realign with -mavx
- From: "hjl.tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 08 Aug 2017 12:39:54 +0000
- Subject: [Bug target/81769] New: Unnecessary stack realign with -mavx
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81769
Bug ID: 81769
Summary: Unnecessary stack realign with -mavx
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
Target Milestone: ---
Target: x86
[hjl@gnu-6 pr59501]$ cat k.i
typedef int v8si __attribute__ ((vector_size (32)));
void
foo (unsigned long long *idx, v8si *out_start, v8si *regions)
{
if (*idx < 20 ) {
v8si base = regions[*idx];
*out_start = base;
}
}
[hjl@gnu-6 pr59501]$ make k.s
/export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -O -mregparm=3 -m32 -mavx -S
k.i
[hjl@gnu-6 pr59501]$ cat k.s
.file "k.i"
.text
.globl foo
.type foo, @function
foo:
.LFB0:
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
pushl %ebx
andl $-32, %esp <<<<<<<<<<< This isn't needed.
.cfi_offset 3, -12
movl (%eax), %ebx
cmpl $0, 4(%eax)
jne .L1
cmpl $19, %ebx
ja .L1
sall $5, %ebx
vmovdqa (%ecx,%ebx), %ymm0
vmovdqa %ymm0, (%edx)
.L1:
movl -4(%ebp), %ebx
leave
.cfi_restore 5
.cfi_restore 3
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE0:
.size foo, .-foo
.ident "GCC: (GNU) 8.0.0 20170807 (experimental)"
.section .note.GNU-stack,"",@progbits
[hjl@gnu-6 pr59501]$