From b32b872a7ef96b1103be36c56a1ed82144cb7fde Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 30 Jun 2006 20:01:37 +0000 Subject: [PATCH] * change non-volatile rbx to volatile r11 git-svn-id: trunk@4013 - --- .gitattributes | 1 + rtl/linux/x86_64/syscall.inc | 56 ++++++++++++++++++------------------ tests/webtbs/tw7104.pp | 23 +++++++++++++++ 3 files changed, 52 insertions(+), 28 deletions(-) create mode 100644 tests/webtbs/tw7104.pp diff --git a/.gitattributes b/.gitattributes index 6cbfdcf012..550279aaed 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7194,6 +7194,7 @@ tests/webtbs/tw6977.pp svneol=native#text/plain tests/webtbs/tw6980.pp svneol=native#text/plain tests/webtbs/tw6989.pp svneol=native#text/plain tests/webtbs/tw7006.pp svneol=native#text/plain +tests/webtbs/tw7104.pp svneol=native#text/plain tests/webtbs/ub1873.pp svneol=native#text/plain tests/webtbs/ub1883.pp svneol=native#text/plain tests/webtbs/uw0555.pp svneol=native#text/plain diff --git a/rtl/linux/x86_64/syscall.inc b/rtl/linux/x86_64/syscall.inc index a5d6a02e7e..527a0ecf6a 100644 --- a/rtl/linux/x86_64/syscall.inc +++ b/rtl/linux/x86_64/syscall.inc @@ -29,18 +29,18 @@ asm {$ifdef FPC_PIC} movq fpc_threadvar_relocate_proc@GOTPCREL(%rip),%rax movq (%rax),%rax - movq Errno@GOTPCREL(%rip),%rbx + movq Errno@GOTPCREL(%rip),%r11 {$else FPC_PIC} movq fpc_threadvar_relocate_proc,%rax - leaq Errno,%rbx + leaq Errno,%r11 {$endif FPC_PIC} testq %rax,%rax jne .LThread - movl %edx,8(%rbx) + movl %edx,8(%r11) jmp .LNoThread .LThread: pushq %rdx - movq (%rbx),%rdi + movq (%r11),%rdi call *%rax popq %rdx movl %edx,(%rax) @@ -62,18 +62,18 @@ asm {$ifdef FPC_PIC} movq fpc_threadvar_relocate_proc@GOTPCREL(%rip),%rax movq (%rax),%rax - movq Errno@GOTPCREL(%rip),%rbx + movq Errno@GOTPCREL(%rip),%r11 {$else FPC_PIC} movq fpc_threadvar_relocate_proc,%rax - leaq Errno,%rbx + leaq Errno,%r11 {$endif FPC_PIC} testq %rax,%rax jne .LThread - movl %edx,8(%rbx) + movl %edx,8(%r11) jmp .LNoThread .LThread: pushq %rdx - movq (%rbx),%rdi + movq (%r11),%rdi call *%rax popq %rdx movl %edx,(%rax) @@ -96,18 +96,18 @@ asm {$ifdef FPC_PIC} movq fpc_threadvar_relocate_proc@GOTPCREL(%rip),%rax movq (%rax),%rax - movq Errno@GOTPCREL(%rip),%rbx + movq Errno@GOTPCREL(%rip),%r11 {$else FPC_PIC} movq fpc_threadvar_relocate_proc,%rax - leaq Errno,%rbx + leaq Errno,%r11 {$endif FPC_PIC} testq %rax,%rax jne .LThread - movl %edx,8(%rbx) + movl %edx,8(%r11) jmp .LNoThread .LThread: pushq %rdx - movq (%rbx),%rdi + movq (%r11),%rdi call *%rax popq %rdx movl %edx,(%rax) @@ -131,18 +131,18 @@ asm {$ifdef FPC_PIC} movq fpc_threadvar_relocate_proc@GOTPCREL(%rip),%rax movq (%rax),%rax - movq Errno@GOTPCREL(%rip),%rbx + movq Errno@GOTPCREL(%rip),%r11 {$else FPC_PIC} movq fpc_threadvar_relocate_proc,%rax - leaq Errno,%rbx + leaq Errno,%r11 {$endif FPC_PIC} testq %rax,%rax jne .LThread - movl %edx,8(%rbx) + movl %edx,8(%r11) jmp .LNoThread .LThread: pushq %rdx - movq (%rbx),%rdi + movq (%r11),%rdi call *%rax popq %rdx movl %edx,(%rax) @@ -167,18 +167,18 @@ asm {$ifdef FPC_PIC} movq fpc_threadvar_relocate_proc@GOTPCREL(%rip),%rax movq (%rax),%rax - movq Errno@GOTPCREL(%rip),%rbx + movq Errno@GOTPCREL(%rip),%r11 {$else FPC_PIC} movq fpc_threadvar_relocate_proc,%rax - leaq Errno,%rbx + leaq Errno,%r11 {$endif FPC_PIC} testq %rax,%rax jne .LThread - movl %edx,8(%rbx) + movl %edx,8(%r11) jmp .LNoThread .LThread: pushq %rdx - movq (%rbx),%rdi + movq (%r11),%rdi call *%rax popq %rdx movl %edx,(%rax) @@ -204,18 +204,18 @@ asm {$ifdef FPC_PIC} movq fpc_threadvar_relocate_proc@GOTPCREL(%rip),%rax movq (%rax),%rax - movq Errno@GOTPCREL(%rip),%rbx + movq Errno@GOTPCREL(%rip),%r11 {$else FPC_PIC} movq fpc_threadvar_relocate_proc,%rax - leaq Errno,%rbx + leaq Errno,%r11 {$endif FPC_PIC} testq %rax,%rax jne .LThread - movl %edx,8(%rbx) + movl %edx,8(%r11) jmp .LNoThread .LThread: pushq %rdx - movq (%rbx),%rdi + movq (%r11),%rdi call *%rax popq %rdx movl %edx,(%rax) @@ -243,18 +243,18 @@ asm {$ifdef FPC_PIC} movq fpc_threadvar_relocate_proc@GOTPCREL(%rip),%rax movq (%rax),%rax - movq Errno@GOTPCREL(%rip),%rbx + movq Errno@GOTPCREL(%rip),%r11 {$else FPC_PIC} movq fpc_threadvar_relocate_proc,%rax - leaq Errno,%rbx + leaq Errno,%r11 {$endif FPC_PIC} testq %rax,%rax jne .LThread - movl %edx,8(%rbx) + movl %edx,8(%r11) jmp .LNoThread .LThread: pushq %rdx - movq (%rbx),%rdi + movq (%r11),%rdi call *%rax popq %rdx movl %edx,(%rax) diff --git a/tests/webtbs/tw7104.pp b/tests/webtbs/tw7104.pp new file mode 100644 index 0000000000..4b993f29ff --- /dev/null +++ b/tests/webtbs/tw7104.pp @@ -0,0 +1,23 @@ +program bug7104; + +{$mode objfpc}{$H+} + +Uses SysUtils; + +function count: integer; +begin + result := 5; +end; + +var + i: Integer; + +begin + for i := 0 to count-1 do begin + writeln(i); + if FileExists('asdkjasdjalsj') then; + + if i>5 then halt(1); + end; +end. +