aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-11-24 17:06:41 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-11-24 17:06:41 +0000
commitecf9b8aefcf233047b6afb3e1bdafb2ce015d880 (patch)
tree3cd1fcbc2eae962d1529f94d63558293153dcd3f /gcc
parent0d40d51cf5d58f791e23b201b5100c8db4063ad3 (diff)
downloadgcc-ecf9b8aefcf233047b6afb3e1bdafb2ce015d880.zip
gcc-ecf9b8aefcf233047b6afb3e1bdafb2ce015d880.tar.gz
gcc-ecf9b8aefcf233047b6afb3e1bdafb2ce015d880.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/lto-symtab.c10
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/lto/20100423-1_0.c1
4 files changed, 21 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d6cd569..7dfe5f4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+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
diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c
index b83c75e..4484d93 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);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index feae590..475df8f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+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
diff --git a/gcc/testsuite/gcc.dg/lto/20100423-1_0.c b/gcc/testsuite/gcc.dg/lto/20100423-1_0.c
index eb93165..1963c1f 100644
--- a/gcc/testsuite/gcc.dg/lto/20100423-1_0.c
+++ b/gcc/testsuite/gcc.dg/lto/20100423-1_0.c
@@ -1,5 +1,4 @@
/* { dg-lto-do run } */
-/* { dg-lto-options {{-O2 -flto -flto-partition=none}} } */
struct bar {int x;};
extern struct bar foo(void);