OSDN Git Service

2011-01-03 Martin Jambor <mjambor@suse.cz>
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 Jan 2011 13:15:35 +0000 (13:15 +0000)
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 Jan 2011 13:15:35 +0000 (13:15 +0000)
* cgraphunit.c (verify_cgraph_node): Verify there is no direct call to
a thunk.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168422 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cgraphunit.c

index c908a7b..517704f 100644 (file)
@@ -1,5 +1,10 @@
 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
        * cgraph.h (cgraph_indirect_call_info): make field thunk_delta
        HOST_WIDE_INT.
index 36ba75a..ec477ee 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)
                          {