Bug 15251 – [REG2.069.0-rc1] std.datetime bug with -inline

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-10-27T09:36:00Z
Last change time
2015-10-31T19:52:18Z
Keywords
CTFE, pull
Assigned to
nobody
Creator
trikko

Attachments

IDFilenameSummaryContent-TypeSize
1559bug.zipMinimized test caseapplication/zip629

Comments

Comment #0 by trikko — 2015-10-27T09:36:53Z
Created attachment 1559 Minimized test case The attached code doesn't work with 2.069rc1. It works with beta. It says: Error: cannot cast cast(ubyte)20u to void at compile time
Comment #1 by dlang-bugzilla — 2015-10-27T09:44:38Z
Comment #2 by dlang-bugzilla — 2015-10-27T09:44:52Z
Sorry, wrong window
Comment #3 by code — 2015-10-27T10:22:54Z
cat > a.d << CODE import std.net.curl; CODE cat > b.d << CODE import std.datetime; string J(Date L) { return L.toISOExtString; } CODE dmd -inline -o- a.d b.d ---- Error: cannot cast cast(ubyte)20u to void at compile time /usr/include/dmd/phobos/std/conv.d(1259): called from here: array(toChars(value + 0LU)) /usr/include/dmd/phobos/std/conv.d(861): called from here: toImpl(value, 10u, cast(LetterCase)false) /usr/include/dmd/phobos/std/format.d(3490): called from here: to(n) /usr/include/dmd/phobos/std/format.d(3501): called from here: gencode() /usr/include/dmd/phobos/std/format.d(3501): Error: argument to mixin must be a string, not (gencode()) of type string /usr/include/dmd/phobos/std/format.d(545): Error: template instance std.format.formatNth!(Appender!string, char, const(short), const(Month), const(ubyte)) error instantiating ---- Confirmed, currently reducing.
Comment #4 by dlang-bugzilla — 2015-10-27T10:49:58Z
Comment #5 by code — 2015-10-27T14:21:15Z
(In reply to Martin Nowak from comment #3) > Confirmed, currently reducing. Not much better. cat > bug.d << CODE import std.concurrency; void receiveAsyncChunks(Tid fromTid) { fromTid.send(thisTid); } CODE
Comment #6 by k.hara.pg — 2015-10-28T04:13:22Z
Comment #7 by github-bugzilla — 2015-10-28T08:40:38Z
Commits pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/5ea992ff02f216438341f17835560d3d818124be fix Issue 15251 - std.datetime bug with -inline The problem is in CTFE interpreter. Inlining had introduced `cast(void)` expression to `ForStatement.increment` part, then it had hit following interpret issues. 1. `CastExp.interpret` does not work for `cast(void)` if `goal` is not `ctfeNeedNothing`. 2. `ForStatement.interpert` does not evaluate its `increment` part with `ctfeNeedNothing`. I fix both of them for the best work, although fixing one of them can fix the original issue, https://github.com/D-Programming-Language/dmd/commit/1b21ea36893838e30e6b861b4e9000a276cad5d6 Merge pull request #5235 from 9rnsr/fix15251 [REG2.069.0-rc1] Issue 15251 - std.datetime bug with -inline
Comment #8 by code — 2015-10-30T15:28:18Z
*** Issue 15252 has been marked as a duplicate of this issue. ***
Comment #9 by github-bugzilla — 2015-10-31T19:52:18Z