[Bug 57] Comparing small structs fails

gdc-bugzilla at gdcproject.org gdc-bugzilla at gdcproject.org
Thu May 30 10:07:16 PDT 2013


http://bugzilla.gdcproject.org/show_bug.cgi?id=57

--- Comment #11 from Johannes Pfau <johannespfau at gmail.com> 2013-05-30 17:07:16 UTC ---
I've now used a fresh clone of the gdc repository, extracted gcc 4.8.0 ad did a
complete new build, but I can still reproduce this here with x86_64 and without
optimization. The problem is not in the asm you posted, it's in the asm which
moves the value returned from funcA from the rax/rdx register onto the stack
(after the call to funcA).

Here's a more complete asm listing:
------
Dump of assembler code for function _Dmain:
push   %rbp
mov    %rsp,%rbp
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    -0x40(%rbp),%rax
movq   $0x0,(%rax)
movq   $0x0,0x8(%rax)
movl   $0x4,-0x40(%rbp)
movq   $0x2a,-0x38(%rbp)
callq  0x4025e0 <_D11smallstruct5funcAFZS11smallstruct1S>
mov    %eax,%ecx           <------- here
mov    %rdx,%rax
mov    %ecx,-0x30(%rbp)    <------- and here
mov    %rax,-0x28(%rbp)
lea    -0x40(%rbp),%rcx
lea    -0x30(%rbp),%rax
mov    $0x10,%edx
mov    %rcx,%rsi
mov    %rax,%rdi
callq  0x401bc0 <memcmp at plt>
------

I'll also attach the compiled binary.

-- 
Configure bugmail: http://bugzilla.gdcproject.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the D.gnu mailing list