[Issue 9985] New: Postblit isn't called on local struct return

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Apr 24 07:44:51 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9985

           Summary: Postblit isn't called on local struct return
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: SebastianGraf at t-online.de


--- Comment #0 from Sebastian Graf <SebastianGraf at t-online.de> 2013-04-24 07:44:50 PDT ---
For this program: http://dpaste.dzfl.pl/d73575a1
I get

    made S at 18FC64, s.b == 18FC68
    got back S at 18FCF4, s.b == 18FC68

as output. Note that no "postblit" message was printed.
Patching s.b to point into the newly allocated struct in postblit is crucial
here, but it seems like the postblit constructor isn't called, nor is there any
attempt 
to optimize away the temporary in `makeS()` even with -O.
Am I doing something wrong?

http://dpaste.dzfl.pl/cc460feb copies the struct and ivokes postblit just fine.
Maybe this is a bug in RVO?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list