<html>
<head>
<base href="https://llvm.org/bugs/" />
</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 --- - IFunc interaction with comdat is broken"
href="https://llvm.org/bugs/show_bug.cgi?id=31555">31555</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>IFunc interaction with comdat is broken
</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>normal
</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>rafael.espindola@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>chandlerc@gmail.com, echristo@gmail.com, llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Given
$test5_c = comdat any
@test5_if = linkonce_odr ifunc void (), void ()* @test5_f
define linkonce_odr void @test5_f() comdat($test5_c) {
ret void
}
llc produces
.weak test5_if
.type test5_if,@function
.type test5_if,@gnu_indirect_function
test5_if = test5_f
which maps to
COMDAT group section [ 3] `.group' [test5_c] contains 1 sections:
[Index] Name
[ 4] .text.test5_f
Symbol table '.symtab' contains 6 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 FILE LOCAL DEFAULT ABS test.ll
2: 0000000000000000 0 NOTYPE LOCAL DEFAULT 3 test5_c
3: 0000000000000000 0 SECTION LOCAL DEFAULT 4
4: 0000000000000000 1 FUNC WEAK DEFAULT 4 test5_f
5: 0000000000000000 1 IFUNC WEAK DEFAULT 4 test5_if
If the linker drops this comdat both test5_f and test5_if will be treated as
undefined. This means that we cannot delete just one of them, but that is
exactly what globaldce does (see test/Transforms/GlobalDCE/comdats.ll).
It looks like
<a href="https://github.com/llvm-project/llvm-project/blob/master/llvm/lib/IR/Globals.cpp#L157-L159">https://github.com/llvm-project/llvm-project/blob/master/llvm/lib/IR/Globals.cpp#L157-L159</a>
has to be changed to handle ifunc in the same way as aliases.</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>