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

--- Comment #9 from Filip Kastl <pheeck at gcc dot gnu.org> ---
If I do

```
  FOR_EACH_DEFINED_FUNCTION (node)
    {
      push_cfun (DECL_STRUCT_FUNCTION (node->decl));
      cleanup_tree_cfg ();
      pop_cfun ();
    }
```

at the beginning of 'tree_profiling ()', I avoid the ICE.  That snippet removes
the call memcpy together with a part of the CFG.  Consequently, 'tree_profiling
()' never creates gcov3.g.

My hypothesis is that 'tree_profiling ()' doesn't expect 'cleanup_tree_cfg ()'
to remove the statements it does.  It gets confused and thinks that the code it
inserted is still present and maybe modifies the symbol based on that
confusion?  I'll try to figure out if that's what's happening.

Reply via email to