Commit ecf9b8ae by Richard Guenther Committed by Richard Biener

re PR lto/43218 ([LTO] Conflicting function types cause ICE)

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.

From-SVN: r167122
parent 0d40d51c
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.
2010-11-24 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/46614
......@@ -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);
......
2010-11-24 Richard Guenther <rguenther@suse.de>
PR lto/43218
* gcc.dg/lto/20100423-1_0.c: Enable for all LTO modes.
2010-11-24 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/46614
......
/* { dg-lto-do run } */
/* { dg-lto-options {{-O2 -flto -flto-partition=none}} } */
struct bar {int x;};
extern struct bar foo(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment