mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
fix PR8769, a miscompilation by inliner when inlining a function with a byval
argument. The generated alloca has to have at least the alignment of the byval, if not, the client may be making assumptions that the new alloca won't satisfy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122234 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -56,3 +56,27 @@ entry:
|
||||
; CHECK-NOT: call void @llvm.memcpy
|
||||
; CHECK: ret i32
|
||||
}
|
||||
|
||||
|
||||
; Inlining a byval with an explicit alignment needs to use *at least* that
|
||||
; alignment on the generated alloca.
|
||||
; PR8769
|
||||
declare void @g3(%struct.ss* %p)
|
||||
|
||||
define internal void @f3(%struct.ss* byval align 64 %b) nounwind {
|
||||
call void @g3(%struct.ss* %b) ;; Could make alignment assumptions!
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @test3() nounwind {
|
||||
entry:
|
||||
%S = alloca %struct.ss, align 1 ;; May not be aligned.
|
||||
call void @f3( %struct.ss* byval align 64 %S) nounwind
|
||||
ret void
|
||||
; CHECK: @test3()
|
||||
; CHECK: %b = alloca %struct.ss, align 64
|
||||
; CHECK: %S = alloca %struct.ss
|
||||
; CHECK: call void @llvm.memcpy
|
||||
; CHECK: call void @g3(%struct.ss* %b)
|
||||
; CHECK: ret void
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user