[LLVMbugs] [Bug 4338] New: Assertion failed: (!N1.getValueType().isInteger() && " Illegal setcc for integer!")

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat Jun 6 07:02:08 PDT 2009


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

           Summary: Assertion failed: (!N1.getValueType().isInteger() &&
                    "Illegal setcc for integer!")
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: ed at 80386.nl
                CC: llvmbugs at cs.uiuc.edu
            Blocks: 3696


I'm seeing the following crash when compiling the following code and enabling
-O1 or higher. This is LLVM+Clang r72995:

static const char p[1] = { 1 };

int
crash(const unsigned char *source)
{

        return (p[*source] == 4 && (*source < 0x80 || *source > 0xBF));
}

; ModuleID = 'llvm-crash.c'
target datalayout =
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "x86_64-undermydesk-freebsd8.0"
@p = internal constant [1 x i8] c"\01", align 1         ; <[1 x i8]*> [#uses=1]

define i32 @crash(i8* nocapture %source) nounwind readonly {
entry:
        %tmp1 = load i8* %source                ; <i8> [#uses=3]
        %idxprom = zext i8 %tmp1 to i64         ; <i64> [#uses=1]
        %arrayidx = getelementptr [1 x i8]* @p, i64 0, i64 %idxprom            
; <i8*> [#uses=1]
        %tmp2 = load i8* %arrayidx              ; <i8> [#uses=1]
        %cmp = icmp eq i8 %tmp2, 4              ; <i1> [#uses=1]
        br i1 %cmp, label %land.rhs, label %land.end

land.rhs:               ; preds = %entry
        %cmp7 = icmp sgt i8 %tmp1, -1           ; <i1> [#uses=1]
        br i1 %cmp7, label %land.end, label %lor.rhs

lor.rhs:                ; preds = %land.rhs
        %cmp12 = icmp ugt i8 %tmp1, -65         ; <i1> [#uses=1]
        %phitmp = zext i1 %cmp12 to i32         ; <i32> [#uses=1]
        ret i32 %phitmp

land.end:               ; preds = %land.rhs, %entry
        %0 = phi i32 [ 0, %entry ], [ 1, %land.rhs ]            ; <i32>
[#uses=1]
        ret i32 %0
}

Assertion failed: (!N1.getValueType().isInteger() && "Illegal setcc for
integer!"), function FoldSetCC, file
.../llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp, line 1404.
Stack dump:
0.      Program arguments: /usr/bin/../libexec/clang-cc -triple
x86_64-undermydesk-freebsd8.0 -S -disable-free -main-file-name llvm-crash.c
--relocation-model static --disable-fp-elim --unwind-tables=1 --mcpu=x86-64
--fmath-errno=1 -O1 -fdiagnostics-show-option -o /tmp/cc-5rm5vI.s -x c
llvm-crash.c 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@crash'


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