On Mon, 18 Apr 2011, Jan Hubicka wrote: > > > notice that OBJ_TYPE_REF is useless since foo got devitualized and it > > > holds alive > > > the useless s._vptr.S = &_ZTV1S[2]. We want to drop OBJ_TYPE_REF at time > > > we fold > > > first argument to constant. > > > > At some point we dropped all OBJ_TYPE_REF with direct fn but that lead to > > issues. I'll try to dig up what that was. > > Hah, that sounds really scary, given that OBJ_TYPE_REF should be semantically > no-op. > We definitely drop them in tree-ssa-ccp, so if we need to preserve them > somehow, that is > probably case where we should.
Ah, no. We _did_ that in CCP but now we only adjust the OBJ_TYPE_REF expr in CCP and defer to fold_stmt to eventually "devirtualize" it. See PR45878. Then rev.165435 was necessary, as we dropped OBJ_TYPE_REF for the non-devirtualized call as well. As both cases were because of type conversion issues this should be fixed with separating the call function type as we do now. I'll look into handling copyprop and FRE similarly. Richard.