Bug 19391 – [ICE] static array comparison

Status
RESOLVED
Resolution
WONTFIX
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2018-11-12T00:19:14Z
Last change time
2023-01-08T20:15:43Z
Keywords
ice, ice-on-valid-code
Assigned to
No Owner
Creator
Nicholas Wilson

Comments

Comment #0 by iamthewilsonator — 2018-11-12T00:19:14Z
see this commit[1] which worked around it [1]:https://github.com/libmir/mir-algorithm/commit/c804962c99467168484dbf084bbe491bcd2da2a7 --- auto slice = iota(2, 3).universal.assumeContiguous; ... - assert(slice._strides == []); // <<< Crashes + static assert(slice._strides.length == 0); // the workaround --- slice._strides is an alias to the second member of a tuple, which somehow ends up wrongly having the type const(long[1]) outside of CTFE (since the static assert passes) which when compared for equality to [] (which is inferred as long[0]) fails in e2ir.d when DMD tries to optimise the comparison to a memcmp because the size of the two arrays do not match, tripping an assert[2] assert(t1.size() == t2.size()); where t1,t2 are the type of the static arrays. [2]: https://github.com/dlang/dmd/blob/master/src/dmd/e2ir.d#L2436
Comment #1 by bugzilla — 2018-12-11T08:23:04Z
It is really helpful to have: 1. compilable examples, so it is not necessary to guess the rest 2. minimized examples that do not pull in complex templates
Comment #2 by razvan.nitu1305 — 2021-02-23T13:33:58Z
I am tempted to close this as there is no straightforward way to reproduce this. Also, when labeling an issue as a regression, the last working version should be pointed out. Until more information is provided on this, I will downgrade its importance to normal.
Comment #3 by b2.temp — 2023-01-08T20:15:43Z
still no reduced code after 4 years.