[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


http://llvm.org/bugs/show_bug.cgi?id=5569

           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 =
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
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 {
entry:
  %b = alloca i32, align 4                        ; <i32*> [#uses=1]
  volatile store i32 -1, i32* %b
  ret void
}

define void @bar(i32* nocapture %pc) nounwind readonly {
entry:
  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 {
entry:
  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