Re: sparse-llvm switch constants must all be same type as switch value

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

 



On Mon, Mar 13, 2017 at 09:24:47PM +0000, Dibyendu Majumdar wrote:
> Hi,
> 
> While investigating errors that occurred when compiling 'minilua' I
> found that the sparse-llvm output for switch statements is hard coded
> to generate int32 values even when the switch is on a different
> integer type. I believe following fix is needed in output_op_switch():
> 
>  FOR_EACH_PTR(insn->multijmp_list, jmp) {
>   if (jmp->begin == jmp->end) {  /* case N */
>    LLVMAddCase(target,
>     LLVMConstInt(LLVMTypeOf(sw_val), jmp->begin, 0),
>     jmp->target->priv);
>   } else if (jmp->begin < jmp->end) { /* case M..N */
>    assert(0);
>   }
>  } END_FOR_EACH_PTR(jmp);

There is also a problem with signed/unsigned constants,
like everywhere else in the code.

Could you submit a test case for this?

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