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

--- Comment #6 from Martin Jambor <jamborm at gcc dot gnu.org> ---
(In reply to Markus Trippelsdorf from comment #3)
> ix=1 and m_vecpfx.m_num=1 in this case.
> Let me know what other debugging info may be useful to you.

Well, it might be difficult debugging this without reproducing it,
but...

It would be nice to know, at ipa-cp.c:937, what is the
IPA_NODE_REF(parms_info->ipcp_orig_node), especially the lengths of
the descriptors and lattices vectors.  IPA_NODE_REF currently
translates to ipa_node_params_sum->get(parms_info->ipcp_orig_node) so
it should be easily printable in gdb.

Also, at ipa-inline-analysis.c:950, it is important to know where
parms_info came from, i.e. whether it was obtained as IPA_NODE_REF
(e->caller->global.inlined_to) or only IPA_NODE_REF (e->caller).

You might also try running with the following patch which should
hopefully find out where we create the first wrong jump function
(assuming that is the problem):

diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index cfd9c16..7116c0f 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -2570,6 +2570,12 @@ update_jump_functions_after_inlining (struct cgraph_edge
*cs,
                    enum tree_code operation;
                    operation = ipa_get_jf_pass_through_operation (src);

+                   struct ipa_node_params *new_root_info;
+                   new_root_info = IPA_NODE_REF (cs->caller->global.inlined_to
+                                                 ?
cs->caller->global.inlined_to
+                                                 : cs->caller);
+                   gcc_assert (formal_id < ipa_get_param_count
(new_root_info));
+
                    if (operation == NOP_EXPR)
                      {
                        bool agg_p;
@@ -4570,6 +4576,8 @@ ipa_read_jump_function (struct lto_input_block *ib,
       if (operation == NOP_EXPR)
        {
          int formal_id =  streamer_read_uhwi (ib);
+         gcc_assert (formal_id
+                     < ipa_get_param_count (IPA_NODE_REF (cs->caller)));
          struct bitpack_d bp = streamer_read_bitpack (ib);
          bool agg_preserved = bp_unpack_value (&bp, 1);
          ipa_set_jf_simple_pass_through (jump_func, formal_id, agg_preserved);
@@ -4578,6 +4586,8 @@ ipa_read_jump_function (struct lto_input_block *ib,
        {
          tree operand = stream_read_tree (ib, data_in);
          int formal_id =  streamer_read_uhwi (ib);
+         gcc_assert (formal_id
+                     < ipa_get_param_count (IPA_NODE_REF (cs->caller)));
          ipa_set_jf_arith_pass_through (jump_func, formal_id, operand,
                                         operation);
        }

Reply via email to