Bug 40080 - [4.5 Regression] error: missing callgraph edge for call stmt
Summary: [4.5 Regression] error: missing callgraph edge for call stmt
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: 4.5.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-checking, ice-on-valid-code
Depends on:
Blocks: 40083
  Show dependency treegraph
 
Reported: 2009-05-09 09:11 UTC by marcus
Modified: 2009-05-11 16:40 UTC (History)
3 users (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Build: x86_64-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2009-05-09 09:21:42


Attachments
dplay.i (334 bytes, text/plain)
2009-05-09 09:11 UTC, marcus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description marcus 2009-05-09 09:11:12 UTC
/home/marcus/projects/gcc.trunk/BIN/bin/gcc -c  -O3  -o dplay.o dplay.i  
dplay.i:44: error: missing callgraph edge for call stmt:
# .MEM_13 = VDEF <.MEM_10>
D.2719_6 = xcbDeletePlayerFromAllGroups ();

xDP_IF_EnumGroupsInGroup.clone.0/10(-1) [0x7fa23ece1800]: (inline copy in xDP_IF_DestroyPlayer/3) (clone of xDP_IF_EnumGroupsInGroup.clone.0/8) availability:local 38 insns body local finalized inlinable
  called by: xcbDeletePlayerFromAllGroups/9 (9.18 per call) (inlined) 
  calls: ff/4 (9.18 per call) 
dplay.i:44: internal compiler error: verify_cgraph_node failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 marcus 2009-05-09 09:11:49 UTC
Created attachment 17834 [details]
dplay.i

reduced testcase

gcc -c -O3 dplay.i
Comment 2 Richard Biener 2009-05-09 09:21:42 UTC
Honza, this is caused by your cgraph changes.  Likely an easier to reproduced
case than PR40079.
Comment 3 Jan Hubicka 2009-05-09 18:52:50 UTC
Subject: Re:  [4.5 Regression] error: missing callgraph edge for call stmt

Hi,
I am testing the following:

Index: cgraphunit.c
===================================================================
--- cgraphunit.c	(revision 147319)
+++ cgraphunit.c	(working copy)
@@ -1762,7 +1762,12 @@ cgraph_materialize_all_clones (void)
 	for (e = node->callees; e; e = e->next_callee)
 	  {
 	    tree decl = gimple_call_fndecl (e->call_stmt);
-	    if (decl != e->callee->decl)
+	    /* When function gets inlined, indirect inlining might've invented
+	       new edge for orginally indirect stmt.  Since we are not
+	       preserving clones in the original form, we must not update here
+	       since other inline clones don't need to contain call to the same
+	       call.  Inliner will do the substitution for us later.  */
+	    if (decl && decl != e->callee->decl)
 	      {
 		gimple new_stmt;
 		gimple_stmt_iterator gsi;
@@ -1808,6 +1813,9 @@ cgraph_materialize_all_clones (void)
         verify_cgraph_node (node);
 #endif
       }
+#ifdef ENABLE_CHECKING
+  verify_cgraph ();
+#endif
   cgraph_remove_unreachable_nodes (false, cgraph_dump_file);
 }
 
Comment 4 Jan Hubicka 2009-05-09 20:10:56 UTC
Subject: Bug 40080

Author: hubicka
Date: Sat May  9 20:10:37 2009
New Revision: 147320

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147320
Log:

	PR middle-end/40080
	* cgraphunit.c (cgraph_materialize_all_clones): Do not redirect
	indirect calls; verify cgraph afterwards.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cgraphunit.c

Comment 5 hjl@gcc.gnu.org 2009-05-11 16:37:24 UTC
Subject: Bug 40080

Author: hjl
Date: Mon May 11 16:37:07 2009
New Revision: 147389

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147389
Log:
2009-05-11  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/40080
	* gcc.c-torture/compile/pr40080.c: New.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr40080.c
Modified:
    trunk/gcc/testsuite/ChangeLog

Comment 6 H.J. Lu 2009-05-11 16:40:26 UTC
Fixed.
Comment 7 hjl@gcc.gnu.org 2009-05-11 16:49:34 UTC
Subject: Bug 40080

Author: hjl
Date: Mon May 11 16:49:17 2009
New Revision: 147390

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147390
Log:
2009-05-11  H.J. Lu  <hongjiu.lu@intel.com>

	Backport from mainline:
	2009-05-11  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/40080
	* gcc.c-torture/compile/pr40080.c: New.

	2009-05-11  Paolo Bonzini  <bonzini@gnu.org>

	* gcc.c-torture/compile/pr40026.c: New testcase.

	2009-05-09  Jan Hubicka  <jh@suse.cz>

	PR middle-end/40043
	* g++.dg/eh/nested-try.C: New test.

Added:
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/eh/nested-try.C
      - copied unchanged from r147389, trunk/gcc/testsuite/g++.dg/eh/nested-try.C
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr40026.c
      - copied unchanged from r147389, trunk/gcc/testsuite/gcc.c-torture/compile/pr40026.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr40080.c
      - copied unchanged from r147389, trunk/gcc/testsuite/gcc.c-torture/compile/pr40080.c
Modified:
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog