← Back to index
|
Original Bugzilla link
Bug 19932 – ICE: compiler crashes when reading ifloat/idouble as uint/ulong during CTFE
Status
NEW
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-06-01T22:16:17Z
Last change time
2024-12-13T19:03:39Z
Keywords
CTFE, ice
Assigned to
No Owner
Creator
Nathan S.
Moved to GitHub: dmd#19574 →
Comments
Comment #0
by n8sh.secondary — 2019-06-01T22:16:17Z
Example: ---- auto getBits(U, T)(const T value) if (T.sizeof == U.sizeof && T.alignof >= U.alignof && __traits(isUnsigned, U)) { return *cast(U*) &value; } void main() { const floatBits = getBits!(uint, float)(1.0f); // fine const doubleBits = getBits!(ulong, double)(1.0); // fine const ifloatBits = getBits!(uint, ifloat)(1.0i); // fine const idoubleBits = getBits!(ulong, idouble)(1.0i); // fine enum ctfeFloatBits = getBits!(uint, float)(1.0f); // fine enum ctfeDoubleBits = getBits!(ulong, double)(1.0); // fine //enum ctfeIFloatBits = getBits!(uint, ifloat)(1.0i); // crashes compiler //enum ctfeIDoubleBits = getBits!(ulong, idouble)(1.0i); // crashes compiler } ----
Comment #1
by robert.schadek — 2024-12-13T19:03:39Z
THIS ISSUE HAS BEEN MOVED TO GITHUB
https://github.com/dlang/dmd/issues/19574
DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB