re PR middle-end/40080 (error: missing callgraph edge for call stmt)
authorJan Hubicka <jh@suse.cz>
Sat, 9 May 2009 20:10:37 +0000 (22:10 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 9 May 2009 20:10:37 +0000 (20:10 +0000)
PR middle-end/40080
* cgraphunit.c (cgraph_materialize_all_clones): Do not redirect
indirect calls; verify cgraph afterwards.

From-SVN: r147320

gcc/ChangeLog
gcc/cgraphunit.c

index 6de79afa97a8705cc69ae789935bbbf99cae9a22..73de4f377f0e54b80d8315042723ba511b7691af 100644 (file)
@@ -1,3 +1,9 @@
+2009-05-09  Jan Hubicka  <jh@suse.cz>
+
+       PR middle-end/40080
+       * cgraphunit.c (cgraph_materialize_all_clones): Do not redirect
+       indirect calls; verify cgraph afterwards.
+
 2009-05-09  Jan Hubicka  <jh@suse.cz>
 
        PR bootstrap/40082
index 9366ebe28693dff44767dc9f351cd9568d671f68..e88d00d0dfb5733f8b6dd7a01c616522bde746aa 100644 (file)
@@ -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);
 }