[Bug 57] Comparing small structs fails

gdc-bugzilla at gdcproject.org gdc-bugzilla at gdcproject.org
Wed May 29 10:26:17 PDT 2013


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

Johannes Pfau <johannespfau at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |NEW
         Resolution|FIXED                       |

--- Comment #5 from Johannes Pfau <johannespfau at gmail.com> 2013-05-29 17:26:17 UTC ---
Nice work!

But I can still reproduce this with the posted test case (GCC 4.8.0) if I
compile without optimization. With -O2 or higher it works fine.

Now the struct is initialized correctly in funcA:
movq   $0x0,(%rax)
movq   $0x0,0x8(%rax)
movl   $0x4,-0x18(%rbp)
movq   $0x2a,-0x10(%rbp)

And returned:
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rdx

But in the main function:
mov    %eax,%ecx
mov    %rdx,%rax
mov    %ecx,-0x30(%rbp) <--- uses only 4 bytes of rax
                        //-0x2C(%rbp) is not initialized
mov    %rax,-0x28(%rbp)


BTW: Do we also have to add the fillHoles code to StructInitializer::toDt?

-- 
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