Skip to content

clang::CodeGen::CGBuilderTy::CreateStructGEP crash: Assertion `Idx < NumElements && "Invalid element idx!"' failed. (llvm/IR/DataLayout.h) #59223

Open
@eridys

Description

I'm experiencing a crash in

clang++: llvm-project/llvm/include/llvm/IR/DataLayout.h:653: 
uint64_t llvm::StructLayout::getElementOffset(unsigned int) const: 
Assertion `Idx < NumElements && "Invalid element idx!"' failed.

According to "How to submit an LLVM bug report" this seems to be a "middle-end optimization bug" - test-case.bc.gz attached.

clang version 15.0.6 (https://github.com/llvm/llvm-project.git e6e61e9b2ef7c0fa3fe2cd7c612e00ecf57a9dd8)
Target: x86_64-unknown-linux-gnu

(applies to any prior 15.* version, too)

Note: one peculiarity I use during compilation is the option --unsigned-char on a x86-64 system.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    clang:codegencrashPrefer [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