From 76df0ae6df0c70f20b19c9e407892fb17b2643cc Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Mon, 3 Jan 2011 14:15:35 +0100 Subject: [PATCH] cgraphunit.c (verify_cgraph_node): Verify there is no direct call to a thunk. 2011-01-03 Martin Jambor * cgraphunit.c (verify_cgraph_node): Verify there is no direct call to a thunk. From-SVN: r168422 --- gcc/ChangeLog | 5 +++++ gcc/cgraphunit.c | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c908a7b64b0..517704f58ba 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-01-03 Martin Jambor + + * cgraphunit.c (verify_cgraph_node): Verify there is no direct call to + a thunk. + 2011-01-03 Martin Jambor PR tree-optimization/46984 diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 36ba75a55ea..ec477ee920b 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -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) { -- 2.30.2