On 5 March 2018 at 21:32, Dibyendu Majumdar <mobile@xxxxxxxxxxxxxxx> wrote: > On 5 March 2018 at 21:21, Dibyendu Majumdar <mobile@xxxxxxxxxxxxxxx> wrote: >> Hi, >> >> Almost a year ago I had reported a problem with Sparse simplification phase. >> >> https://marc.info/?l=linux-sparse&m=148953605610758&w=2 >> >> Given below is a test program. >> >> With the release Sparse 0.5.1 release, the output from test-linearizer is: >> >> cbrtl: >> ep 0x7f5a27050010: cbrtl >> >> .L0: >> bug1.c:1 >> <entry-point> >> set.64 %r4 <- 0.000000 >> ret.64 %r4 >> >> Now I had a hunch that the bug may be resolved when PSEUDO_VALs have a >> size. So I tried the same program with Chris' git repo version. >> >> The output is: >> >> cbrtl: >> .L0x7f4c4c3b0010: >> <entry-point> >> set.64 %r1 <- 1.000000 >> set.64 %r4 <- 0.000000 >> ret.64 %r4 >> >> Hurray! >> >> I think some of the bugs in Sparse simplification phase is because all >> PSEUDO_VALs with same value are considered equal - irrespective of >> size! >> >> Here is the test: >> >> double cbrtl (double x) >> { >> int hx; >> double r,s,w; >> double lt; >> unsigned sign; >> union { >> double t; >> unsigned pt[2]; >> } ut, ux; >> int n0; >> ut.t = 1.0; >> n0 = (ut.pt[0] == 0); >> ut.t = 0.0; >> ux.t = x; >> return ut.t; >> } >> > > Apologies looks like my example above is wrong (i.e. does not reflect > the original issue) ... please ignore. > The actual test is: https://github.com/dibyendumajumdar/sparse-testing/blob/master/eic/testcbrt.c. I messed it up by trying to shorten it. Here is the first few lines of output from Sparse 0.5.1: cbrtl: .L0: <entry-point> load.32 %r2 <- 0[ut] seteq.32 %r3 <- %r2, $0 set.64 %r4 <- 0.000000 store.64 %r4 -> 0[ut] store.64 %arg1 -> 0[ux] And here is the output from Chris version: cbrtl: .L0x7f29db910010: <entry-point> set.64 %r1 <- 1.000000 load.32 %r2 <- 0[ut] seteq.32 %r3 <- %r2, $0 set.64 %r4 <- 0.000000 store.64 %r4 -> 0[ut] store.64 %arg1 -> 0[ux] And here is the output from dmr_C: cbrtl: .L0: <entry-point> set.f64 %r1 <- 1.000000 store.f64 %r1 -> 0[ut] load.32 %r2 <- 0[ut] seteq.32 %r3 <- %r2, $0 set.f64 %r4 <- 0.000000 store.f64 %r4 -> 0[ut] store.f64 %arg1 -> 0[ux] So the problem still seems to be there I think :-( 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