[llvm-bugs] [Bug 35071] New: Assertion: (I != Successors.end() && "Not a current successor!") in MipsLongBranch.cpp

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Oct 25 03:36:11 PDT 2017


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

            Bug ID: 35071
           Summary: Assertion: (I != Successors.end() && "Not a current
                    successor!") in MipsLongBranch.cpp
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: MIPS
          Assignee: unassignedbugs at nondot.org
          Reporter: arichardson.kde at gmail.com
                CC: llvm-bugs at lists.llvm.org

When compile SVN for MIPS I got the (I != Successors.end() && "Not a current
successor!") assertion.

Creduce reduced it to 
```
// RUN: %clang_cc1 -triple mips64-unknown-freebsd12.0 -emit-obj
-mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim
-target-cpu mips4 -target-feature -noabicalls -target-feature +soft-float
-target-abi n64 -msoft-float -mfloat-abi soft -mllvm -mips-ssection-threshold=0
-dwarf-column-info -debug-info-kind=standalone -dwarf-version=2
-debugger-tuning=gdb -coverage-notes-file
/usr/local/jenkins/workspace/CHERIBSD-WORLD/ALLOC/jemalloc/CPU/cheri256/ISA/vanilla/makeobjdir/mips.mips64/usr/local/jenkins/workspace/CHERIBSD-WORLD/ALLOC/jemalloc/CPU/cheri256/ISA/vanilla/cheribsd/usr.bin/svn/lib/libsvn_wc/update_editor.gcno
-sys-header-deps -O2 -std=gnu99 -ftls-model=initial-exec -mstack-alignment=32
-vectorize-loops -vectorize-slp -cheri-linker -x c -o - %s | FileCheck %s
typedef a
#define b(c)                                                                  
\
  a d = c;                                                                    
\
  if (d)                                                                      
\
  return 0
    ;
f() {
  int e = i() == 0;
  {
    int g;
    b(h(&g));
    if (g)
      return 0;
  }
  j(e);
}
```

I then managed to create an IR testcase:
```
; RUN: llc -mtriple mips64-unknown-freebsd12.0 -relocation-model pic
-thread-model posix -mcpu=mips4 -target-abi n64 -O2 -o - %s

; ModuleID =
'/Users/alex/cheri/llvm/cmake-build-debug/long-branch-reduce.ll-reduced-simplified.bc'
source_filename = "long-branch-reduce.ll-output-bc3958f.bc"
target datalayout = "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128"
target triple = "mips64-unknown-freebsd12.0"

; Function Attrs: nounwind
define void @f() local_unnamed_addr #0 !dbg !5 {
entry:
  %cmp = icmp eq i32 undef, 0, !dbg !16
  %conv = zext i1 %cmp to i32, !dbg !16
  tail call void @llvm.dbg.value(metadata i32 %conv, metadata !11, metadata
!DIExpression()), !dbg !17
  %tobool = icmp eq i32 undef, 0, !dbg !18
  br i1 %tobool, label %if.end, label %cleanup7.critedge, !dbg !21

if.end:                                           ; preds = %entry
  %call6 = call i32 bitcast (i32 (...)* @j to i32 (i32)*)(i32 signext %conv)
#4, !dbg !22
  br label %cleanup7, !dbg !23

cleanup7.critedge:                                ; preds = %entry
  call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull undef) #4, !dbg !24
  br label %cleanup7

cleanup7:                                         ; preds = %cleanup7.critedge,
%if.end
  ret void
}

; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1

declare i32 @j(...) local_unnamed_addr #2

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

attributes #0 = { nounwind "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"="mips4"
"target-features"="+mips4,+soft-float,-noabicalls" "unsafe-fp-math"="false"
"use-soft-float"="true" }
attributes #1 = { argmemonly nounwind }
attributes #2 = { "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-nans-fp-math"="false"
"no-signed-zeros-fp-math"="false" "no-trapping-math"="false"
"stack-protector-buffer-size"="8" "target-cpu"="mips4"
"target-features"="+mips4,+soft-float,-noabicalls" "unsafe-fp-math"="false"
"use-soft-float"="true" }
attributes #3 = { nounwind readnone speculatable }
attributes #4 = { nounwind }

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

!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang
version 6.0.0 (https://github.com/llvm-mirror/clang.git
305865255b11af3a8dafef4aa679ea92a6370e93)
(https://github.com/llvm-mirror/llvm.git
620602b1bc4cd0c8c92b60a32831f63cfbee6cdf)", isOptimized: true, runtimeVersion:
0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename:
"/Users/alex/cheri/llvm/tools/clang/test/CodeGen/CHERI/<stdin>", directory:
"/Users/alex/cheri/llvm/tools/clang/test/CodeGen/CHERI")
!2 = !{}
!3 = !{i32 2, !"Debug Info Version", i32 3}
!4 = !{i32 7, !"PIC Level", i32 2}
!5 = distinct !DISubprogram(name: "f", scope: !6, file: !6, line: 8, type: !7,
isLocal: false, isDefinition: true, scopeLine: 8, isOptimized: true, unit: !0,
variables: !10)
!6 = !DIFile(filename:
"/Users/alex/cheri/llvm/tools/clang/test/CodeGen/CHERI/update_editor-790bb6-reduce.test.c",
directory: "/Users/alex/cheri/llvm/tools/clang/test/CodeGen/CHERI")
!7 = !DISubroutineType(types: !8)
!8 = !{!9}
!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!10 = !{!11, !12, !14}
!11 = !DILocalVariable(name: "e", scope: !5, file: !6, line: 9, type: !9)
!12 = !DILocalVariable(name: "g", scope: !13, file: !6, line: 11, type: !9)
!13 = distinct !DILexicalBlock(scope: !5, file: !6, line: 10, column: 3)
!14 = !DILocalVariable(name: "d", scope: !13, file: !6, line: 12, type: !15)
!15 = !DIDerivedType(tag: DW_TAG_typedef, name: "a", file: !6, line: 2,
baseType: !9)
!16 = !DILocation(line: 9, column: 15, scope: !5)
!17 = !DILocation(line: 9, column: 7, scope: !5)
!18 = !DILocation(line: 12, column: 5, scope: !19)
!19 = distinct !DILexicalBlock(scope: !20, file: !6, line: 12, column: 5)
!20 = distinct !DILexicalBlock(scope: !5, file: !6, line: 10, column: 3)
!21 = !DILocation(line: 12, column: 5, scope: !20)
!22 = !DILocation(line: 16, column: 3, scope: !5)
!23 = !DILocation(line: 17, column: 1, scope: !5)
!24 = !DILocation(line: 15, column: 3, scope: !5)
```

-- 
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/20171025/57c2f648/attachment.html>


More information about the llvm-bugs mailing list