This is the mail archive of the gcc-bugs@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]

[Bug c++/65277] [5 Regression] ice in get_untransformed_body with -O2


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

--- Comment #4 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
get_untransformed_body should turn itself into noop in !in_lto_p compilation as
all function bodies have DECL_RESULT. (it probably deserves comment, but that
way we check if the body was read)

Formatting is off:

  for (i = new_order_pos - 1; i >= 0; i--)
    {
      node = order[i];

      if (node->process)
        {
     expanded_func_count++;
     if(node->tp_first_run)
       profiled_func_count++;

    if (symtab->dump_file)
          fprintf (symtab->dump_file,
                   "Time profile order in expand_all_functions:%s:%d\n",
                   node->asm_name (), node->tp_first_run);
          node->process = 0;
          node->expand ();
        }
    }

but actual code makes sense. Node in question is:
_ZTch0_v0_n40_N3Ent4ThisEv/7 (virtual Ent& Ent::_ZTch0_v0_n40_N3Ent4ThisEv())
@0x7ffff6c5d620
  Type: function
  Body removed by symtab_remove_unreachable_nodes
  Visibility: externally_visible public weak comdat comdat_group:_ZN3Ent4ThisEv
one_only section:.text._ZN3Ent4ThisEv (implicit_section) virtual artificial
  Same comdat group as: _ZN3Ent4ThisEv/5
  References: 
  Referring: 
  Availability: not_available
  First run: 0
  Function flags: icf_merged
  Called by: 
  Calls: 

it was removed, so it is wrong that we try to output it.

The removal happens in ipa-icf and it is based on
cgraph_can_remove_if_no_direct_calls_p being wrong - if symbol is in comdat
group removing all direct calls to it may not make it removable if other
symbols hold it around... Will fix that.


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