Bug 6166 – Named return value optimization not dealt with in inline assembler

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2011-06-16T14:24:00Z
Last change time
2020-08-28T04:23:46Z
Keywords
iasm, pull, wrong-code
Assigned to
No Owner
Creator
Walter Bright

Comments

Comment #0 by bugzilla — 2011-06-16T14:24:00Z
Byron writes: I reduced the complexity of the problem, seems to be SSE and returning local copies. $ dmd -run db.d v: [1, 2, 3, 4] test1 r: [nan, nan, nan, nan] test1: [nan, nan, nan, nan] test2 r: [1, 2, 3, 4] test2: [1, 2, 3, 4] halle109-251:asm byro //db.d import std.stdio; alias float[4] vector; const(vector) test1( ref const(vector) v ) { vector r; asm { mov EAX, v; movups XMM0, [EAX]; movups r, XMM0; } writeln( "test1 r: ", r ); return r; } const(vector) test2( ref const(vector) v ) { vector r, s; asm { mov EAX, v; movups XMM0, [EAX]; movups r, XMM0; } writeln( "test2 r: ", r ); s = r; return s; } void main() { vector v = [1,2,3,4]; writeln( "v: ", v ); writeln( "test1: ", test1(v)); writeln( "test2: ", test2(v)); }
Comment #1 by dlang-bot — 2020-08-28T03:14:30Z
@WalterBright created dlang/dmd pull request #11636 "fix Issue 6166 - Named return value optimization not dealt with in in…" fixing this issue: - fix Issue 6166 - Named return value optimization not dealt with in inline assembler https://github.com/dlang/dmd/pull/11636
Comment #2 by dlang-bot — 2020-08-28T04:23:46Z
dlang/dmd pull request #11636 "fix Issue 6166 - Named return value optimization not dealt with in in…" was merged into master: - 75cb72d9c4d305c28bde1afcdebebbe44323f127 by Walter Bright: fix Issue 6166 - Named return value optimization not dealt with in inline assembler https://github.com/dlang/dmd/pull/11636