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

            Bug ID: 50683
           Summary: [Attributor] opt crashes with "opt -O1
                    -attributor-enable=all": Assertion Assertion `Fn &&
                    "Expected callee when call argument is replaced!"'
                    failed
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Interprocedural Optimizations
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

$ cat crash.ll
source_filename = "crash.ll"
target datalayout =
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@g = internal constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (void (i8***)*
@f1 to i8*), i8* bitcast (void (i1 (i8*)*)* @f2 to i8*)] }

define internal void @f1(i8*** %a) {
entry:
  %x = getelementptr { [2 x i8*] }, { [2 x i8*] }* @g, i32 0, i32 0, i32 0
  store i8** %x , i8*** %a, align 8
  ret void
}

define internal void @f2(i1 (i8*)* %a) {
cont461:
  %c1 = bitcast i1 (i8*)* %a to i8*
  call void @f3(i8* %c1, i1 (i8*)* %a)
  ret void
}

define internal void @f3(i8* %a1, i1 (i8*)* %a) {
entry:
  %call20 = call i1 @f9()
  br i1 %call20, label %land.lhs.true, label %if.end40

land.lhs.true:
  call i1 %a(i8* %a1)
  br label %if.end40

if.end40:
  ret void
}

define linkonce_odr i1 @f9() {
entry:
  ret i1 false
}

Needs to enable new pm (-enable-new-pm=1) if not enabled by default.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to