https://llvm.org/bugs/show_bug.cgi?id=31555
Bug ID: 31555
Summary: IFunc interaction with comdat is broken
Product: new-bugs
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: new bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected]
Classification: Unclassified
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
https://github.com/llvm-project/llvm-project/blob/master/llvm/lib/IR/Globals.cpp#L157-L159
has to be changed to handle ifunc in the same way as aliases.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs