Skip to content

__vector << int produce ICE, should be illegal? #3606

@p0nce

Description

@p0nce

The following program crashes LDC 1.24.0 and below too:

import core.simd;
void fun()
{
    int4 A;
    A = A << 8;
}

Output with LDC 1.24:

#1 with ldc beta
sext source and destination must both be a vector or neither
  %5 = sext i32 8 to <4 x i32>
in function _D7example3funFAAyaZv
LLVM ERROR: Broken function found, compilation aborted!
/opt/compiler-explorer/ldcbeta/bin/ldc2[0x33f03d4]
Compiler returned: 255

DMD output is correct:

<source>(6): Error: incompatible types for `(A) << (8)`: `__vector(int[4])` and `int`
Compiler returned: 1

Interestingly it used to work in LDC 1.4.0 but doesn't since LDC 1.5.0 in Godbolt: https://d.godbolt.org/z/3Eb47n

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions