Skip to content

LLVM IR Gen: Assertion Align != 0u failure in llvm::alignTo during Record Layout #165452

@Theaamadu

Description

@Theaamadu

Compiler Explorer: https://godbolt.org/z/f5Mqhs96E

  • clang start crashing on 11.0.0
  • generated by fuzzer

Console

PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: /opt/compiler-explorer/clang-11.0.0/bin/clang -g -o /app/output.s -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-10.2.0 -fcolor-diagnostics -fno-crash-diagnostics <source> 
1.	<source>:5:2: current parser token ';'
2.	<source>:2:1: parsing struct/union body 'S2823'
 #0 0x0000586aabaab47a llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x2cab47a)
 #1 0x0000586aabaa9224 llvm::sys::RunSignalHandlers() (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x2ca9224)
 #2 0x0000586aabaa9495 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x2ca9495)
 #3 0x0000586aaba1dcc0 CrashRecoverySignalHandler(int) (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x2c1dcc0)
 #4 0x000070a00c042520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #5 0x0000586aadf3b008 clang::ASTContext::getTypeInfoImpl(clang::Type const*) const (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x513b008)
 #6 0x0000586aadf2fa9d clang::ASTContext::getTypeInfo(clang::Type const*) const (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x512fa9d)
 #7 0x0000586aadf3b2cf clang::ASTContext::getTypeInfoImpl(clang::Type const*) const (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x513b2cf)
 #8 0x0000586aadf2fa9d clang::ASTContext::getTypeInfo(clang::Type const*) const (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x512fa9d)
 #9 0x0000586aadf382f5 clang::ASTContext::getTypeInfoInChars(clang::Type const*) const (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x51382f5)
#10 0x0000586aadf38409 clang::ASTContext::getTypeSizeInChars(clang::QualType) const (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x5138409)
#11 0x0000586aad7ffc4c clang::Sema::ActOnFields(clang::Scope*, clang::SourceLocation, clang::Decl*, llvm::ArrayRef<clang::Decl*>, clang::SourceLocation, clang::SourceLocation, clang::ParsedAttributesView const&) (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x49ffc4c)
#12 0x0000586aad616046 clang::Parser::ParseStructUnionBody(clang::SourceLocation, clang::TypeSpecifierType, clang::RecordDecl*) (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x4816046)
#13 0x0000586aad6291d8 clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext, clang::Parser::ParsedAttributesWithRange&) (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x48291d8)
#14 0x0000586aad60aaab clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x480aaab)
#15 0x0000586aad5e6c18 clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x47e6c18)
#16 0x0000586aad5e7af1 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (.part.228) (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x47e7af1)
#17 0x0000586aad5ed9c9 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x47ed9c9)
#18 0x0000586aad5ef0d9 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool) (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x47ef0d9)
#19 0x0000586aad5e2d19 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x47e2d19)
#20 0x0000586aac297479 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x3497479)
#21 0x0000586aac250f9b clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x3450f9b)
#22 0x0000586aac35db2b clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x355db2b)
#23 0x0000586aa9c8614c cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-11.0.0/bin/clang+0xe8614c)
#24 0x0000586aa9c82c4d ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) (/opt/compiler-explorer/clang-11.0.0/bin/clang+0xe82c4d)
#25 0x0000586aac128c45 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const::'lambda'()>(long) (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x3328c45)
#26 0x0000586aaba1dda3 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x2c1dda3)
#27 0x0000586aac129720 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const (.part.148) (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x3329720)
#28 0x0000586aac1038f5 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x33038f5)
#29 0x0000586aac10433f clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x330433f)
#30 0x0000586aac10ced5 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) (/opt/compiler-explorer/clang-11.0.0/bin/clang+0x330ced5)
#31 0x0000586aa9bc2dc1 main (/opt/compiler-explorer/clang-11.0.0/bin/clang+0xdc2dc1)
#32 0x000070a00c029d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#33 0x000070a00c029e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#34 0x0000586aa9c827ca _start (/opt/compiler-explorer/clang-11.0.0/bin/clang+0xe827ca)
clang-11: error: clang frontend command failed due to signal (use -v to see invocation)
Compiler returned: 254

Code

typedef int __attribute__((vector_size(-16))) v4si;
struct S2823 {
  v4si a;
//  int b[0];
};
void checkx2823(struct S2823 args){};

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions