On Wed, Mar 22, 2017 at 1:12 AM, Dibyendu Majumdar <mobile@xxxxxxxxxxxxxxx> wrote: > On 21 March 2017 at 22:21, Dibyendu Majumdar <mobile@xxxxxxxxxxxxxxx> wrote: >> I have tracked this down to the treatment of variable n2. > > Here is a small program that reproduces the issue: > > static int regc(void) > { > char r00, r01, r02; > int s, n1, n2, j, d[2]; > r00 = 0; > r01 = 1; > r02 = 2; > d[0] = &r01 - &r00; > d[1] = &r02 - &r01; > > n1 = d[0]; > s = 1; > > for (j = 0; j < 2; j++) > switch (s) { > case 1: > n2 = d[j]; > break; > case 2: > if (d[j] == n2) { > break; > } > s = 4; > break; > }; > return s; > } Interesting case. It seems that is closely related to the fact that there is some code paths where n2 is undefined (not yet stored) even if these paths can't happen at execution time (like j == 0, s == 2). The memops/symbol simplification then wrongly simplify away the store. I'll look for a solution. -- 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