[Issue 6189] [64bit] optimizer: register content destroyed in function prolog
http://d.puremagic.com/issues/show_bug.cgi?id=6189 --- Comment #9 from Don 2012-05-21 06:14:16 PDT --- Reduced test case (compile with -m64 -O): void bug6189(int half, int[2] pos, float[3] *pts, int unused) { pos[0] += half; (*pts)[0] = pos[0]; (*pts)[1] = pos[1]; (*pts)[2] = half; } void main() { int[2] pos = [2,2]; float[3] pts = [0.0, 0.0, 0.0]; bug6189(0, pos, &pts, 0); assert(pts[0] == 2); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6189] [64bit] optimizer: register content destroyed in function prolog
http://d.puremagic.com/issues/show_bug.cgi?id=6189 --- Comment #10 from Don 2012-05-21 07:09:29 PDT --- My reduction in comment 9 was valid only for D2, this one is valid for D1 as well (again compile with -m64 -O): --- struct IPoint { int x, y; } void bug6189(uint half, IPoint pos, float[4] *pts, uint unused) { pos.y += half; float xo = pos.x; float yo = pos.y; (*pts)[0] = xo; (*pts)[1] = yo; (*pts)[2] = xo; } void main() { auto pos = IPoint(2, 2); float[4] pts; pts[0] = pts[1] = pts[2] = pts[3] = 0; bug6189(0, pos, &pts, 0); assert(pts[0] == 2); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6189] [64bit] optimizer: register content destroyed in function prolog
http://d.puremagic.com/issues/show_bug.cgi?id=6189 --- Comment #11 from Leandro Lucarella 2012-05-22 11:14:28 PDT --- (In reply to comment #9) > Reduced test case (compile with -m64 -O): > > void bug6189(int half, int[2] pos, float[3] *pts, int unused) > { > pos[0] += half; > > (*pts)[0] = pos[0]; > (*pts)[1] = pos[1]; > (*pts)[2] = half; > } > > void main() > { > int[2] pos = [2,2]; > float[3] pts = [0.0, 0.0, 0.0]; > bug6189(0, pos, &pts, 0); > assert(pts[0] == 2); > } This is working on latest dmd2 (42d8967) and d1 (4351a58), but the testcase in comment 8 still fails on both. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6189] [64bit] optimizer: register content destroyed in function prolog
http://d.puremagic.com/issues/show_bug.cgi?id=6189 Leandro Lucarella changed: What|Removed |Added CC||leandro.lucarella@sociomant ||ic.com --- Comment #12 from Leandro Lucarella 2012-05-22 11:17:37 PDT --- (In reply to comment #10) > My reduction in comment 9 was valid only for D2, this one is valid for D1 as > well (again compile with -m64 -O): > --- > struct IPoint { > int x, y; > } > > void bug6189(uint half, IPoint pos, float[4] *pts, uint unused) { > pos.y += half; > float xo = pos.x; > float yo = pos.y; > > (*pts)[0] = xo; > (*pts)[1] = yo; > (*pts)[2] = xo; > } > > void main() > { > auto pos = IPoint(2, 2); > float[4] pts; > pts[0] = pts[1] = pts[2] = pts[3] = 0; > bug6189(0, pos, &pts, 0); > > assert(pts[0] == 2); > } OK, this one fails too in latest D1 and D2, but interestingly enough, it works with -O -inline (in both D1 and D2)! -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6189] [64bit] optimizer: register content destroyed in function prolog
http://d.puremagic.com/issues/show_bug.cgi?id=6189 --- Comment #13 from d...@dawgfoto.de 2012-05-22 12:00:35 PDT --- >OK, this one fails too in latest D1 and D2, but interestingly enough, it works >with -O -inline (in both D1 and D2)! This bug depends completely on register allocation and defies logic or intuitive understanding. I need to revisit my patch so it merges again. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6189] [64bit] optimizer: register content destroyed in function prolog
http://d.puremagic.com/issues/show_bug.cgi?id=6189 --- Comment #14 from github-bugzi...@puremagic.com 2012-05-22 23:42:39 PDT --- Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/69634f17f19663c100fd47392b25160c404843eb fix Issue 6189 - [64bit] optimizer: register content destroyed in function prolog -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6189] [64bit] optimizer: register content destroyed in function prolog
http://d.puremagic.com/issues/show_bug.cgi?id=6189 Walter Bright changed: What|Removed |Added Status|NEW |RESOLVED CC||bugzi...@digitalmars.com Resolution||FIXED --- Comment #16 from Walter Bright 2012-05-22 23:44:34 PDT --- I added an assert to detect if other cases of this show up. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6189] [64bit] optimizer: register content destroyed in function prolog
http://d.puremagic.com/issues/show_bug.cgi?id=6189 --- Comment #15 from github-bugzi...@puremagic.com 2012-05-22 23:42:50 PDT --- Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/41b1412aca8e8d9370d4479a1f52388c69685592 fix Issue 6189 - [64bit] optimizer: register content destroyed in function prolog -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6189] [64bit] optimizer: register content destroyed in function prolog
https://issues.dlang.org/show_bug.cgi?id=6189 Andrei Alexandrescu changed: What|Removed |Added Version|D1 & D2 |D2 --