aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2011-01-03 14:15:35 +0100
committerMartin Jambor <jamborm@gcc.gnu.org>2011-01-03 14:15:35 +0100
commit76df0ae6df0c70f20b19c9e407892fb17b2643cc (patch)
tree39b43f209e2695644ffc95e3fb782a47c96c3a90 /gcc
parentce47fda3ce6adfe86f725930dedbfb1f775ddd45 (diff)
downloadgcc-76df0ae6df0c70f20b19c9e407892fb17b2643cc.zip
gcc-76df0ae6df0c70f20b19c9e407892fb17b2643cc.tar.gz
gcc-76df0ae6df0c70f20b19c9e407892fb17b2643cc.tar.bz2
cgraphunit.c (verify_cgraph_node): Verify there is no direct call to a thunk.
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/cgraphunit.c11
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c908a7b..517704f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 36ba75a..ec477ee 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)
{