Re: sparse-llvm the LLVM IR for select instruction fails due to different types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 19 March 2017 at 00:21, Luc Van Oostenryck
<luc.vanoostenryck@xxxxxxxxx> wrote:
> On Tue, Mar 14, 2017 at 04:07:40PM +0000, Dibyendu Majumdar wrote:
>> LLVM complains when the operands of a select are not the same type. I
>> think it is okay to cast one of the operands to the type of the other
>> - on the basis that subsequent operations will cast things anyway.
>
> Submit a test case, please.
>

typedef union GCObject GCObject;
typedef union {
 GCObject *gc;
 void *p;
 int b;
} Value;
typedef struct lua_TValue {
 Value value;
 int tt;
} TValue;
typedef struct CClosure {
 GCObject *next;
 TValue upvalue[1];
} CClosure;
typedef struct LClosure {
 GCObject *next;
 GCObject *gclist;
} LClosure;
typedef union Closure {
 CClosure c;
 LClosure l;
} Closure;
static TValue luaO_nilobject_;
TValue *select(Closure *closure, int op)
{
 return op == 1 ? &closure->c.upvalue[0] : (TValue *) &luaO_nilobject_;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux