On 21 March 2017 at 21:41, Dibyendu Majumdar <mobile@xxxxxxxxxxxxxxx> wrote: > On 21 March 2017 at 15:54, Dibyendu Majumdar <mobile@xxxxxxxxxxxxxxx> wrote: >> When I try to compile following test (see link) in sparse-llvm - LLVM says: >> >> Instruction does not dominate all uses! >> %load_target = load i32, i32* %191 >> %R122 = icmp eq i32 %load_target4, %load_target >> Instruction does not dominate all uses! >> %load_target = load i32, i32* %191 >> %R283 = icmp eq i32 %load_target4, %load_target >> Instruction does not dominate all uses! >> %load_target = load i32, i32* %191 >> %R522 = icmp eq i32 %load_target4, %load_target >> >> I have not yet investigated what the issue is but I thought it best to >> post the test case so that it can be validated. >> >> https://github.com/dibyendumajumdar/dmr_c/blob/master/tests/bugs/cq3.c >> > > Appears that the problem is occurring in simplify_one_symbol(). > I have tracked this down to the treatment of variable n2 (looking only at the first function regc() for now). The C code looks like this: for (j=0; j<22; j++) switch (s) { case 1: if (d[j] != n1) { n2 = d[j]; s = 2; nr = 1; } break; case 2: if (d[j] == n1) { s = 3; break; } if (d[j] == n2) { nr = nr+1; break; } s = 4; break; case 3: if (d[j] != n1) s = 4; break; } ; Although there is 1 store and 1 load of n2, the attempt to convert the load to a pseudo and kill the store seems wrong. Perhaps the simplification is not taking into account the jumps here due to the switch? I am not sure how to fix this issue. Ideas? Thanks and Regards Dibyendu -- 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