summaryrefslogtreecommitdiff
path: root/gcc/lto/lto.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-06 17:28:13 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-06 17:28:13 +0000
commit7ad28d2a64ea66472357334d8da9957057480cd2 (patch)
tree647a3954144781838fdaa4adcdc62cbbe93e16c4 /gcc/lto/lto.c
parent1032532303ae44256a7318389cd666c52e8e13d8 (diff)
downloadgcc-7ad28d2a64ea66472357334d8da9957057480cd2.tar.gz
* lto.c (partition_cgraph_node_p, partition_varpool_node_p): Handle
COMDATs required by the linker. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165058 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto/lto.c')
-rw-r--r--gcc/lto/lto.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index 323b09a9855..ab90e85ed41 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -839,7 +839,8 @@ partition_cgraph_node_p (struct cgraph_node *node)
return false;
/* Extern inlines and comdat are always only in partitions they are needed. */
if (DECL_EXTERNAL (node->decl)
- || DECL_COMDAT (node->decl))
+ || (DECL_COMDAT (node->decl)
+ && !cgraph_used_from_object_file_p (node)))
return false;
return true;
}
@@ -854,7 +855,8 @@ partition_varpool_node_p (struct varpool_node *vnode)
return false;
/* Constant pool and comdat are always only in partitions they are needed. */
if (DECL_IN_CONSTANT_POOL (vnode->decl)
- || DECL_COMDAT (vnode->decl))
+ || (DECL_COMDAT (vnode->decl)
+ && !varpool_used_from_object_file_p (vnode)))
return false;
return true;
}