D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 11073 - Move semantics not respected
Summary: Move semantics not respected
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 All
: P3 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-20 05:08 UTC by badlink
Modified: 2024-12-13 18:11 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description badlink 2013-09-20 05:08:41 UTC
DMD version: 2.063.2

Code: http://pastebin.com/sTLhnNdV

Output:
CTor A with 42
CTor A with 23
CTor A with 65
Value call with A::65
DTor A with 65
CTor A with 1337
Value call with A::1337
DTor A with 1337
Ref call with A::42
DTor A with 23
DTor A with 42

Disassembly: http://pastebin.com/5emmwqJc
Compilation flags: -release -O

Issue:
The first two value calls receive their arguments via move semantics, i.e. the argument is not copied but passed directly to the function.
This behavior is showed in the output (the postblit function is not called) but the disassembly shows that the struct is actually copied before the function call.
Comment 1 rswhite4 2013-09-20 11:42:14 UTC
If that is fixed, there could be a huge performance boost.
Comment 2 dlangBugzillaToGithub 2024-12-13 18:11:41 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/18674

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB