[llvm-bugs] [Bug 26155] New: assertion "piece covers entire variable" when optimizing code wit debug information

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jan 15 01:36:50 PST 2016


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

            Bug ID: 26155
           Summary: assertion "piece covers entire variable" when
                    optimizing code wit debug information
           Product: new-bugs
           Version: 3.8
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: r.sagitario at gmx.de
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

>From a larger IR generated by the D compiler, bugpoint reduced it to:

; ModuleID = 'bugpoint-reduced-simplified.bc'
target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
target triple = "i386-pc-windows-msvc"

; Function Attrs: nounwind readnone
declare void @llvm.dbg.declare(metadata, metadata, metadata) #0

define x86_stdcallcc void
@"\01__D3std9exception27__T7enforceHTC9ExceptionTbZ7enforceFNaNfbLAxaAyakZb"(i1
%value_arg) {
  %value = alloca i8, align 1
  %1 = zext i1 %value_arg to i8, !dbg !1
  store i8 %1, i8* %value, !dbg !1
  call void @llvm.dbg.declare(metadata i8* %value, metadata !7, metadata !23),
!dbg !1
  br i1 undef, label %if, label %endif

if:                                               ; preds = %0
  br label %endif

endif:                                            ; preds = %if, %0
  ret void
}

attributes #0 = { nounwind readnone }

!llvm.module.flags = !{!0}
!llvm.dbg.cu = !{}
!llvm.ldc.classinfo._D7imports10test11931b10GUIElement7__ClassZ = !{}

!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !DILocation(line: 348, column: 3, scope: !2)
!2 = distinct !DISubprogram(name: "std.exception.enforce!(Exception,
bool).enforce", linkageName:
"_D3std9exception27__T7enforceHTC9ExceptionTbZ7enforceFNaNfbLAxaAyakZb", scope:
null, file: !3, line: 348, type: !4, isLocal: false, isDefinition: true,
scopeLine: 348, flags: DIFlagPrototyped, isOptimized: false, variables: !6)
!3 = !DIFile(filename: "exception.d", directory:
"C:/s/d/ldc/ldc/runtime/phobos\5Cstd")
!4 = !DISubroutineType(types: !5)
!5 = !{}
!6 = !{!7, !9, !13, !22}
!7 = !DILocalVariable(name: "value", arg: 1, scope: !2, file: !3, line: 348,
type: !8)
!8 = !DIBasicType(name: "bool", size: 1, align: 8, encoding: DW_ATE_boolean)
!9 = !DILocalVariable(name: "msg", arg: 2, scope: !2, file: !3, line: 348,
type: !10)
!10 = !DISubroutineType(types: !11)
!11 = !{!12}
!12 = !DIBasicType(tag: DW_TAG_unspecified_type, name: "const(char)[]
delegate()")
!13 = !DILocalVariable(name: "file", arg: 3, scope: !2, file: !3, line: 348,
type: !14)
!14 = !DICompositeType(tag: DW_TAG_structure_type, file: !15, size: 64, align:
32, elements: !16)
!15 = !DIFile(filename: "test11931b.d", directory:
"c:\5Cs\5Cd\5Cldc\5Cldc\5Ctests\5Cd2\5Cdmd-testsuite\5Crunnable\5Cimports")
!16 = !{!17, !19}
!17 = !DIDerivedType(tag: DW_TAG_member, name: "length", file: !15, baseType:
!18, size: 32, align: 32, flags: DIFlagPublic)
!18 = !DIBasicType(name: "uint", size: 32, align: 32, encoding:
DW_ATE_unsigned)
!19 = !DIDerivedType(tag: DW_TAG_member, name: "ptr", file: !15, baseType: !20,
size: 32, align: 32, offset: 32, flags: DIFlagPublic)
!20 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "immutable(char)*",
baseType: !21, size: 32, align: 32)
!21 = !DIBasicType(name: "immutable(char)", size: 8, align: 8, encoding:
DW_ATE_unsigned_char)
!22 = !DILocalVariable(name: "line", arg: 4, scope: !2, file: !3, line: 348,
type: !18)
!23 = !DIExpression() 

-----------------------------
run "opt -sroa" on it to get

piece covers entire variable
  call void @llvm.dbg.value(metadata i1 %value_arg, i64 0, metadata !7,
metadata !23), !dbg !1
!7 = !DILocalVariable(name: "value", arg: 1, scope: !2, file: !3, line: 348,
type: !8)
!23 = !DIExpression(DW_OP_bit_piece, 0, 1)
LLVM ERROR: Broken module found, compilation aborted!

The same test case used to work until a few days ago.

-- 
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/20160115/3365f963/attachment.html>


More information about the llvm-bugs mailing list