http://d.puremagic.com/issues/show_bug.cgi?id=9931
Jacob Carlborg <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED | --- Comment #26 from Jacob Carlborg <[email protected]> 2013-04-27 03:56:14 PDT --- There's still problem with 64bit. It doesn't segfault now but the values of the returned struct is completely wrong. Example: a=-2077579799 b=32767 c=1517257856 The disassembly for the 64bit C version looks like this (all functions in the same object file) : main: Relocation information (__TEXT,__text) 4 entries address pcrel length extern type scattered symbolnum/value 000000ef True long True BRANCH False _printf 000000c2 True long True BRANCH False _bar 000000ab True long True SIGNED False L_.str 0000005b True long True BRANCH False _foo Relocation information (__LD,__compact_unwind) 3 entries address pcrel length extern type scattered symbolnum/value 00000040 False quad False UNSIGND False 1 (__TEXT,__text) 00000020 False quad False UNSIGND False 1 (__TEXT,__text) 00000000 False quad False UNSIGND False 1 (__TEXT,__text) (__TEXT,__text) section _foo: 0000000000000000 pushq %rbp 0000000000000001 movq %rsp,%rbp 0000000000000004 movl %edi,0xec(%rbp) 0000000000000007 movl $0x00000001,0xe0(%rbp) 000000000000000e movl $0x00000002,0xe4(%rbp) 0000000000000015 movl $0x00000003,0xe8(%rbp) 000000000000001c movq 0xe0(%rbp),%rax 0000000000000020 movq %rax,0xf0(%rbp) 0000000000000024 movl $0x00000003,0xf8(%rbp) 000000000000002b movl 0xf0(%rbp),%edi 000000000000002e movl 0xf4(%rbp),%ecx 0000000000000031 movl 0xf8(%rbp),%edx 0000000000000034 movl %edx,0xd8(%rbp) 0000000000000037 movl %ecx,0xd4(%rbp) 000000000000003a movl %edi,0xd0(%rbp) 000000000000003d movq 0xd0(%rbp),%rax 0000000000000041 movl 0xd8(%rbp),%edx 0000000000000044 popq %rbp 0000000000000045 ret 0000000000000046 nopw %cs:_foo(%rax,%rax) _bar: 0000000000000050 pushq %rbp 0000000000000051 movq %rsp,%rbp 0000000000000054 subq $0x30,%rsp 0000000000000058 xorl %edi,%edi 000000000000005a callq _foo 000000000000005f movl %edx,0xe8(%rbp) 0000000000000062 movq %rax,0xe0(%rbp) 0000000000000066 movl 0xe0(%rbp),%edx 0000000000000069 movl 0xe4(%rbp),%edi 000000000000006c movl 0xe8(%rbp),%ecx 000000000000006f movl %ecx,0xf8(%rbp) 0000000000000072 movl %edi,0xf4(%rbp) 0000000000000075 movl %edx,0xf0(%rbp) 0000000000000078 movl 0xf0(%rbp),%ecx 000000000000007b movl 0xf4(%rbp),%edx 000000000000007e movl 0xf8(%rbp),%edi 0000000000000081 movl %edi,0xd8(%rbp) 0000000000000084 movl %edx,0xd4(%rbp) 0000000000000087 movl %ecx,0xd0(%rbp) 000000000000008a movq 0xd0(%rbp),%rax 000000000000008e movl 0xd8(%rbp),%edx 0000000000000091 addq $0x30,%rsp 0000000000000095 popq %rbp 0000000000000096 ret 0000000000000097 nopw _foo(%rax,%rax) _main: 00000000000000a0 pushq %rbp 00000000000000a1 movq %rsp,%rbp 00000000000000a4 subq $0x40,%rsp 00000000000000a8 leaq L_.str(%rip),%rax 00000000000000af movl $_foo,0xfc(%rbp) 00000000000000b6 movl %edi,0xf8(%rbp) 00000000000000b9 movq %rsi,0xf0(%rbp) 00000000000000bd movq %rax,0xc8(%rbp) 00000000000000c1 callq _bar 00000000000000c6 movl %edx,0xd8(%rbp) 00000000000000c9 movq %rax,0xd0(%rbp) 00000000000000cd movl 0xd0(%rbp),%edx 00000000000000d0 movl 0xd4(%rbp),%edi 00000000000000d3 movl 0xd8(%rbp),%ecx 00000000000000d6 movl %ecx,0xe8(%rbp) 00000000000000d9 movl %edi,0xe4(%rbp) 00000000000000dc movl %edx,0xe0(%rbp) 00000000000000df movl 0xe0(%rbp),%esi 00000000000000e2 movl 0xe4(%rbp),%edx 00000000000000e5 movl 0xe8(%rbp),%ecx 00000000000000e8 movq 0xc8(%rbp),%rdi 00000000000000ec movb $_foo,%al 00000000000000ee callq _printf 00000000000000f3 movl $_foo,%ecx 00000000000000f8 movl %eax,0xc4(%rbp) 00000000000000fb movl %ecx,%eax 00000000000000fd addq $0x40,%rsp 0000000000000101 popq %rbp 0000000000000102 ret -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
