https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92528

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|hubicka at gcc dot gnu.org         |fxue at os dot 
amperecomputing.com

--- Comment #6 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
This is the same issue as I hit in Firefox build and we discussed at:
https://gcc.gnu.org/ml/gcc-patches/2019-11/msg01351.html
Feng is right that ipa_set_jf_unknown is missing clear of agg.

> I checked update_jump_functions_after_inlining(), and found one suspicious 
> place:

>  for (i = 0; i < count; i++)
>    {
>      struct ipa_jump_func *dst = ipa_get_ith_jump_func (args, i);
>      if (!top)
>        {
>          ipa_set_jf_unknown (dst);
>          <<<<<<<<<<<<<<<<<   we should also invalidate dst->agg.items.

Yes following patch fixes it:

Index: ipa-prop.c
===================================================================
--- ipa-prop.c  (revision 278222)
+++ ipa-prop.c  (working copy)
@@ -514,6 +514,8 @@ ipa_set_jf_unknown (struct ipa_jump_func
   jfunc->type = IPA_JF_UNKNOWN;
   jfunc->bits = NULL;
   jfunc->m_vr = NULL;
+  jfunc->agg.by_ref = false;
+  jfunc->agg.items = NULL;
 }

 /* Set JFUNC to be a copy of another jmp (to be used by jump function

>          continue;
>        }
>      class ipa_polymorphic_call_context *dst_ctx
>        = ipa_get_ith_polymorhic_call_context (args, i);   <<<< An irrelevant 
> point:  and should we also do some kind of cleaning on dst_ctx?

There is no need to clear polymorphic call context. It does not refer to the
parameters of caller. If it was valid for all possible contexts it is still
valid. 

So I think ipa_set_jf_unknown shall not clear bits and m_vr.

Honza

Reply via email to