[cfe-dev] Assertion failure with __builtin_isless

Chris Lattner clattner at apple.com
Fri Jun 27 15:49:43 PDT 2008


On Jun 24, 2008, at 3:07 PM, Dan Nelson wrote:
>
> The following program fragment gets me an assertion error:

Fixed,
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080623/006278.html

-Chris

>
>
> union anything
> {
>        long integer;
>        float float_number;
> };
>
> int is_lt(const union anything *a, const union anything *b)
> {
>        return __builtin_isless(((float)a->integer), (b- 
> >float_number));
> }
>
> $ clang -emit-llvm-bc test.c
> Assertion failed: (getOperand(0)->getType() == getOperand(1)- 
> >getType() && "Both operands to FCmp instruction are not of the same  
> type!"), function FCmpInst, file /usr/tmp/cvs/llvm/include/llvm/ 
> Instructions.h, line 776.
> [1]    67289 abort (core dumped)  clang -emit-llvm-bc test.c
> $
>
> But both arguments to __builtin_isless are floats, right?
>
> Currently running llvm tree rev 52681.
>
> -- 
> 	Dan Nelson
> 	dnelson at allantgroup.com
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list