<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - ICE when combining module PCMs"
href="https://bugs.llvm.org/show_bug.cgi?id=49569">49569</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>ICE when combining module PCMs
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++2a
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ryan.burn@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>This produces an ICE.
// a.h
#include <iostream>
inline void do_a() {
std::cout << "A\n";
}
// iostream.h
#include <iostream>
// main.cc
import "a.h";
import <iostream>;
int main() {
do_a();
return 0;
}
If I run
clang -std=c++20 -I. --precompile -x c++-header a.h -fmodule-name=header -o
a.pcm
clang -std=c++20 -I. --precompile -x c++-header iostream.h
-fmodule-name=header -o iostream.pcm
clang -std=c++20 -fmodule-file=./a.pcm -fmodule-file=./iostream.pcm -I. -c
main.cc -o main.o
I get the below ICE.
This is my compiler version
root@15a43977d8e1:/t/clang-pch# clang++ --version
clang version 13.0.0 (<a href="https://github.com/llvm/llvm-project.git">https://github.com/llvm/llvm-project.git</a>
6708186c91dd7c5463b83091ade40e721c0e62ab)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
root@15a43977d8e1:/t/clang-pch# clang -std=c++20 -fmodule-file=./a.pcm
-fmodule-file=./iostream.pcm -I. -c main.cc -o main.o
fatal error: module 'header' is defined in both './a.pcm' and './iostream.pcm'
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: clang -std=c++20 -fmodule-file=./a.pcm
-fmodule-file=./iostream.pcm -I. -c main.cc -o main.o
#0 0x00005579bb771c8c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/usr/local/bin/clang-13+0x2ffbc8c)
#1 0x00005579bb76fa34 llvm::sys::RunSignalHandlers()
(/usr/local/bin/clang-13+0x2ff9a34)
#2 0x00005579bb76fcb5 llvm::sys::CleanupOnSignal(unsigned long)
(/usr/local/bin/clang-13+0x2ff9cb5)
#3 0x00005579bb6d4e92 llvm::CrashRecoveryContext::HandleExit(int)
(/usr/local/bin/clang-13+0x2f5ee92)
#4 0x00005579bb76889e llvm::sys::Process::Exit(int, bool)
(/usr/local/bin/clang-13+0x2ff289e)
#5 0x00005579b96c636e LLVMErrorHandler(void*, std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&, bool) cc1_main.cpp:0:0
#6 0x00005579bb6db3f9 llvm::report_fatal_error(llvm::Twine const&, bool)
(/usr/local/bin/clang-13+0x2f653f9)
#7 0x00005579bb6db57e (/usr/local/bin/clang-13+0x2f6557e)
#8 0x00005579bc162590 clang::ASTReader::ReadDeclRecord(unsigned int)
(/usr/local/bin/clang-13+0x39ec590)
#9 0x00005579bc0f82bd clang::ASTReader::GetDecl(unsigned int)
(/usr/local/bin/clang-13+0x39822bd)
#10 0x00005579bc15c5be
clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl*)
(/usr/local/bin/clang-13+0x39e65be)
#11 0x00005579bc15d195
clang::ASTDeclReader::VisitCXXMethodDecl(clang::CXXMethodDecl*)
(/usr/local/bin/clang-13+0x39e7195)
#12 0x00005579bc161021 clang::ASTDeclReader::Visit(clang::Decl*)
(/usr/local/bin/clang-13+0x39eb021)
#13 0x00005579bc1617ae clang::ASTReader::ReadDeclRecord(unsigned int)
(/usr/local/bin/clang-13+0x39eb7ae)
#14 0x00005579bc0f82bd clang::ASTReader::GetDecl(unsigned int)
(/usr/local/bin/clang-13+0x39822bd)
#15 0x00005579bc152387 clang::ASTDeclReader::UpdateDecl(clang::Decl*,
llvm::SmallVectorImpl<unsigned int>&) (/usr/local/bin/clang-13+0x39dc387)
#16 0x00005579bc1540e6
clang::ASTReader::loadDeclUpdateRecords(clang::ASTReader::PendingUpdateRecord&)
(/usr/local/bin/clang-13+0x39de0e6)
#17 0x00005579bc112289 clang::ASTReader::finishPendingActions()
(/usr/local/bin/clang-13+0x399c289)
#18 0x00005579bc12beec clang::ASTReader::ReadAST(llvm::StringRef,
clang::serialization::ModuleKind, clang::SourceLocation, unsigned int,
llvm::SmallVectorImpl<clang::ASTReader::ImportedSubmodule>*)
(/usr/local/bin/clang-13+0x39b5eec)
#19 0x00005579bbf9db8e clang::CompilerInstance::loadModuleFile(llvm::StringRef)
(/usr/local/bin/clang-13+0x3827b8e)
#20 0x00005579bbff714d
clang::FrontendAction::BeginSourceFile(clang::CompilerInstance&,
clang::FrontendInputFile const&) (/usr/local/bin/clang-13+0x388114d)
#21 0x00005579bbf93f12
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/bin/clang-13+0x381df12)
#22 0x00005579bc0bb263
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/bin/clang-13+0x3945263)
#23 0x00005579b96c7d3c cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/bin/clang-13+0xf51d3c)
#24 0x00005579b96c3ebd ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
driver.cpp:0:0
#25 0x00005579bbe49d95 void llvm::function_ref<void
()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
<span class="quote">>, std::__cxx11::basic_string<char, std::char_traits<char>,</span >
std::allocator<char> >*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#26 0x00005579bb6d4d23
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/usr/local/bin/clang-13+0x2f5ed23)
#27 0x00005579bbe4a6c8
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
<span class="quote">>, std::__cxx11::basic_string<char, std::char_traits<char>,</span >
std::allocator<char> >*, bool*) const (.part.166) Job.cpp:0:0
#28 0x00005579bbe22a9a
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const (/usr/local/bin/clang-13+0x36aca9a)
#29 0x00005579bbe235ef
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/usr/local/bin/clang-13+0x36ad5ef)
#30 0x00005579bbe2c4f5
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/usr/local/bin/clang-13+0x36b64f5)
#31 0x00005579b95ecc4e main (/usr/local/bin/clang-13+0xe76c4e)
#32 0x00007f6cff421bf7 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21bf7)
#33 0x00005579b96c3a3a _start (/usr/local/bin/clang-13+0xf4da3a)
clang-13: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 13.0.0 (<a href="https://github.com/llvm/llvm-project.git">https://github.com/llvm/llvm-project.git</a>
6708186c91dd7c5463b83091ade40e721c0e62ab)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-13: note: diagnostic msg: Error generating preprocessed source(s).</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>