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

            Bug ID: 49545
           Summary: opt crashes with "opt -O2 -attributor-enable=cgscc ":
                    Assertion `isa<X>(Val) && "cast<Ty>() argument of
                    incompatible type!"' 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 reduced.ll
target datalayout =
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

define hidden void @f1() align 2 {
entry:
  call void @f2()
  ret void
}

define linkonce_odr hidden void @f2() unnamed_addr align 2 {
entry:
  call void @f3()
  ret void
}

define linkonce_odr hidden void @f3() unnamed_addr align 2 {
entry:
  call void @f4()
  ret void
}

define available_externally void @f4() align 2   {
entry:
  br label %if.end

if.end:                                           ; preds = %entry
  br label %if.else

if.else:                                          ; preds = %if.end
  %call7 = call i8* @f5()
  ret void
}

define linkonce_odr hidden i8* @f5() align 2     {
entry:
  %call = call i8* @f6()
  ret i8* %call
}


define linkonce_odr hidden i8* @f6() align 2   {
if.end:
  %call2 = call i8* @f7()
  ret i8* %call2
}

define linkonce_odr hidden i8* @f7()     {
entry:
  br label %if.then

if.then:                                          ; preds = %entry
  call void @llvm.assume(i1 true) [ "align"(i8* undef, i64 undef) ]
  br label %return

return:                                           ; preds = %if.then
  ret i8* undef
}

; Function Attrs: nofree nosync nounwind willreturn
declare void @llvm.assume(i1 noundef) #2

attributes #0 = { argmemonly nofree nosync nounwind willreturn }
attributes #1 = { argmemonly nofree nosync nounwind willreturn writeonly }
attributes #2 = { nofree nosync nounwind willreturn }

-- 
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