[llvm-bugs] [Bug 35526] New: TAG_label not created for labels

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Dec 5 02:56:10 PST 2017


https://bugs.llvm.org/show_bug.cgi?id=35526

            Bug ID: 35526
           Summary: TAG_label not created for labels
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: DebugInfo
          Assignee: unassignedbugs at nondot.org
          Reporter: pmatos at linki.tools
                CC: llvm-bugs at lists.llvm.org

With a simple program like:

int main(void) {
top:
    return 0;
}

which generates IR:
; ModuleID = 'test.c'
source_filename = "test.c"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: noinline nounwind uwtable
define i32 @main() #0 !dbg !6 {
entry:
  %retval = alloca i32, align 4
  store i32 0, i32* %retval, align 4
  br label %top, !dbg !10

top:                                              ; preds = %entry
  ret i32 0, !dbg !11
}

attributes #0 = { noinline nounwind uwtable
"correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false"
"less-precise-fpmad"="false" "no-frame-pointer-elim"="true"
"no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false"
"no-jump-tables"="false" "no-nans-fp-math"="false"
"no-signed-zeros-fp-math"="false" "no-trapping-math"="false"
"stack-protector-buffer-size"="8" "target-cpu"="x86-64"
"target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false"
"use-soft-float"="false" }

!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4}
!llvm.ident = !{!5}

!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang
version 5.0.0 (trunk 297627)", isOptimized: false, runtimeVersion: 0,
emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "test.c", directory:
"/home/pmatos/Clients/embecosm/BUGS/b639")
!2 = !{}
!3 = !{i32 2, !"Dwarf Version", i32 4}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{!"clang version 5.0.0 (trunk 297627)"}
!6 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type:
!7, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped,
isOptimized: false, unit: !0, variables: !2)
!7 = !DISubroutineType(types: !8)
!8 = !{!9}
!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!10 = !DILocation(line: 1, column: 16, scope: !6)
!11 = !DILocation(line: 3, column: 3, scope: !6)


LLVM is not generating the respective DW_TAG_label. For example, gcc generates:
 <2><4a>: Abbrev Number: 3 (DW_TAG_label)
    <4b>   DW_AT_name        : top
    <4f>   DW_AT_decl_file   : 1
    <50>   DW_AT_decl_line   : 2
    <51>   DW_AT_low_pc      : 0x0

This is useful because it allows one to set a breakpoint through the label.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171205/3f6fe8ee/attachment-0001.html>


More information about the llvm-bugs mailing list