From b4d7c09cdaa23009c785df1fc986959edee360e8 Mon Sep 17 00:00:00 2001 From: Martin Kinkelin Date: Fri, 26 Apr 2019 19:38:00 +0200 Subject: [PATCH] Fix repainting of compile-time reals for targets with 64-bit reals By converting the real_t to a `double` and repainting that value. E.g., this fixes druntime-test-hash for MSVC targets; core.internal.hash.hashOf!(real) reinterprets a 64-bit (target) `real` as `ulong`, and that code path is taken at CTFE too. --- dmd/compiler.d | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dmd/compiler.d b/dmd/compiler.d index a349dc970a5..e697250e113 100644 --- a/dmd/compiler.d +++ b/dmd/compiler.d @@ -160,6 +160,9 @@ else case Tfloat64: u.float64value = cast(double) e.toReal(); break; + case Tfloat80: + assert(e.type.size() == 8); // 64-bit target `real` + goto case Tfloat64; default: assert(0, "Unsupported source type"); } @@ -187,6 +190,10 @@ else emplaceExp!(RealExp)(pue, e.loc, r, type); break; + case Tfloat80: + assert(type.size() == 8); // 64-bit target `real` + goto case Tfloat64; + default: assert(0, "Unsupported target type"); }