<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 - Infinite recursion in GlobalStatus called from -globalopt due to weird code in dead basic block"
href="https://bugs.llvm.org/show_bug.cgi?id=33686">33686</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Infinite recursion in GlobalStatus called from -globalopt due to weird code in dead basic block
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>mikael.holmen@ericsson.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=18748" name="attach_18748" title="reproducer">attachment 18748</a> <a href="attachment.cgi?id=18748&action=edit" title="reproducer">[details]</a></span>
reproducer
opt -globalopt -S -o - reduced.ll
causes
#0 0x0000000001f13e94 PrintStackTraceSignalHandler(void*)
(build-all-builtins/bin/opt+0x1f13e94)
#1 0x0000000001f14606 SignalHandler(int) (build-all-builtins/bin/opt+0x1f14606)
#2 0x00007faeb9926330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#3 0x0000000001f639ff analyzeGlobalAux(llvm::Value const*, llvm::GlobalStatus&,
llvm::SmallPtrSetImpl<llvm::PHINode const*>&)
(build-all-builtins/bin/opt+0x1f639ff)
#4 0x0000000001f63c9e analyzeGlobalAux(llvm::Value const*, llvm::GlobalStatus&,
llvm::SmallPtrSetImpl<llvm::PHINode const*>&)
(build-all-builtins/bin/opt+0x1f63c9e)
#5 0x0000000001f63c9e analyzeGlobalAux(llvm::Value const*, llvm::GlobalStatus&,
llvm::SmallPtrSetImpl<llvm::PHINode const*>&)
(build-all-builtins/bin/opt+0x1f63c9e)
#6 0x0000000001f63c9e analyzeGlobalAux(llvm::Value const*, llvm::GlobalStatus&,
llvm::SmallPtrSetImpl<llvm::PHINode const*>&)
(build-all-builtins/bin/opt+0x1f63c9e)
#7 0x0000000001f63c9e analyzeGlobalAux(llvm::Value const*, llvm::GlobalStatus&,
llvm::SmallPtrSetImpl<llvm::PHINode const*>&)
(build-all-builtins/bin/opt+0x1f63c9e)
#8 0x0000000001f63c9e analyzeGlobalAux(llvm::Value const*, llvm::GlobalStatus&,
llvm::SmallPtrSetImpl<llvm::PHINode const*>&)
(build-all-builtins/bin/opt+0x1f63c9
[...]
Input program:
@g_127 = external global i16, align 1
define void @fn1() {
for.end5:
ret void
for.cond1: ; preds = %for.cond1
%g_127.l_213.1 = select i1 undef, i16* @g_127, i16* %g_127.l_213.1
br label %for.cond1
}
So for.cond1 isn't reachable from the and it contains a self-referencing
instruction that GlobalStatus::analyzeGlobal/analyzeGlobalAux recurses forever
on.
Should GlobalStatus handle this? Or should GlobalOpt remove dead basic blocks
before doing its stuff?</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>