<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 Getting frame offset for a dead object"
href="https://bugs.llvm.org/show_bug.cgi?id=38361">38361</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>ICE Getting frame offset for a dead object
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</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>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>zhonghao@pku.org.cn
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>The code is as follow:
#include <alloca.h>
#include <stdint.h>
int
main(void)
{
volatile char *a;
unsigned int i;
a = alloca(SIZE_MAX);
for (i = 0; i < 1; i++)
a[i] = 1;
return 0;
}
The error messages are as follows:
clang-7: /usr/local/lib/llvm7.0/include/llvm/CodeGen/MachineFrameInfo.h:470:
int64_t llvm::MachineFrameInfo::getObjectOffset(int) const: Assertion
`!isDeadObjectIndex(ObjectIdx) && "Getting frame offset for a dead object?"'
failed.
Stack dump:
0. Program arguments: /usr/local/bin/clang-7 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
code0.c -mrelocation-model static -mthread-model posix -mdisable-fp-elim
-fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables
-fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb
-coverage-notes-file
/home/haozhong/project/approach/otherreport/tool/bug.report.analyzer/code0.gcno
-resource-dir /usr/local/lib/clang/7.0.0 -internal-isystem /usr/local/include
-internal-isystem /usr/local/lib/clang/7.0.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -fdebug-compilation-dir
/home/haozhong/project/approach/otherreport/tool/bug.report.analyzer
-ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc
-fdiagnostics-show-option -o code0.o -x c
/home/haozhong/project/approach/otherreport/llvm/tmp/llvm_22340/code0.c
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module
'/home/haozhong/project/approach/otherreport/llvm/tmp/llvm_22340/code0.c'.
4. Running pass 'Prologue/Epilogue Insertion & Frame Finalization' on
function '@main'
#0 0x000055bbb18c9d1d llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/usr/local/lib/llvm7.0/lib/Support/Unix/Signals.inc:490:0
#1 0x000055bbb18c9db0 PrintStackTraceSignalHandler(void*)
/usr/local/lib/llvm7.0/lib/Support/Unix/Signals.inc:554:0
#2 0x000055bbb18c7b3a llvm::sys::RunSignalHandlers()
/usr/local/lib/llvm7.0/lib/Support/Signals.cpp:67:0
#3 0x000055bbb18c9740 SignalHandler(int)
/usr/local/lib/llvm7.0/lib/Support/Unix/Signals.inc:353:0
#4 0x00007f16b0b5c890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
#5 0x00007f16afc4fe97 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x3ee97)
#6 0x00007f16afc51801 abort (/lib/x86_64-linux-gnu/libc.so.6+0x40801)
#7 0x00007f16afc4139a (/lib/x86_64-linux-gnu/libc.so.6+0x3039a)
#8 0x00007f16afc41412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
#9 0x000055bbaf491ec4 llvm::MachineFrameInfo::getObjectOffset(int) const
/usr/local/lib/llvm7.0/include/llvm/CodeGen/MachineFrameInfo.h:469:0
#10 0x000055bbb046653f
llvm::X86FrameLowering::getFrameIndexReference(llvm::MachineFunction const&,
int, unsigned int&) const
/usr/local/lib/llvm7.0/lib/Target/X86/X86FrameLowering.cpp:1742:0
#11 0x000055bbb0405fc9
llvm::X86RegisterInfo::eliminateFrameIndex(llvm::MachineInstrBundleIterator<llvm::MachineInstr,
false>, int, unsigned int, llvm::RegScavenger*) const
/usr/local/lib/llvm7.0/lib/Target/X86/X86RegisterInfo.cpp:695:0
#12 0x000055bbb0cd7c6a (anonymous
namespace)::PEI::replaceFrameIndices(llvm::MachineBasicBlock*,
llvm::MachineFunction&, int&)
/usr/local/lib/llvm7.0/lib/CodeGen/PrologEpilogInserter.cpp:1115:0
#13 0x000055bbb0cd74fc (anonymous
namespace)::PEI::replaceFrameIndices(llvm::MachineFunction&)
/usr/local/lib/llvm7.0/lib/CodeGen/PrologEpilogInserter.cpp:1022:0
#14 0x000055bbb0cd3b57 (anonymous
namespace)::PEI::runOnMachineFunction(llvm::MachineFunction&)
/usr/local/lib/llvm7.0/lib/CodeGen/PrologEpilogInserter.cpp:217:0
#15 0x000055bbb0bc7cc9
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
/usr/local/lib/llvm7.0/lib/CodeGen/MachineFunctionPass.cpp:61:0
#16 0x000055bbb1094e28 llvm::FPPassManager::runOnFunction(llvm::Function&)
/usr/local/lib/llvm7.0/lib/IR/LegacyPassManager.cpp:1585:0
#17 0x000055bbb1094fe7 llvm::FPPassManager::runOnModule(llvm::Module&)
/usr/local/lib/llvm7.0/lib/IR/LegacyPassManager.cpp:1607:0
#18 0x000055bbb1095392 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
/usr/local/lib/llvm7.0/lib/IR/LegacyPassManager.cpp:1664:0
#19 0x000055bbb1095adf llvm::legacy::PassManagerImpl::run(llvm::Module&)
/usr/local/lib/llvm7.0/lib/IR/LegacyPassManager.cpp:1768:0
#20 0x000055bbb1095cd7 llvm::legacy::PassManager::run(llvm::Module&)
/usr/local/lib/llvm7.0/lib/IR/LegacyPassManager.cpp:1800:0
#21 0x000055bbb1bc5e96 (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
/usr/local/lib/llvm7.0/tools/clang/lib/CodeGen/BackendUtil.cpp:841:0
#22 0x000055bbb1bc903e clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
/usr/local/lib/llvm7.0/tools/clang/lib/CodeGen/BackendUtil.cpp:1265:0
#23 0x000055bbb28539f3
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
/usr/local/lib/llvm7.0/tools/clang/lib/CodeGen/CodeGenAction.cpp:292:0
#24 0x000055bbb3c71739 clang::ParseAST(clang::Sema&, bool, bool)
/usr/local/lib/llvm7.0/tools/clang/lib/Parse/ParseAST.cpp:177:0
#25 0x000055bbb2327c85 clang::ASTFrontendAction::ExecuteAction()
/usr/local/lib/llvm7.0/tools/clang/lib/Frontend/FrontendAction.cpp:1011:0
#26 0x000055bbb28518c8 clang::CodeGenAction::ExecuteAction()
/usr/local/lib/llvm7.0/tools/clang/lib/CodeGen/CodeGenAction.cpp:1044:0
#27 0x000055bbb2327698 clang::FrontendAction::Execute()
/usr/local/lib/llvm7.0/tools/clang/lib/Frontend/FrontendAction.cpp:914:0
#28 0x000055bbb22b5716
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/usr/local/lib/llvm7.0/tools/clang/lib/Frontend/CompilerInstance.cpp:962:0
#29 0x000055bbb248a674
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/usr/local/lib/llvm7.0/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:257:0
#30 0x000055bbaf3f231a cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) /usr/local/lib/llvm7.0/tools/clang/tools/driver/cc1_main.cpp:216:0
#31 0x000055bbaf3e7b00 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef)
/usr/local/lib/llvm7.0/tools/clang/tools/driver/driver.cpp:310:0
#32 0x000055bbaf3e87d5 main
/usr/local/lib/llvm7.0/tools/clang/tools/driver/driver.cpp:382:0
#33 0x00007f16afc32b97 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21b97)
#34 0x000055bbaf3e513a _start (/usr/local/bin/clang-7+0x1e9513a)
clang-7: error: unable to execute command: Aborted (core dumped)
clang-7: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 7.0.0 (trunk 337118)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-7: note: diagnostic msg: 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.
clang-7: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-7: note: diagnostic msg: /tmp/code0-d7eaf7.c
clang-7: note: diagnostic msg: /tmp/code0-d7eaf7.sh
clang-7: note: diagnostic msg:
********************</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>