llvm-project
llvm-project copied to clipboard
[clang][CodeGen] Assertion failure for dynamically-initialized const variable with addrspace
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();
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.)
@llvm/issue-subscribers-clang-codegen
Author: Bruno De Fraine (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();
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.)