[LLVMbugs] [Bug 5569] New: Bug with IPSCCP and blockaddress (assertion)

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Nov 20 07:15:44 PST 2009


           Summary: Bug with IPSCCP and blockaddress (assertion)
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: compile-fail
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: quickslyver at free.fr
                CC: llvmbugs at cs.uiuc.edu

Created an attachment (id=3842)
 --> (http://llvm.org/bugs/attachment.cgi?id=3842)
testcase (llvm assembler)

The following command from a gcc torture testcase compiled with clang at -O3
crash during ipsccp after internalize:

$llvm-as test.ll -o - | opt -internalize -ipsccp -o - | llvm-dis -o -

opt: llvm/include/llvm/Support/Casting.h:199: typename llvm::cast_retty<To,
From>::ret_type llvm::cast(const Y&) [with X = llvm::Instruction, Y =
llvm::User*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible
type!"' failed.
Stack dump:
0.      Running pass 'Interprocedural Sparse Conditional Constant Propagation'
on module '<stdin>'.

****The testcase: (also in attachement)

; ModuleID = '<stdin>'
target datalayout =
target triple = "i386-pc-linux-gnu"

@code = global [5 x i32] [i32 0, i32 0, i32 0, i32 0, i32 1], align 4 ; <[5 x
i32]*> [#uses=0]
@bar.l = internal constant [2 x i8*] [i8* blockaddress(@bar, %lab0), i8*
blockaddress(@bar, %end)] ; <[2 x i8*]*> [#uses=1]

define void @foo(i32 %x) nounwind readnone {
  %b = alloca i32, align 4                        ; <i32*> [#uses=1]
  volatile store i32 -1, i32* %b
  ret void

define void @bar(i32* nocapture %pc) nounwind readonly {
  br label %indirectgoto

lab0:                                             ; preds = %indirectgoto
  %indvar.next = add i32 %indvar, 1               ; <i32> [#uses=1]
  br label %indirectgoto

end:                                              ; preds = %indirectgoto
  ret void

indirectgoto:                                     ; preds = %lab0, %entry
  %indvar = phi i32 [ %indvar.next, %lab0 ], [ 0, %entry ] ; <i32> [#uses=2]
  %pc.addr.0 = getelementptr i32* %pc, i32 %indvar ; <i32*> [#uses=1]
  %tmp1.pn = load i32* %pc.addr.0                 ; <i32> [#uses=1]
  %indirect.goto.dest.in = getelementptr inbounds [2 x i8*]* @bar.l, i32 0, i32
%tmp1.pn ; <i8**> [#uses=1]
  %indirect.goto.dest = load i8** %indirect.goto.dest.in ; <i8*> [#uses=1]
  indirectbr i8* %indirect.goto.dest, [label %lab0, label %end]

define i32 @main() nounwind readnone {
  ret i32 0

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list