On Thu, 21 Mar 2019, Richard Biener wrote: > > The testcase in this PR shows that IVOPTs ends up using cached > control IV information of IVs that have been elimiated by it. > IVOPTs fails to properly release that information as scev_reset > just resets ->nb_iterations but not control-IVs. > > A proper fix is to avoid doing the above for each loop and instead > delay IV def removal until IVOPTs has finished and there ensure > also possibly invalidated control-IVs are released. > > Bootstrap & regtest running on x86_64-unknown-linux-gnu. > > IMHO this is the proper fix, I'll test and install also a patch > restoring defensive checks that avoided the ICE before. > > Slightly safe might be to prune control-IVs where we do > scev_reset () now instead of delaying DEF removal. I'm only 99% > sure IVOPTs, when processing outer loops, is not affected by > the dead IVs being still in the IL (all uses are already updated > but feeding defs are not elimiated either). > > Bin?
Applied as rev. 269914. Richard.