Fix ICE when inlining into function containing polymorphic call
Jan Hubicka
hubicka@ucw.cz
Thu Nov 14 11:55:00 GMT 2019
> Hi,
>
> On Wed, Nov 13 2019, Jan Hubicka wrote:
> > Hi,
> > the testcase causes inline context cache to go out of sync because I
> > forgot to update used flags of parameters in one path of
> > update_indirect_edges_after_inlining.
> >
> > While debugging it I also added better consistency check to
> > ipa-inline-analysis and turned ipa-inline test from ifdef to -fchecking.
> > This uncovered yet another missed upate in recursive inliner.
> >
> > Bootstrapped/regtested x86_64-linux, comitted.
> >
> > PR c++/92421
> > * ipa-prop.c (update_indirect_edges_after_inlining):
> > Mark parameter as used.
> > * ipa-inline.c (recursive_inlining): Reset node cache
> > after inlining.
> > (inline_small_functions): Remove checking ifdef.
> > * ipa-inline-analysis.c (do_estimate_edge_time): Verify
> > cache consistency.
> > * g++.dg/torture/pr92421.C: New testcase.
> > Index: ipa-prop.c
> > ===================================================================
> > --- ipa-prop.c (revision 278151)
> > +++ ipa-prop.c (working copy)
> > @@ -3537,6 +3537,11 @@ update_indirect_edges_after_inlining (st
> > if (ici->polymorphic
> > && !ipa_get_jf_ancestor_type_preserved (jfunc))
> > ici->vptr_changed = true;
> > + ipa_set_param_used_by_indirect_call (new_root_info,
> > + ici->param_index, true);
> > + if (ici->polymorphic)
> > + ipa_set_param_used_by_polymorphic_call (new_root_info,
> > + ici->param_index, true);
> > }
>
>
>
> Interesting, you have this exact hunk already in the patch introducing
> the new param flags (message id
> id:20191103224712.ndzyxu6cn3jt3enu@kam.mff.cuni.cz or
> https://gcc.gnu.org/ml/gcc-patches/2019-11/msg00077.html). I did
> actually check it was there, even if only yesterday evening, but I did :-)
>
> And I can also see the code already in my Monday checkout (r278047). So
> I guess you must have actually removed it by accident in the meantime?
Well, it is there twice - once for PASS_THROUGH and here for ANCESTOR.
But it is quite possible that I had both (since I also had verification
at the place when originally doing the patch) and lost it on way to
mainline.
Honza
>
> Martin
More information about the Gcc-patches
mailing list