summaryrefslogtreecommitdiff
path: root/gcc/lto-symtab.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-24 17:06:41 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-24 17:06:41 +0000
commitfa7a183ac68d0f2fa8dfdf6558c1013c4f0735b2 (patch)
tree3cd1fcbc2eae962d1529f94d63558293153dcd3f /gcc/lto-symtab.c
parent5672b7f8b134fa65319353041e024e66f3bd6ad1 (diff)
downloadgcc-fa7a183ac68d0f2fa8dfdf6558c1013c4f0735b2.tar.gz
2010-11-24 Richard Guenther <rguenther@suse.de>
PR lto/43218 * lto-symtab.c (lto_cgraph_replace_node): Mark edges with conflicting function signatures as non-inlineable. * gcc.dg/lto/20100423-1_0.c: Enable for all LTO modes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167122 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-symtab.c')
-rw-r--r--gcc/lto-symtab.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c
index b83c75e9da7..4484d93f0a2 100644
--- a/gcc/lto-symtab.c
+++ b/gcc/lto-symtab.c
@@ -210,6 +210,7 @@ lto_cgraph_replace_node (struct cgraph_node *node,
{
struct cgraph_edge *e, *next;
bool no_aliases_please = false;
+ bool compatible_p;
if (cgraph_dump_file)
{
@@ -240,10 +241,19 @@ lto_cgraph_replace_node (struct cgraph_node *node,
}
/* Redirect all incoming edges. */
+ compatible_p
+ = gimple_types_compatible_p (TREE_TYPE (TREE_TYPE (prevailing_node->decl)),
+ TREE_TYPE (TREE_TYPE (node->decl)), GTC_DIAG);
for (e = node->callers; e; e = next)
{
next = e->next_caller;
cgraph_redirect_edge_callee (e, prevailing_node);
+ /* If there is a mismatch between the supposed callee return type and
+ the real one do not attempt to inline this function.
+ ??? We really need a way to match function signatures for ABI
+ compatibility and perform related promotions at inlining time. */
+ if (!compatible_p)
+ e->call_stmt_cannot_inline_p = 1;
}
/* Redirect incomming references. */
ipa_clone_refering (prevailing_node, NULL, &node->ref_list);