Bug 19296 – ICE on Unknown member type in struct returned from function

Status
RESOLVED
Resolution
WORKSFORME
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2018-10-10T08:47:39Z
Last change time
2020-03-21T03:56:40Z
Keywords
CTFE, ice
Assigned to
No Owner
Creator
MrSmith33

Comments

Comment #0 by mrsmith33 — 2018-10-10T08:47:39Z
Non-reduced code https://gist.github.com/MrSmith33/d8b2ecdbab7b16aa1f1238959e8b78a0 Error: CTFE internal error: ErrorExp in `D:\bug_dmd.d(2932)` --- ERROR: This is a compiler bug. Please report it via https://issues.dlang.org/enter_bug.cgi with, preferably, a reduced, reproducible example and the information below. DustMite (https://github.com/CyberShadow/DustMite/wiki) can help with the reduction. --- DMD v2.082.0 predefs DigitalMars Windows LittleEndian D_Version2 all D_SIMD D_InlineAsm_X86_64 X86_64 Win64 CRuntime_Microsoft D_LP64 unittest assert D_ModuleInfo D_Exceptions D_TypeInfo D_HardFloat binary C:\Soft\dmd2\windows\bin\dmd.exe version v2.082.0 config C:\Soft\dmd2\windows\bin\sc.ini DFLAGS -IC:\Soft\dmd2\windows\bin\..\..\src\phobos -IC:\Soft\dmd2\windows\bin\..\..\src\druntime\import -L/OPT:NOICF --- object.Error@(0): Illegal Instruction ---------------- 0x004483DC 0x004B2662 0x00406B8E 0x00593561 0x004488B1 0x005786E2 0x004E227C 0x00682FC7 0x0045CC1F 0x77E82309 in RtlRandom 0x00582D31 0x77E77614 in RtlAllocateHeap
Comment #1 by simen.kjaras — 2018-10-10T11:10:05Z
Reduced: S[] arr = [s()]; S s() { return S.init; } struct S { UnknownType fail; }
Comment #2 by b2.temp — 2019-12-12T01:03:53Z
ICE is fixed when compiling with latest stable