https://bugs.llvm.org/show_bug.cgi?id=38608
Bug ID: 38608
Summary: Fragment variable size verification fails during LTO
in presence of ODR violations
Product: libraries
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: DebugInfo
Assignee: unassignedb...@nondot.org
Reporter: r...@google.com
CC: bjorn.a.petters...@ericsson.com,
llvm-bugs@lists.llvm.org, l...@inglorion.net,
pe...@pcc.me.uk
Our Chromium ThinLTO bot has been red longer than we have history for it, and I
think it was caused by r334830 from June.
During LTO, our bot is now producing this error:
fragment is larger than or outside of variable
call void @llvm.dbg.value(metadata i8 %9, metadata !2265359, metadata
!DIExpression(DW_OP_LLVM_fragment, 96, 8)), !dbg !2265363
!2265359 = !DILocalVariable(name: "p", scope: !2265356, f
Here is a reduction of the problem:
// a.cpp
struct ViolateODR {
int x;
};
int use_small_struct(ViolateODR o) {
return o.x;
}
int do_sroa(int x, int y);
int main() {
ViolateODR o = {0};
return use_small_struct(o) + do_sroa(1, 2);
}
// b.cpp
struct ViolateODR {
int x;
};
int use_small_struct(ViolateODR o) {
return o.x;
}
int do_sroa(int x, int y);
int main() {
ViolateODR o = {0};
return use_small_struct(o) + do_sroa(1, 2);
}
// script
$ clang-cl -Z7 -flto=thin -c a.cpp b.cpp -O2 && lld-link a.obj b.obj -out:t.exe
fragment covers entire variable
call void @llvm.dbg.value(metadata i32 %3, metadata !17, metadata
!DIExpression(DW_OP_LLVM_fragment, 0, 32)), !dbg !24
!17 = !DILocalVariable(name: "o", scope: !10, file: !1, line: 6, type: !18)
OK, so maybe I got a.cpp and b.cpp swapped, but you see the point. I don't
think verifier errors during LTO are a reasonable failure mode for ODR
violations.
I would prefer it if instead dbg.value problems could be reported as warnings
and we could locally discard the problematic dbg.value instructions.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs