llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

aligned move used with unaligned stack [x86,windows]

Open llvmbot opened this issue 14 years ago • 2 comments

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

llvmbot avatar Sep 21 '12 21:09 llvmbot

fixed in r164946.

darkbuck avatar Oct 01 '12 18:10 darkbuck

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.)

darkbuck avatar Sep 22 '12 00:09 darkbuck