<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - assertion "piece covers entire variable" when optimizing code wit debug information"
   href="https://llvm.org/bugs/show_bug.cgi?id=26155">26155</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>assertion "piece covers entire variable" when optimizing code wit debug information
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.8
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>r.sagitario@gmx.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>