On Wed, Feb 24, 2021 at 05:54:08PM -0700, Martin Sebor via Gcc-patches wrote: > > > Why does uninit warn with VCE but not with NOP_EXPR? Or does the > > > warning disappear because of those other optimizations you mention? > > Can you comment on Jeff's POC patch in the PR? Would it make sense > to apply it (with adjustments if necessary) as well to make the warning > more robust in case the VCE comes back?
It has been a while since I looked into uninit pass in detail, so I don't know if it is the right spot to do it, but as my mail clearly states, it is not just about VIEW_CONVERT_EXPR, demoting NOP_EXPR/CONVERT_EXPR that vrp_simplify_cond_using_ranges doesn't simplify are the same case. So, if the uninit pass was to be made robust against tree-vrp.c not doing its job, then it would basically need to virtually repeat vrp_simplify_cond_using_ranges (using either get_range_info or ranger). I'm not convinced it is the right way though to account for possibilities of disabled passes by repeating their code in other passes. Jakub