Skip to content

Miscompilation with -opaque-pointers=true with LLVM16 #4538

Open
@JohanEngelen

Description

@JohanEngelen

Testcase from druntime rt/lifetime.d line 2686 miscompiles with -opaque-pointers=true -O:

static struct S
{
    S* thisptr;
    ~this() { assert(&this == thisptr); thisptr = null;}  // This assertion is triggered
}

void main() {
    S[] test14126 = new S[2048]; // make sure we allocate at least a PAGE
    foreach (ref s; test14126)
    {
        s.thisptr = &s;
    }
}

(no need to add this testcase when the bug is fixed, because it is already part of the testsuite when opaque pointers are enabled)

Metadata

Metadata

Assignees

No one assigned

    Labels

    llvmRelated to LLVM

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions