https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123629
--- Comment #16 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Martin Jambor <[email protected]>: https://gcc.gnu.org/g:654026083af3fed619ad23445ba7513d4d4b6a66 commit r16-7754-g654026083af3fed619ad23445ba7513d4d4b6a66 Author: Martin Jambor <[email protected]> Date: Fri Feb 27 11:58:01 2026 +0100 ipa: Meet same speculative and certain polymorphic contexts (PR123629) PR 123629 is a somewhat complicated situation. IPA-CP clones for a known speculative polymorphic context in a situation when a caller bringing the known context has itself already been cloned, and now we can determine that the context coming from that clone is not speculative (but otherwise the same). This confuses the meet function of contexts which gives up and returns a useless context, which in turn triggers an assert because the value we originally cloned for is nowhere to be found in the data structures which describe what we know about the function clone. This patch changes the meet function so that it can deal with this situation. When one of the contexts does not have a certain component, the other one is moved to the speculative one. gcc/ChangeLog: 2026-02-23 Martin Jambor <[email protected]> PR ipa/123629 * ipa-polymorphic-call.cc (ipa_polymorphic_call_context::meet_with): When an outer context is NULL, call make_speculative on the other one.
