https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123629
--- Comment #10 from Martin Jambor <jamborm at gcc dot gnu.org> ---
The problem is that ipa_polymorphic_call_context::meet_with() cannot handle:
Polymorphic call context meet: Speculative outer type:struct TenuringTracer
(or a derived type) at offset 0
With context: Outer type:struct TenuringTracer offset 0
Updated as: nothing known
And as we now re-gather all values/cntexts for the selected subset of
callers, we trigger an assert checking that the context we cloned for
(the the speculative one) is among the collected ones.
After talking with Honza, we agreed it would be best if meet_with
dropped the non-speculative one to speculative before meeting
speculative parts. I'm going to test the following fix:
diff --git a/gcc/ipa-polymorphic-call.cc b/gcc/ipa-polymorphic-call.cc
index 5e53c217e33..46176dd7ac0 100644
--- a/gcc/ipa-polymorphic-call.cc
+++ b/gcc/ipa-polymorphic-call.cc
@@ -2484,10 +2484,10 @@ ipa_polymorphic_call_context::meet_with
(ipa_polymorphic_call_context ctx,
/* If call is known to be invalid, we are done. */
if (!outer_type)
- ;
+ ctx.make_speculative ();
else if (!ctx.outer_type)
{
- clear_outer_type ();
+ make_speculative ();
updated = true;
}
/* If types are known to be same, merging is quite easy. */