You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[MergeFuncs] Don't introduce calls to weak_odr functions.
Avoid creating new calls to weak_odr functions when merging 2 functions.
Consider 2 functions below, both present in 2 modules. Without this
patch, MergeFuncs in the first module may optimize A to call B and in
the second module B to call A.
Note that the 2 optimizations are vaild in isolation, but the linker then
could pick A from module 1 (which calls B) and B from module 2 which
calls A, introducing an infinte call cycle.
There may be other linkage types we need to be more careful about as
well.
define weak_odr hidden void @"A"(ptr %p) {
entry:
tail call void @"foo"(ptr %p)
ret void
}
define weak_odr hidden void @"B"(ptr %p) {
entry:
tail call void @"foo"(ptr %p)
ret void
}
0 commit comments