Bug 17622 – [REG2.075.0-b1] Wrong code with appender and -inline

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-07-08T16:52:00Z
Last change time
2017-08-16T13:20:05Z
Keywords
wrong-code
Assigned to
No Owner
Creator
steven kladitis
See also
https://issues.dlang.org/show_bug.cgi?id=17632

Comments

Comment #0 by steven_kladitis — 2017-07-08T16:52:00Z
Comment #1 by steven_kladitis — 2017-07-08T16:57:02Z
when using -inline in 64 bit mode all apps I have the goto the web do not work. -m64 -inline on windows 10 64 bit Windows comes back with a message about debugging the app. Without -inline they work. compiler --> DMD32 D Compiler 2.075.0-b2
Comment #2 by dlang-bugzilla — 2017-07-08T19:01:04Z
Please provide a full self-contained test case, so that we can reproduce the bug.
Comment #3 by steven_kladitis — 2017-07-12T13:50:54Z
void main() { import std.stdio, std.base64, std.net.curl, std.string; const f = "http://rosettacode.org/favicon.ico".get.representation; Base64.encode(f).writeln; } ---- the above fails in -m32 or -m64 when using -inline -- without -inline they execute immediately.
Comment #4 by dlang-bugzilla — 2017-07-15T03:32:55Z
(In reply to steven kladitis from comment #3) > ---- the above fails in -m32 or -m64 when using -inline Thanks, reprocuded. Reducing.
Comment #5 by dlang-bugzilla — 2017-07-15T03:50:12Z
This is a regression. Introduced in https://github.com/dlang/dmd/pull/6852 Partial reduction: //////////////// test.d //////////////// void main() { import std.array : appender; auto content = appender!(ubyte[])(); auto rdg = () { auto x = content.data; }; content.put(new ubyte[912]); } ////////////////////////////////////////
Comment #6 by dlang-bugzilla — 2017-07-15T04:17:52Z
Reduced: //////// test.d /////// struct S { int i; this(ubyte) { return; } void fun() { assert(i == 0); } } S make() { return S(0); } void main() { S s = make(); auto rdg = { s.fun(); }; s.fun(); } ///////////////////////
Comment #7 by bugzilla — 2017-08-02T09:00:11Z
Comment #8 by dlang-bugzilla — 2017-08-03T03:46:05Z
*** Issue 14793 has been marked as a duplicate of this issue. ***
Comment #9 by code — 2017-08-03T17:05:56Z
*** Issue 17632 has been marked as a duplicate of this issue. ***
Comment #10 by github-bugzilla — 2017-08-03T17:10:20Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/c73fe970c2014058b9544524d1809180db13cfbb fix Issue 17622 - [REG2.075.0-b1] Wrong code with appender and -inline https://github.com/dlang/dmd/commit/17473d2e6248da9fbb746ed8314b0ee488961156 Merge pull request #7056 from WalterBright/fix17622 fix Issue 17622 - [REG2.075.0-b1] Wrong code with appender and -inline merged-on-behalf-of: Martin Nowak <[email protected]>
Comment #11 by github-bugzilla — 2017-08-16T13:20:05Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/c73fe970c2014058b9544524d1809180db13cfbb fix Issue 17622 - [REG2.075.0-b1] Wrong code with appender and -inline https://github.com/dlang/dmd/commit/17473d2e6248da9fbb746ed8314b0ee488961156 Merge pull request #7056 from WalterBright/fix17622