Bug 14754 – [REG2.068b1] 64bit wrong code with -inline

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2015-07-01T03:51:00Z
Last change time
2017-07-22T12:35:52Z
Keywords
pull, wrong-code
Assigned to
nobody
Creator
jiki

Comments

Comment #0 by jiki — 2015-07-01T03:51:18Z
This program crashed when compiled and run with -m64 -inline. In 2.067, it works. ----------------------- import std.algorithm; import std.array; auto aafunc(string k) { enum aa = [ "K": "V" ]; auto p = k in aa; return null; } auto mapfun(R)(R words, string k) { return words.map!(s=>aafunc(k)).array; } void main() { auto r = [""].mapfun(""); }
Comment #1 by k.hara.pg — 2015-07-01T15:59:35Z
Comment #2 by k.hara.pg — 2015-07-01T16:20:11Z
Reduced test case: auto aafunc(string k) { enum aa = [ "K": "V" ]; auto p = k in aa; return null; } struct MapResult(alias fun, R) { R _input; @property auto ref front() { return fun(_input[0]); } } auto array(R)(R r) { alias E = typeof(r.front); E[] result; result ~= r.front; return result; } auto mapfun(R)(R words, string k) { return array(MapResult!(s => aafunc(k), R)(words)); } void main() { auto r = mapfun([""], ""); }
Comment #3 by k.hara.pg — 2015-07-01T16:31:11Z
Comment #4 by github-bugzilla — 2015-07-02T09:44:18Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/46acdb60537358bd742543d55e97e22eeacc33a5 fix Issue 14754 - 64bit wrong code with -inline https://github.com/D-Programming-Language/dmd/commit/92c37006e20eb900febff03fb287a58648c5b36c Merge pull request #4795 from 9rnsr/fix14754 [REG2.068b1] Issue 14754 - 64bit wrong code with -inline
Comment #5 by github-bugzilla — 2015-07-07T11:10:56Z
Commit pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/22e27f5d84dc39d005106303986d91525e2834bf Merge pull request #4795 from 9rnsr/fix14754 [REG2.068b1] Issue 14754 - 64bit wrong code with -inline
Comment #6 by github-bugzilla — 2015-07-24T03:20:18Z
Comment #7 by github-bugzilla — 2015-10-04T18:18:57Z
Comment #8 by github-bugzilla — 2017-07-22T12:35:52Z
Commits pushed to dmd-cxx at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/46acdb60537358bd742543d55e97e22eeacc33a5 fix Issue 14754 - 64bit wrong code with -inline https://github.com/dlang/dmd/commit/92c37006e20eb900febff03fb287a58648c5b36c Merge pull request #4795 from 9rnsr/fix14754