[Issue 20042] New: __vector CTFE crashes the compiler

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 10 19:52:29 UTC 2019


          Issue ID: 20042
           Summary: __vector CTFE crashes the compiler
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: thomas.bockman at gmail.com

import std.stdio;

struct Vec4 {
    __vector(float[4]) raw;

    this(const(float[4]) value...) inout pure @safe nothrow @nogc {
        __vector(float[4]) raw;
        raw[] = value[];
        this.raw = raw;

void main() {
    static immutable Vec4 v = Vec4(  1.0f, 2.0f, 3.0f, 4.0f );

    static foreach(d; 0 .. 4)
        write(v.raw[d], " ");

Attempting to compile the above yields "Illegal instruction (core dumped)".
Removing the `static immutable` makes everything work as expected.


More information about the Digitalmars-d-bugs mailing list