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