Victor Leschuk via llvm-dev
2018-Aug-27 09:43 UTC
[llvm-dev] [llvm-bugs] [Bug 38714] [DebugInfo] [DWARF] [AArch64] .debug_loc entry missing in optimized build on aarch64
Including Paul and llvm-dev. On 8/27/18 12:31 PM, Victor Leschuk wrote:> > David, Adrian, could you please advise on this one? > > On 8/27/18 12:24 PM, via llvm-bugs wrote: >> Bug ID 38714 <https://bugs.llvm.org/show_bug.cgi?id=38714> >> Summary [DebugInfo] [DWARF] [AArch64] .debug_loc entry missing in >> optimized build on aarch64 >> Product new-bugs >> Version trunk >> Hardware PC >> OS Linux >> Status NEW >> Severity normal >> Priority P >> Component new bugs >> Assignee unassignedbugs at nondot.org >> Reporter vleschuk at accesssoftek.com >> CC llvm-bugs at lists.llvm.org >> >> Createdattachment 20771 <attachment.cgi?id=20771> [details] >> <attachment.cgi?id=20771&action=edit> >> Source, object file and generated assembly. >> >> When compiling the following sample with optimizations enabled (-O1 and higher) >> it looks like a .debug_loc entry is missing for argc: >> >> #include <stdio.h> >> >> int main( int argc, char **argv ) >> { >> for(int i = 1; i < argc; ++i) { >> printf("Argument %d: %s\n", i, argv[i]); >> } >> return 0; >> } >> >> $ clang -target aarch64-unknown-linux -c -g -O1 -o test.o test.c >> >> There are the following entries: >> >> 0x00000043: DW_TAG_formal_parameter [3] >> DW_AT_location [DW_FORM_sec_offset] (0x00000000 >> [0x0000000000000000, 0x0000000000000034): DW_OP_reg0 W0) >> DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000d5] >> "argc") >> >> 0x00000052: DW_TAG_formal_parameter [3] >> DW_AT_location [DW_FORM_sec_offset] (0x00000023 >> [0x0000000000000000, 0x0000000000000020): DW_OP_reg1 W1 >> [0x0000000000000020, 0x0000000000000048): DW_OP_reg19 >> W19) >> DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000da] >> "argv") >> >> >> The assembly for the code is the following: >> >> //DEBUG_VALUE: main:argc <- $w0 >> //DEBUG_VALUE: main:argv <- $x1 >> .Ltmp0: >> //DEBUG_VALUE: i <- 1 >> .loc 1 5 3 prologue_end // test.c:5:3 >> cmp w0, #2 // =2 >> b.lt .LBB0_3 >> .Ltmp1: >> // %bb.1: // %for.body.preheader >> //DEBUG_VALUE: main:argv <- $x1 >> //DEBUG_VALUE: main:argc <- $w0 >> .loc 1 0 3 is_stmt 0 // test.c:0:3 >> adrp x21, .L.str >> mov x19, x1 >> .Ltmp2: >> //DEBUG_VALUE: main:argv <- $x19 >> mov w22, w0 >> >> It looks like there should be two DW_OP_reg* records for w0 and for w22 for >> argc. >> >> Correct me if I am wrong. >> >> PS x86 doesn't seem to have this problem. >> ------------------------------------------------------------------------ >> You are receiving this mail because: >> >> * You are on the CC list for the bug. >> >> >> _______________________________________________ >> llvm-bugs mailing list >> llvm-bugs at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs > -- > Best Regards, > > Victor Leschuk | Software Engineer | Access Softek-- Best Regards, Victor Leschuk | Software Engineer | Access Softek -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180827/da753c9d/attachment.html>
via llvm-dev
2018-Aug-27 12:12 UTC
[llvm-dev] [llvm-bugs] [Bug 38714] [DebugInfo] [DWARF] [AArch64] .debug_loc entry missing in optimized build on aarch64
Either the register copy was introduced with no debug info, or the debug info got lost along the way. My first thought would be to use –print-after-all (or however that's spelled) and look for the pass where the problem first appears. You could start with opt, to eliminate the IR passes, then use llc. --paulr From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Victor Leschuk via llvm-dev Sent: Monday, August 27, 2018 5:44 AM To: Robinson, Paul Cc: LLVM Dev Subject: Re: [llvm-dev] [llvm-bugs] [Bug 38714] [DebugInfo] [DWARF] [AArch64] .debug_loc entry missing in optimized build on aarch64 Including Paul and llvm-dev. On 8/27/18 12:31 PM, Victor Leschuk wrote: David, Adrian, could you please advise on this one? On 8/27/18 12:24 PM, via llvm-bugs wrote: Bug ID 38714<https://bugs.llvm.org/show_bug.cgi?id=38714> Summary [DebugInfo] [DWARF] [AArch64] .debug_loc entry missing in optimized build on aarch64 Product new-bugs Version trunk Hardware PC OS Linux Status NEW Severity normal Priority P Component new bugs Assignee unassignedbugs at nondot.org<mailto:unassignedbugs at nondot.org> Reporter vleschuk at accesssoftek.com<mailto:vleschuk at accesssoftek.com> CC llvm-bugs at lists.llvm.org<mailto:llvm-bugs at lists.llvm.org> Created attachment 20771<attachment.cgi?id=20771> [details]<attachment.cgi?id=20771&action=edit> Source, object file and generated assembly. When compiling the following sample with optimizations enabled (-O1 and higher) it looks like a .debug_loc entry is missing for argc: #include <stdio.h> int main( int argc, char **argv ) { for(int i = 1; i < argc; ++i) { printf("Argument %d: %s\n", i, argv[i]); } return 0; } $ clang -target aarch64-unknown-linux -c -g -O1 -o test.o test.c There are the following entries: 0x00000043: DW_TAG_formal_parameter [3] DW_AT_location [DW_FORM_sec_offset] (0x00000000 [0x0000000000000000, 0x0000000000000034): DW_OP_reg0 W0) DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000d5] "argc") 0x00000052: DW_TAG_formal_parameter [3] DW_AT_location [DW_FORM_sec_offset] (0x00000023 [0x0000000000000000, 0x0000000000000020): DW_OP_reg1 W1 [0x0000000000000020, 0x0000000000000048): DW_OP_reg19 W19) DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000da] "argv") The assembly for the code is the following: //DEBUG_VALUE: main:argc <- $w0 //DEBUG_VALUE: main:argv <- $x1 .Ltmp0: //DEBUG_VALUE: i <- 1 .loc 1 5 3 prologue_end // test.c:5:3 cmp w0, #2 // =2 b.lt .LBB0_3 .Ltmp1: // %bb.1: // %for.body.preheader //DEBUG_VALUE: main:argv <- $x1 //DEBUG_VALUE: main:argc <- $w0 .loc 1 0 3 is_stmt 0 // test.c:0:3 adrp x21, .L.str mov x19, x1 .Ltmp2: //DEBUG_VALUE: main:argv <- $x19 mov w22, w0 It looks like there should be two DW_OP_reg* records for w0 and for w22 for argc. Correct me if I am wrong. PS x86 doesn't seem to have this problem. ________________________________ You are receiving this mail because: * You are on the CC list for the bug. _______________________________________________ llvm-bugs mailing list llvm-bugs at lists.llvm.org<mailto:llvm-bugs at lists.llvm.org> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs -- Best Regards, Victor Leschuk | Software Engineer | Access Softek -- Best Regards, Victor Leschuk | Software Engineer | Access Softek -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180827/86ed88d6/attachment.html>