Skip to content

[clang][CodeGen] Assertion failure for dynamically-initialized const variable with addrspace #94345

Closed
@brunodf-snps

Description

@brunodf-snps

An assertion failure in clang prevents to use a const global variable in a (non-default) address space with a dynamic initialization, for example:

int f();
extern const int __attribute__((address_space(10))) test3 = f();

Godbolt demo

The issue is related to the emission of an llvm.invariant.start intrinsic in the dynamic initialization of const variables.

(Issue diagnosed with help from @kortbeek-snps.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:codegenIR generation bugs: mangling, exceptions, etc.confirmedVerified by a second partycrashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions