[LLVMbugs] [Bug 9994] assertion "isa<X>(Val) && "cast<Ty>() argument of incompatible type!"" failed

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon May 23 15:35:09 PDT 2011


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

David Chisnall <csdavec at swan.ac.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #8 from David Chisnall <csdavec at swan.ac.uk> 2011-05-23 17:35:08 CDT ---
(In reply to comment #7)
> David: is the GNU runtime still your domain?

Yup.  The problem seems to be that this module declares the property get
function as having a BOOL as the final argument.  BOOL is a typedef for
unsigned char, which becomes i8 in LLVM.  CGObjCGNU tries to construct the
function as having BoolTy (from) ASTContext as the final argument.  This is i1,
so it gets a bitcast, and then fails when trying to cast the constant bitcast
to a Function.

I've 'fixed' this (r131930) by turning a load of Functions into Constants, but
this is hiding the real problem: that we are using BoolTy (i1) in a lot of
places to represent BOOL, and hoping that something lower down will fix it. 
This may well break on some platforms, depending on what LLVM does.

We should probably just use unsigned char / i8 instead of BoolTy for ObjC
BOOLs.  This will break VxWorks with the GCC runtime, but I don't think anyone
cares.

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