LDC internal error message (with no line number) but source compiles ok with GDC
Cecil Ward
cecil at cecilward.com
Wed Jun 14 00:00:06 UTC 2023
The short D module below compiles successfully with GDC but LDC
fails:
gdc 13.1 : -O3 -frelease -march=native
compiles ok
ldc 1.32.1: -O3 -release -mcpu=native
== ldc ::
sext source and destination must both be a vector or neither
%26 = sext i32 9 to <4 x i64>
LLVM ERROR: Broken function found, compilation aborted!
Stack dump without symbol names (ensure you have llvm-symbolizer
in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to
point to it):
/opt/compiler-explorer/ldc1.32.1/ldc2-1.32.1-linux-x86_64/bin/ldc2(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamEi+0x23)[0x56402ddef413]
Compiler returned: 139
== D source code follows: ==
import std.stdint;
import core.simd;
public
uint64_t
hashi( const uint64_t * p, size_t len ) pure nothrow @nogc
{
uint64_t s = 0;
for ( size_t i = 0; i < len; i++ )
{
s ^= ( p[i] * 509 ) ^ ( p[i] >>> 9 );
}
return s;
}
alias uint64_256_t = ulong4;
alias uint64x4_t = uint64_256_t;
alias uint64_32_t = uint64_256_t;
public
uint64_t
hashv( const uint64_256_t * p, size_t len ) pure nothrow @nogc
{
uint64_256_t s1 = [0, 0, 0, 0];
for ( size_t i = 0; i < len; i++ )
{
const x = p[i];
s1 ^= (x * 509) ^ (x >>> 9);
}
const nsz = (*p).sizeof * 8 / 64;
const uint64_t[nsz] v = cast(uint64_t[nsz]) s1;
uint64_t s = 0;
for ( size_t i = 0; i < len; i++ )
{
s ^= v[i];
}
return s;
}
More information about the digitalmars-d-ldc
mailing list