This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][LTO] Fix most whopr ICEs


This fixes most of the whopr ICEs in the lto.exp suites.  The issue
is that we do not properly communicate to the cgraph our
"boundary nodes" by still marking them as analyzed (the analyzed flag
is used by cgraph to determine if things have a body).

Fixing this allowed me to get rid of the early dropping of extern
inline bodies and thus fix PR41502 for real.

Preliminary testing looks good, now in a full bootstrap and testing
run on x86_64-unknown-linux-gnu.

Richard.

2009-09-30  Richard Guenther  <rguenther@suse.de>

	PR middle-end/41502
	* lto-cgraph.c (lto_output_node): Mark node as not analyzed
	if it is a boundary node.
	(input_edge): Remove assertion on extern inlines.
	* cgraphunit.c (ipa_passes): Do not free extern inline bodies.

Index: gcc/lto-cgraph.c
===================================================================
*** gcc/lto-cgraph.c	(revision 152324)
--- gcc/lto-cgraph.c	(working copy)
*************** lto_output_node (struct lto_simple_outpu
*** 179,185 ****
  {
    unsigned int tag;
    struct bitpack_d *bp;
!   unsigned local, externally_visible, inlinable;
    bool boundary_p, wrote_decl_p;
    intptr_t ref;
  
--- 179,185 ----
  {
    unsigned int tag;
    struct bitpack_d *bp;
!   unsigned local, externally_visible, inlinable, analyzed;
    bool boundary_p, wrote_decl_p;
    intptr_t ref;
  
*************** lto_output_node (struct lto_simple_outpu
*** 213,218 ****
--- 213,219 ----
    local = node->local.local;
    externally_visible = node->local.externally_visible;
    inlinable = node->local.inlinable;
+   analyzed = node->analyzed;
  
    /* In WPA mode, we only output part of the call-graph.  Also, we
       fake cgraph node attributes.  There are two cases that we care.
*************** lto_output_node (struct lto_simple_outpu
*** 229,234 ****
--- 230,236 ----
        local = 0;
        externally_visible = 1;
        inlinable = 0;
+       analyzed = 0;
      }
    else if (lto_forced_extern_inline_p (node->decl))
      {
*************** lto_output_node (struct lto_simple_outpu
*** 259,265 ****
    bp_pack_value (bp, node->abstract_and_needed, 1);
    bp_pack_value (bp, node->reachable, 1);
    bp_pack_value (bp, node->lowered, 1);
!   bp_pack_value (bp, node->analyzed, 1);
    bp_pack_value (bp, node->process, 1);
    bp_pack_value (bp, node->alias, 1);
    bp_pack_value (bp, node->finalized_by_frontend, 1);
--- 261,267 ----
    bp_pack_value (bp, node->abstract_and_needed, 1);
    bp_pack_value (bp, node->reachable, 1);
    bp_pack_value (bp, node->lowered, 1);
!   bp_pack_value (bp, analyzed, 1);
    bp_pack_value (bp, node->process, 1);
    bp_pack_value (bp, node->alias, 1);
    bp_pack_value (bp, node->finalized_by_frontend, 1);
*************** input_edge (struct lto_input_block *ib,
*** 556,571 ****
    /* Make sure the caller is the prevailing decl.  */
    prevailing_caller = lto_symtab_prevailing_decl (caller->decl);
  
-   /* FIXME lto: remove this once extern inline is handled in LGEN. */
-   if (caller_resolution != LDPR_PREVAILING_DEF
-       && caller_resolution != LDPR_PREVAILING_DEF_IRONLY
-       && caller_resolution != LDPR_PREEMPTED_REG
-       && caller_resolution != LDPR_PREEMPTED_IR)
-     {
-       /* If we have a extern inline, make sure it is the prevailing.  */
-       gcc_assert (prevailing_caller == caller->decl);
-     }
- 
    if (prevailing_callee != callee->decl)
      {
        struct lto_file_decl_data *file_data;
--- 558,563 ----
Index: gcc/cgraphunit.c
===================================================================
*** gcc/cgraphunit.c	(revision 152324)
--- gcc/cgraphunit.c	(working copy)
*************** ipa_passes (void)
*** 1362,1375 ****
    if (cgraph_state < CGRAPH_STATE_IPA_SSA)
      cgraph_state = CGRAPH_STATE_IPA_SSA;
  
-   /* FIXME lto.  Remove the bodies of extern inline functions that we never
-      inlined.  Otherwise, during WPA extern inline functions generate duplicate
-      cgraph nodes for the same function which conflict with each other
-      and with the cgraph node for the offline version.
-      But this is really too early - see PR41502.  */
-   if (flag_generate_lto)
-     cgraph_remove_unreachable_nodes (false, dump_file);
- 
    if (!in_lto_p)
      {
        /* Generate coverage variables and constructors.  */
--- 1362,1367 ----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]