mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Fix a bug in the x86-32 code generated for segmented stacks.
Currently LLVM pads the call to __morestack with a add and sub of 8 bytes to esp. This isn't correct since __morestack expects the call to be followed directly by a ret. This commit also adjusts the relevant test-case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145765 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -23,11 +23,9 @@ false:
|
||||
; X32: leal -12(%esp), %ecx
|
||||
; X32-NEXT: cmpl %gs:48, %ecx
|
||||
|
||||
; X32: subl $8, %esp
|
||||
; X32-NEXT: pushl $4
|
||||
; X32: pushl $4
|
||||
; X32-NEXT: pushl $12
|
||||
; X32-NEXT: calll __morestack
|
||||
; X32-NEXT: addl $8, %esp
|
||||
; X32-NEXT: ret
|
||||
|
||||
; X32: movl %esp, %eax
|
||||
@@ -72,11 +70,9 @@ define i32 @test_nested(i32 * nest %closure, i32 %other) {
|
||||
; X32-NEXT: cmpl %gs:48, %edx
|
||||
|
||||
|
||||
; X32: subl $8, %esp
|
||||
; X32-NEXT: pushl $4
|
||||
; X32: pushl $4
|
||||
; X32-NEXT: pushl $0
|
||||
; X32-NEXT: calll __morestack
|
||||
; X32-NEXT: addl $8, %esp
|
||||
; X32-NEXT: ret
|
||||
|
||||
; X64: leaq (%rsp), %r11
|
||||
|
Reference in New Issue
Block a user