Open hubert-reinterpretcast opened 7 years ago
This still crashes on post 16 trunk(9094b3b4ae81e4778ab0b43a65890d8a5ce8d94e) https://godbolt.org/z/1GqzbP6jz
code
extern "C" auto bar() { return 0; }
auto f() __attribute__((__alias__("bar")));
dump
<source>:1:17: warning: 'bar' has C-linkage specified, but returns user-defined type 'auto' which is incompatible with C [-Wreturn-type-c-linkage]
1 | extern "C" auto bar() { return 0; }
| ^
undeduced type in IR-generation
UNREACHABLE executed at /root/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp:234!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -std=c++14 <source>
1. <eof> parser at end of file
2. <source>:2:6: LLVM IR generation of declaration 'f'
#0 0x00000000036df178 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x36df178)
#1 0x00000000036dce3c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x36dce3c)
#2 0x00000000036261f8 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x00007f1237e3f420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007f123790200b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
#5 0x00007f12378e1859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
#6 0x000000000363149a (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x363149a)
#7 0x0000000003a5d49a clang::CodeGen::CodeGenFunction::getEvaluationKind(clang::QualType) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3a5d49a)
#8 0x0000000003bb5d4f clang::CodeGen::isAggregateTypeForABI(clang::QualType) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3bb5d4f)
#9 0x0000000003b9ff46 (anonymous namespace)::X86_64ABIInfo::getIndirectReturnResult(clang::QualType) const X86.cpp:0:0
#10 0x0000000003baa58b (anonymous namespace)::X86_64ABIInfo::computeInfo(clang::CodeGen::CGFunctionInfo&) const X86.cpp:0:0
#11 0x0000000003d52aaf clang::CodeGen::CodeGenTypes::arrangeLLVMFunctionInfo(clang::CanQual<clang::Type>, clang::CodeGen::FnInfoOpts, llvm::ArrayRef<clang::CanQual<clang::Type>>, clang::FunctionType::ExtInfo, llvm::ArrayRef<clang::FunctionType::ExtParameterInfo>, clang::CodeGen::RequiredArgs) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3d52aaf)
#12 0x0000000003d56799 arrangeLLVMFunctionInfo(clang::CodeGen::CodeGenTypes&, bool, llvm::SmallVectorImpl<clang::CanQual<clang::Type>>&, clang::CanQual<clang::FunctionProtoType>) CGCall.cpp:0:0
#13 0x0000000003d56b9f clang::CodeGen::CodeGenTypes::arrangeFreeFunctionType(clang::CanQual<clang::FunctionProtoType>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3d56b9f)
#14 0x0000000003b1a230 clang::CodeGen::CodeGenTypes::ConvertFunctionTypeInternal(clang::QualType) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3b1a230)
#15 0x0000000003b1b455 clang::CodeGen::CodeGenTypes::ConvertType(clang::QualType) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3b1b455)
#16 0x0000000003b1c5e9 clang::CodeGen::CodeGenTypes::ConvertTypeForMem(clang::QualType, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3b1c5e9)
#17 0x0000000003ad1413 clang::CodeGen::CodeGenModule::EmitAliasDefinition(clang::GlobalDecl) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3ad1413)
#18 0x0000000003ace24b clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3ace24b)
#19 0x0000000003ad7a23 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (.part.0) CodeGenModule.cpp:0:0
#20 0x00000000049437b6 (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) ModuleBuilder.cpp:0:0
#21 0x00000000049343c8 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x49343c8)
#22 0x0000000005e39364 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x5e39364)
#23 0x0000000004940668 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4940668)
#24 0x00000000041a7f39 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x41a7f39)
#25 0x0000000004128d3e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4128d3e)
#26 0x000000000428727e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x428727e)
#27 0x0000000000bdaf7e cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xbdaf7e)
#28 0x0000000000bd2b0a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#29 0x0000000003f89619 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 0x00000000036266a4 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x36266a4)
#31 0x0000000003f89c0f 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 0x0000000003f51f55 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3f51f55)
#33 0x0000000003f529bd 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+++0x3f529bd)
#34 0x0000000003f5a8e5 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3f5a8e5)
#35 0x0000000000bd86ec clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xbd86ec)
#36 0x0000000000ad3c51 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xad3c51)
#37 0x00007f12378e3083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#38 0x0000000000bd25ee _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xbd25ee)
clang++: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
@llvm/issue-subscribers-clang-codegen
Extended Description
Clang ICEs when an alias is defined using a placeholder type.
SOURCE ():
COMPILER INVOCATION:
ACTUAL OUTPUT:
EXPECTED OUTPUT:
(clean compile)
COMPILER VERSION INFO (clang++ -v):