On Fri, Jul 07, 2017 at 01:25:14AM -0700, Christopher Li wrote: > On Fri, Jul 7, 2017 at 12:11 AM, Luc Van Oostenryck > <luc.vanoostenryck@xxxxxxxxx> wrote: > >> And remove_usage() is deleting the very same list > >> from with in the loop. That is the bug. > > > > Strange. kill_use_list() is only iterated via insn->phi_list > > or insn->arguments, not p->user. > > > > But yes, something is surely messing with the lists here. > > > > I figure it out. It is a false alarm on the checking side. > The condition I want to check can still cause a bug, > but this report is not one of those conditions. > > It is cause by this code: > > static int dead_insn(struct instruction *insn, pseudo_t *src1, > pseudo_t *src2, pseudo_t *src3) > { > struct pseudo_user *pu; > FOR_EACH_PTR(insn->target->users, pu) { > if (*pu->userp != VOID) > return 0; > } END_FOR_EACH_PTR(pu); > > So the return terminate the execution flow before > reaching to the END_FOR_EACH_PTR(pu). > The ptr->active still think we are in the loop > But we are not. OK, I see. > It is a bug in the checking side. I still think this kind > of checking is useful, but need some special handle > of bail out of the ptr_list loop. Yes, some kind of optional integrity checking or the kind of checks you're doing here should be very usefull. > Very sorry about that. No problem, of course. -- 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