Skip to content

clang: Assertion fail for simple _Bitint code #83419

@dcb314

Description

@dcb314

Given this source code:

void f()
{
	static _BitInt(130) p = {}; 
}

then recent clang trunk does this:

$ clang -c bug38.c
clang: /home/dcb38/llvm/trunk/clang/lib/CodeGen/CGDecl.cpp:366: llvm::GlobalVariable* clang::CodeGen::CodeGenFunction::AddInitializerToStaticVarDecl(const clang
::VarDecl&, llvm::GlobalVariable*): Assertion `VarSize == CstSize && "Emitted constant has unexpected size"' failed.

A slightly smaller size of 120 seems to work ok. It looks like the
boundary size is likely to be 128 or so.

If this is a fixed boundary, a tidy "not implemented" error message
is better than an assertion fail and a crash.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions