This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned
- From: "mikulas at artax dot karlin dot mff dot cuni dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Sep 2009 06:30:53 -0000
- Subject: [Bug rtl-optimization/40838] gcc shouldn't assume that the stack is aligned
- References: <bug-40838-1600@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #39 from mikulas at artax dot karlin dot mff dot cuni dot cz 2009-09-20 06:30 -------
The updated patch fixes align-counterexample1.c, but not
align-counterexample2.c. Note that you must align the stack for all functions
that have some SSE operations, because you never know if the registers will be
spilled. The generated code is:
.globl f
.type f, @function
f:
pxor %xmm0, %xmm0
subl $28, %esp
xorl %eax, %eax
.p2align 5,,24
.L2:
movaps %xmm0, p(%eax)
addl $16, %eax
cmpl $400, %eax
jne .L2
movaps %xmm0, (%esp)
call g
movdqa (%esp), %xmm0
xorl %eax, %eax
.p2align 5,,24
.L3:
movaps %xmm0, q(%eax)
addl $16, %eax
cmpl $400, %eax
jne .L3
addl $28, %esp
ret
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40838