[Bug target/28074] New: -mstackrealign generates very inefficient code
hjl at lucon dot org
gcc-bugzilla@gcc.gnu.org
Sat Jun 17 18:45:00 GMT 2006
[hjl@gnu-3 xmm]$ cat x.c
#include <emmintrin.h>
extern char *e1 (void);
char *e1 (void)
{
volatile __m128 dummy = _mm_set_ps1(0.f);
return "OK";
}
[hjl@gnu-3 xmm]$ /usr/gcc-4.2/bin/gcc -m32 -O -msse2 -S -mstackrealign x.c
[hjl@gnu-3 xmm]$ cat x.s
.file "x.c"
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "OK"
.text
.globl e1
.type e1, @function
e1:
leal 4(%esp), %ecx
andl $-16, %esp
pushl -4(%ecx)
pushl %ebp
movl %esp, %ebp
pushl %ecx
subl $20, %esp
xorps %xmm0, %xmm0
movaps %xmm0, -24(%ebp)
movl $.LC0, %eax
addl $20, %esp
popl %ecx
popl %ebp
leal -4(%ecx), %esp
ret
.size e1, .-e1
.ident "GCC: (GNU) 4.2.0 20060613 (experimental) [trunk revision
114620 clean]"
.section .note.GNU-stack,"",@progbits
[hjl@gnu-3 xmm]$
Icc 9.1 generates:
.globl e1
e1:
..B1.1: # Preds ..B1.0
pushl %ebp #4.1
movl %esp, %ebp #4.1
andl $-16, %esp #4.1
subl $16, %esp #4.1
xorps %xmm0, %xmm0 #5.27
movaps %xmm0, (%esp) #5.19
movl $__STRING.0, %eax #6.10
movl %ebp, %esp #6.10
popl %ebp #6.10
ret #6.10
It doesn't waste ecx to align the stack.
--
Summary: -mstackrealign generates very inefficient code
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hjl at lucon dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28074
More information about the Gcc-bugs
mailing list