-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[18 regression] PHINode should have one entry for each predecessor of its parent basic block! #85552
Labels
Comments
The issue appears to still exist on trunk. |
At a glance, the IR that codegen produces for |
This is a clang codegen bug.
|
@llvm/issue-subscribers-clang-codegen Author: Bernhard Rosenkraenzer (berolinux)
```
$ clang++ -o test.o -c test.cc -O1
PHINode should have one entry for each predecessor of its parent basic block!
%2 = phi ptr [ poison, <null operand!> ], [ null, %dynamic_cast.null ]
fatal error: error in backend: Broken module found, compilation aborted!
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: clang++ -Wno-unused-value -o test.o -c test.cc -O1
1. <eof> parser at end of file
2. Optimizer
#0 0x00007f390239a576 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib64/libLLVM.so.18.1+0x459a576)
#1 0x00007f39023991ea llvm::sys::RunSignalHandlers() (/usr/lib64/libLLVM.so.18.1+0x45991ea)
#2 0x00007f39022b119d (/usr/lib64/libLLVM.so.18.1+0x44b119d)
#3 0x00007f39022b10ad llvm::CrashRecoveryContext::HandleExit(int) (/usr/lib64/libLLVM.so.18.1+0x44b10ad)
#4 0x00007f39023928bb (/usr/lib64/libLLVM.so.18.1+0x45928bb)
#5 0x0000556cde35771a (/usr/bin/clang-18+0x1771a)
#6 0x00007f39022c7747 llvm::report_fatal_error(llvm::Twine const&, bool) (/usr/lib64/libLLVM.so.18.1+0x44c7747)
#7 0x00007f39022c7606 (/usr/lib64/libLLVM.so.18.1+0x44c7606)
#8 0x00007f39026f6c17 (/usr/lib64/libLLVM.so.18.1+0x48f6c17)
#9 0x00007f390a7a0c8f (/usr/lib64/libclang-cpp.so.18.1+0x2da0c8f)
#10 0x00007f3902685407 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/lib64/libLLVM.so.18.1+0x4885407)
#11 0x00007f390a79345a (/usr/lib64/libclang-cpp.so.18.1+0x2d9345a)
#12 0x00007f390a78bd7b clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) (/usr/lib64/libclang-cpp.so.18.1+0x2d8bd7b)
#13 0x00007f390ac1a68f clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/usr/lib64/libclang-cpp.so.18.1+0x321a68f)
#14 0x00007f3909245246 clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib64/libclang-cpp.so.18.1+0x1845246)
#15 0x00007f390b78285b clang::FrontendAction::Execute() (/usr/lib64/libclang-cpp.so.18.1+0x3d8285b)
#16 0x00007f390b6e6b09 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib64/libclang-cpp.so.18.1+0x3ce6b09)
#17 0x00007f390b801daa clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib64/libclang-cpp.so.18.1+0x3e01daa)
#18 0x0000556cde357036 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/bin/clang-18+0x17036)
#19 0x0000556cde352cef (/usr/bin/clang-18+0x12cef)
#20 0x00007f390b2c236b (/usr/lib64/libclang-cpp.so.18.1+0x38c236b)
#21 0x00007f39022b1033 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/usr/lib64/libLLVM.so.18.1+0x44b1033)
#22 0x00007f390b2c2253 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (/usr/lib64/libclang-cpp.so.18.1+0x38c2253)
#23 0x00007f390b27aec7 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/usr/lib64/libclang-cpp.so.18.1+0x387aec7)
#24 0x00007f390b27b3de clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/usr/lib64/libclang-cpp.so.18.1+0x387b3de)
#25 0x00007f390b2bd91f clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/usr/lib64/libclang-cpp.so.18.1+0x38bd91f)
#26 0x0000556cde352265 clang_main(int, char**, llvm::ToolContext const&) (/usr/bin/clang-18+0x12265)
#27 0x0000556cde361f36 main (/usr/bin/clang-18+0x21f36)
#28 0x00007f38fd83dc0a (/usr/lib64/libc.so.6+0x29c0a)
#29 0x00007f38fd83dcc5 __libc_start_main (/usr/lib64/libc.so.6+0x29cc5)
#30 0x0000556cde34ee71 _start (/usr/bin/clang-18+0xee71)
clang++: error: clang frontend command failed with exit code 70 (use -v to see invocation)
```
Reduced test case: struct a {
virtual void b();
};
struct c {
a *operator*();
bool operator!=(c);
void operator++();
c begin();
c end();
} d;
template <typename e> void g() {
for (a *f : d)
dynamic_cast<e *>(f);
}
struct h final : protected a {};
void i() { g<h>; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reduced test case:
The text was updated successfully, but these errors were encountered: