Bug 443 – assignment in return when using cdouble is broken

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2006-10-19T16:50:00Z
Last change time
2014-02-15T13:22:02Z
Keywords
wrong-code
Assigned to
bugzilla
Creator
witold.baryluk+d

Comments

Comment #0 by witold.baryluk+d — 2006-10-19T16:50:23Z
Minimal test case: ----------- cdouble y; cdouble f(cdouble x) { return (y = x); } void main() { f(1.0+2.0i); assert(y == 1.0+2.0i); // asseration fails on dmd 0.166-0.172 } ---------- If I'm using double instand of cdouble, or rewrite f as: --------- cdouble f(cdouble x) { y = x; return x; } --------- then it's working ok.
Comment #1 by thomas-dloop — 2006-10-21T08:40:33Z
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [email protected] schrieb am 2006-10-19: > http://d.puremagic.com/issues/show_bug.cgi?id=443 > Minimal test case: > ----------- > cdouble y; > > cdouble f(cdouble x) { > return (y = x); > } > > void main() { > f(1.0+2.0i); > assert(y == 1.0+2.0i); // asseration fails on dmd 0.166-0.172 > } > ---------- > > > If I'm using double instand of cdouble, or rewrite f as: > --------- > cdouble f(cdouble x) { > y = x; > return x; > } > --------- > then it's working ok. Added to DStress as http://dstress.kuehne.cn/run/r/return_09_A.d http://dstress.kuehne.cn/run/r/return_09_B.d http://dstress.kuehne.cn/run/r/return_09_C.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFOiGHLK5blCcjpWoRAvHiAJ96EdS4Je7lh12Yj0S1cKtdFZCm/wCfSkMk LsCGKiauS27L3oLjOnOXayQ= =iCoI -----END PGP SIGNATURE-----
Comment #2 by bugzilla — 2006-11-25T03:53:43Z
Fixed DMD 0.175