llvm-project
llvm-project copied to clipboard
aligned move used with unaligned stack [x86,windows]
| Bugzilla Link | 13899 |
| Resolution | FIXED |
| Resolved on | Oct 01, 2012 11:45 |
| Version | unspecified |
| OS | All |
| Attachments | test case |
| Reporter | LLVM Bugzilla Contributor |
| CC | @darkbuck |
Extended Description
With the attached test case (32-bit x86, Windows), llc generates the following assembly. Note that an aligned move is used, even though the stack isn't necessarily 16-byte aligned going into the function. (And thus, the code crashes when it is run in this case.)
_bar: # @bar
BB#0: # %allocas
pushl %ebp
movl %esp, %ebp
subl $16, %esp
vmovaps 8(%ebp), %xmm4
vmovaps %xmm4, (%esp)
calll _foo
addl $16, %esp
popl %ebp
ret
fixed in r164946.
patch is submitted for review at http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120917/151427.html
please verify whether it works for you (I assume the caller will ensure the alignment of arguments being passed if caller is not compiled with LLVM.)