On Mon, 31 Dec 2018 21:41:22 +0000, Yonghong Song wrote: > > func2 after func adjust will start at off and there is no line info for > > off + cnt (insn4), so we will preserve line_info2. > > Thanks for verification, I missed that > >>> + /* count lines to be removed */ > >>> + l_off = i; > >>> + l_cnt = 0; > >>> + for (; i < nr_linfo; i++) > >>> + if (linfo[i].insn_off < off + cnt) > >>> + l_cnt++; > >>> + else > >>> + break; > once you reached linfo[i].insn_off >= off + cnt, no more counting. > since l_cnt starts from 0, so the last one is actually preserved.
Ah, I see! > > linfo1: > > insn1 > > insn2 /* dead */ > > linfo2: > > insn3 /* dead */ > > insn4 > > linfo3: > > insn5 > > > > || > > \/ > > > > linfo1: > > insn1 > > linfo2: > > insn4 > > linfo3: > > insn5 > > Yes, the above is the desirable output. Perfect, let me respin.