Bug 21123 – ICE during toChars() of weird CommaExp lowering

Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-08-05T19:06:39Z
Last change time
2020-08-10T20:20:57Z
Keywords
ice-on-valid-code
Assigned to
No Owner
Creator
kinke

Comments

Comment #0 by kinke — 2020-08-05T19:06:39Z
The following code hits an assertion in the frontend (and makes it crash with disabled assertions), presumably since v2.093 (as LDC v1.22 works), when compiling with `-vcg-ast` (in order to call toChars()): ----- struct Foo { static Foo make() { return Foo(); } size_t length() { return 0; } } void main() { auto x = Foo.make().make().length; } ----- The lowering for main is already weird with v2.092: ulong x = (make() , make)().length();
Comment #1 by razvan.nitu1305 — 2020-08-10T03:00:05Z
I think that this issue is fixed in the latest master. I cannot reproduce it. Can you please check if you can reproduce with git head and close this if it was fixed?
Comment #2 by kinke — 2020-08-10T18:42:56Z
Seems to be fixed indeed according to run.dlang.io. I'd like to see this in the v2.093.1 point release though, as it would e.g. seriously impede LDC debugging (-vv output etc.) for upcoming v1.23.
Comment #3 by kinke — 2020-08-10T19:20:43Z
(In reply to kinke from comment #2) > Seems to be fixed indeed according to run.dlang.io. Well I've assumed the nightly build there was up-to-date, but it's some old v2.091 build (as is the Windows nightly download). - Anyway, build it myself, and yes, fixed in master but not in stable.
Comment #4 by kinke — 2020-08-10T20:20:57Z
*** This issue has been marked as a duplicate of issue 21092 ***