On Sun, Jun 17, 2018 at 02:23:53AM +0100, Dibyendu Majumdar wrote: > Hi, > > I am facing a problem with following: > > C input: > long long strlen(const char *s) > { > long long n = 0; > while (s[n] != 0) > n++; > return n; > } > > Here is part extract of the linear output from dmr_C - this is the IR > before any simplifications. > > .L2: > br .L4 > > .L3: > load.64 %r9 <- 0[n] > phisrc.64 %phi1(return) <- %r9 > br .L5 > > .L5: > phi.64 %r10 <- %phi1(return) > ret.64 %r9 > > Problem is with OP_RET as it should I think return %r10 nor %r9. > > I was wondering is this is already fixed somewhere? Not really a bug so not really fixed but annoying enough that I removed this optimization in my tree. See: https://github.com/lucvoo/sparse/commit/1609176c9 -- 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