Issue 235418
Summary [clang][PowerPC] Assertion `typeSize > 0 && "type size for vector must be greater than 0 bits"' failed.
Labels backend:PowerPC, clang:frontend, crash, generated by fuzzer
Assignees
Reporter k-arrows
    Reproducer:
https://godbolt.org/z/Y5fvzenq8
```cpp
vector void foo();
```

Backtrace:
```console
clang++: /root/llvm-project/llvm/tools/clang/lib/Sema/SemaType.cpp:1456: clang::QualType ConvertDeclSpecToType({anonymous}::TypeProcessingState&): Assertion `typeSize > 0 && "type size for vector must be greater than 0 bits"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and dumped files.
Stack dump:
0.	Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -g -o /app/output.s -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -target powerpc64le-linux-gnu <source>
1.	<source>:1:18: current parser token ';'
 #0 0x0000000004ead098 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4ead098)
 #1 0x0000000004eaa2f4 llvm::sys::RunSignalHandlers() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4eaa2f4)
 #2 0x0000000004eaa92c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4eaa92c)
 #3 0x0000000004de3e28 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #4 0x0000717670045330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
 #5 0x000071767009ec0c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9ec0c)
 #6 0x000071767004527e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
 #7 0x00007176700288ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
 #8 0x000071767002881b (/lib/x86_64-linux-gnu/libc.so.6+0x2881b)
 #9 0x000071767003b517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
#10 0x0000000009bbedc7 GetDeclSpecTypeForDeclarator((anonymous namespace)::TypeProcessingState&, clang::TypeSourceInfo*&) (.constprop.0) SemaType.cpp:0:0
#11 0x0000000009bcac2c clang::Sema::GetTypeForDeclarator(clang::Declarator&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x9bcac2c)
#12 0x000000000931a984 clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x931a984)
#13 0x000000000931bbd4 clang::Sema::ActOnDeclarator(clang::Scope*, clang::Declarator&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x931bbd4)
#14 0x0000000008f0ef05 clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8f0ef05)
#15 0x0000000008f2f68a clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8f2f68a)
#16 0x0000000008ed883b clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8ed883b)
#17 0x0000000008ed902f clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8ed902f)
#18 0x0000000008ee5ca8 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8ee5ca8)
#19 0x0000000008ee6bc5 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8ee6bc5)
#20 0x0000000008ee6fd0 clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8ee6fd0)
#21 0x0000000008ec2e4c clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x8ec2e4c)
#22 0x00000000059a1778 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x59a1778)
#23 0x0000000005cc8228 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5cc8228)
#24 0x0000000005c54fed clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5c54fed)
#25 0x0000000005d9e573 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5d9e573)
#26 0x0000000001719578 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x1719578)
#27 0x000000000171045a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) driver.cpp:0:0
#28 0x00000000017105e3 int llvm::function_ref<int (llvm::SmallVectorImpl<char const*>&)>::callback_fn<clang_main(int, char**, llvm::ToolContext const&)::'lambda'(llvm::SmallVectorImpl<char const*>&)>(long, llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#29 0x0000000005a18d69 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#30 0x0000000004de4224 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4de4224)
#31 0x0000000005a198d5 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#32 0x00000000059d6f12 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x59d6f12)
#33 0x00000000059da1cc clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x59da1cc)
#34 0x00000000059e62d5 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x59e62d5)
#35 0x0000000001715baa clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x1715baa)
#36 0x00000000016833b3 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x16833b3)
#37 0x000071767002a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#38 0x000071767002a28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#39 0x000000000170fe05 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x170fe05)
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
Program terminated with signal SIGABRT (6)
Compiler returned: 134
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to