On Mon, Jan 13, 2020 at 3:15 AM bin.cheng <bin.ch...@linux.alibaba.com> wrote: > > ------------------------------------------------------------------ > Sender:Richard Biener <richard.guent...@gmail.com> > Sent At:2020 Jan. 9 (Thu.) 20:01 > Recipient:Bin.Cheng <amker.ch...@gmail.com> > Cc:bin.cheng <bin.ch...@linux.alibaba.com>; GCC Patches > <gcc-patches@gcc.gnu.org> > Subject:Re: [PATCH GCC11]Improve uninitialized warning with value range info > > > On Thu, Jan 9, 2020 at 11:17 AM Bin.Cheng <amker.ch...@gmail.com> wrote: > > > I am not quite follow here. Do you mean we collect three cases "i < > > > j", "i < min(j)", "max(i) < j" then > > > call prune_uninit_phi_opnds for all three conditions? > > > > No, I've meant to somehow arrange that the 'preds' passed to > > use_pred_not_overlap_with_undef_path_pred contain all three predicates > > rather than just i < j, thus "expand" fully symbolic predicates. > > Seems this would require non-trivial refactoring of the original code. > > > > This is another question? because now we simply break out of for loop > > > for finding such condition: > > > > > > - if ((gimple_code (flag_def) == GIMPLE_PHI) > > > - && (gimple_bb (flag_def) == gimple_bb (phi)) > > > - && find_matching_predicate_in_rest_chains (the_pred, preds, > > > - num_preds)) > > > - break; > > > > > > It's always possible that this flag_def can't prune use predicates > > > against undefined path predicates, while a later one can prune but is > > > skipped? > > > > I don't follow but I also don't want to understand the code too much ;) > > > > I'm fine with the idea and if the patch cannot introudce extra bogus > > warnings > > let's go with it. Can you amed the comment before the two > > find_var_cmp_const > > calls? I wonder whether eliding the second sweep when the first didn't find > > any predicate it skipped is worth the trouble. > > Thanks for the comments, I updated the patch as attached.
OK. Thanks, Richard. > Thanks, > bin > > 2020-01-08 Bin Cheng <bin.li...@linux.alibaba.com> > > * tree-ssa-uninit.c (find_var_cmp_const): New function. > (use_pred_not_overlap_with_undef_path_pred): Call above. > (find_matching_predicate_in_rest_chains): Remove param.