[LLVMbugs] [Bug 2523] New: Asserts with releational operator applied to ext_vector_type(X) as argument

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Jul 7 07:11:39 PDT 2008


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

           Summary: Asserts with releational operator applied to
                    ext_vector_type(X) as argument
           Product: clang
           Version: unspecified
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: LLVM Codegen
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: benedict.gaster at amd.com
                CC: llvmbugs at cs.uiuc.edu


The code:

typedef __attribute__(( ext_vector_type(2) )) float float2;

float2 vec2, vec2_2;

void test2() 
{
  if (vec2 < vec2_2)
    ;
}

causes clang to fail with the following error (command line "clang
-emit-llvm"):

Assertion failed: ((getOperand(0)->getType()->isInteger() ||
isa<PointerType>(getOperand(0)->getType())) && "Invalid operand types for ICmp
instruction"), function ICmpInst, file
/Users/bgaster/llvm-latest/llvm/include/llvm/Instructions.h, line 629.
0   clang                               0x002e7bcc
_ZN4llvm3sys18RemoveFileOnSignalERKNS0_4PathEPSs + 844
1   libSystem.B.dylib                   0x9523309b _sigtramp + 43
2   ???                                 0xffffffff 0x0 + 4294967295
3   libSystem.B.dylib                   0x952abec2 raise + 26
4   libSystem.B.dylib                   0x952bb47f abort + 73
5   libSystem.B.dylib                   0x952ad063 __assert_rtn + 101
6   clang                               0x0006e37c
_ZN4llvm9IRBuilder10CreateICmpENS_7CmpInst9PredicateEPNS_5ValueES4_PKc + 300
7   clang                               0x0006bd54
_ZN5clang7CodeGen15CodeGenFunction14EmitScalarExprEPKNS_4ExprE + 7476
8   clang                               0x0006f7b1
_ZN5clang11StmtVisitorIN45_GLOBAL__N_CGExprScalar.cpp_00000000_1CBA9DDB17ScalarExprEmitterEPN4llvm5ValueEE5VisitEPNS_4StmtE
+ 1521
9   clang                               0x000707da
_ZN5clang11StmtVisitorIN45_GLOBAL__N_CGExprScalar.cpp_00000000_1CBA9DDB17ScalarExprEmitterEPN4llvm5ValueEE5VisitEPNS_4StmtE
+ 5658
10  clang                               0x0006a09b
_ZN5clang7CodeGen15CodeGenFunction14EmitScalarExprEPKNS_4ExprE + 123
11  clang                               0x0004d955
_ZN5clang7CodeGen15CodeGenFunction18EvaluateExprAsBoolEPKNS_4ExprE + 69
12  clang                               0x000807d7
_ZN5clang7CodeGen15CodeGenFunction10EmitIfStmtERKNS_6IfStmtE + 39
13  clang                               0x00080d24
_ZN5clang7CodeGen15CodeGenFunction16EmitCompoundStmtERKNS_12CompoundStmtEbPN4llvm5ValueEb
+ 180
14  clang                               0x0007ef71
_ZN5clang7CodeGen15CodeGenFunction8EmitStmtEPKNS_4StmtE + 465
15  clang                               0x00081991
_ZN5clang7CodeGen15CodeGenFunction16GenerateFunctionEPKNS_4StmtE + 33
16  clang                               0x00082061
_ZN5clang7CodeGen15CodeGenFunction12GenerateCodeEPKNS_12FunctionDeclE + 673
17  clang                               0x00087f69
_ZN5clang7CodeGen13CodeGenModule12EmitFunctionEPKNS_12FunctionDeclE + 73
18  clang                               0x00091fd2
_ZN46_GLOBAL__N_ModuleBuilder.cpp_00000000_146D646313CodeGenerator18HandleTopLevelDeclEPN5clang4DeclE
+ 898
19  clang                               0x0010aebe
_ZN5clang8ParseASTERNS_12PreprocessorEPNS_11ASTConsumerEb + 366
20  clang                               0x0002a21e
_Z16InitializeGCModeRN5clang11LangOptionsE + 4062
21  clang                               0x0002efcb main + 1803
22  clang                               0x000022f6 start + 54
Abort trap

Note I also tried the following code:

typedef __attribute__(( ext_vector_type(2) )) float float2;
typedef __attribute__(( ext_vector_type(2) )) int int2;

float2 vec2, vec2_2;

void test2() 
{
  int2 ivec = vec2 < vec_2;
}

and got the same error, which seems to imply that it is the application of the
relational operator that is causing the assertion. 

Looking at the error it seems that the problem is with the code generation
phase and so I've assigned it here but I do not have experience with the source
to sure on this point.


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