cgraphunit.c (verify_cgraph_node): Verify there is no direct call to a thunk.
authorMartin Jambor <mjambor@suse.cz>
Mon, 3 Jan 2011 13:15:35 +0000 (14:15 +0100)
committerMartin Jambor <jamborm@gcc.gnu.org>
Mon, 3 Jan 2011 13:15:35 +0000 (14:15 +0100)
2011-01-03  Martin Jambor  <mjambor@suse.cz>

* cgraphunit.c (verify_cgraph_node): Verify there is no direct call to
a thunk.

From-SVN: r168422

gcc/ChangeLog
gcc/cgraphunit.c

index c908a7b64b01300791cb5e6166480565fc987ad7..517704f58bae385ac07a702349ccc13f952d4431 100644 (file)
@@ -1,3 +1,8 @@
+2011-01-03  Martin Jambor  <mjambor@suse.cz>
+
+       * cgraphunit.c (verify_cgraph_node): Verify there is no direct call to
+       a thunk.
+
 2011-01-03  Martin Jambor  <mjambor@suse.cz>
 
        PR tree-optimization/46984
index 36ba75a55ea8fcacb89acac0214b51bc29a8d4fa..ec477ee920bdcb36f5306c83ac90c9b2535d4ca1 100644 (file)
@@ -647,6 +647,8 @@ verify_cgraph_node (struct cgraph_node *node)
                          }
                        if (!e->indirect_unknown_callee)
                          {
+                           struct cgraph_node *n;
+
                            if (e->callee->same_body_alias)
                              {
                                error ("edge points to same body alias:");
@@ -667,6 +669,15 @@ verify_cgraph_node (struct cgraph_node *node)
                                debug_tree (decl);
                                error_found = true;
                              }
+                           else if (decl
+                                    && (n = cgraph_get_node_or_alias (decl))
+                                    && (n->same_body_alias
+                                        && n->thunk.thunk_p))
+                             {
+                               error ("a call to thunk improperly represented "
+                                      "in the call graph:");
+                               debug_gimple_stmt (stmt);
+                             }
                          }
                        else if (decl)
                          {