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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #62783|0                           |1
        is obsolete|                            |

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
Created attachment 62784
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62784&action=edit
patch

This bootstraps (ontop of r16-5214-gc9108d4dccb4b9), but

+FAIL: g++.dg/lto/20090311-1 cp_lto_20090311-1_0.o-cp_lto_20090311-1_1.o link,
-
O2 -flto -flto-partition=none -fuse-linker-plugin -fno-fat-lto-objects 
(interna
l compiler error: Segmentation fault)
+FAIL: g++.dg/lto/20090311-1 cp_lto_20090311-1_0.o-cp_lto_20090311-1_1.o link,
-
O2 -flto -fuse-linker-plugin (internal compiler error: Segmentation fault)

somehow we remove a call but leave the cgraph not updated.

Program received signal SIGSEGV, Segmentation fault.
0x00000000010bfc5e in cgraph_node::verify_node (
    this=<cgraph_node * const 0x7ffff6ea3000 "main"/3>)
    at /space/rguenther/src/gcc-autopar_devel/gcc/cgraph.cc:4082
4082                  && e->count.differs_from_p (gimple_bb
(e->call_stmt)->count)))
(gdb) p e->call_stmt
$1 = (gcall *) 0x7ffff700dd48
(gdb) p e->call_stmt->bb
$2 = <basic_block 0x0>

It's odd because the old code didn't do this either (updating the callgraph),
the call is now removed via

#0  simple_dce_from_worklist (worklist=0x7fffffffcf70, need_eh_cleanup=0x0)
    at /space/rguenther/src/gcc-autopar_devel/gcc/tree-ssa-dce.cc:2446
#1  0x00000000014efef4 in ipa_release_ssas_in_hash (killed_ssas=0x4d761e0)
    at
/space/rguenther/src/gcc-autopar_devel/gcc/ipa-param-manipulation.cc:2660
#2  0x0000000001913e92 in copy_body (id=0x7fffffffd500, 
    entry_block_map=<basic_block 0x7ffff6ea01e0 (2)>, 
    exit_block_map=<basic_block 0x7ffff6ea0d20 (3)>, 
    new_entry=<basic_block 0x0>)
    at /space/rguenther/src/gcc-autopar_devel/gcc/tree-inline.cc:3409
#3  0x0000000001919248 in expand_call_inline

no idea how to update the callgraph from within simple_dce_from_worklist.

+FAIL: gcc.dg/ipa/pr108007.c execution test

this shows that the way to discover the "unused leaf" does not handle cycles
properly, as would simple_dce_from_worklist.  We have

  m_9 = _7 | m_8;
...
  # m_8 = PHI <2(4), m_9(5)>

here.

Reply via email to