diff options
author | Jan Hubicka <jh@suse.cz> | 2010-10-06 19:28:13 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2010-10-06 17:28:13 +0000 |
commit | 06ed016f032b8f66740c85d75955e8ea65ee6ca2 (patch) | |
tree | 647a3954144781838fdaa4adcdc62cbbe93e16c4 | |
parent | 0e9ea52bfcd9b8ab3994329154c48f19be7c0086 (diff) | |
download | gcc-06ed016f032b8f66740c85d75955e8ea65ee6ca2.zip gcc-06ed016f032b8f66740c85d75955e8ea65ee6ca2.tar.gz gcc-06ed016f032b8f66740c85d75955e8ea65ee6ca2.tar.bz2 |
lto.c (partition_cgraph_node_p, [...]): Handle COMDATs required by the linker.
* lto.c (partition_cgraph_node_p, partition_varpool_node_p): Handle
COMDATs required by the linker.
From-SVN: r165058
-rw-r--r-- | gcc/lto/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/lto/lto.c | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index a3f2fd8..0057fe3 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,8 @@ +2010-10-06 Jan Hubicka <jh@suse.cz> + + * lto.c (partition_cgraph_node_p, partition_varpool_node_p): Handle + COMDATs required by the linker. + 2010-10-05 Ian Lance Taylor <iant@google.com> * lto.c (lto_section_with_id): Make s a const pointer. diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 323b09a..ab90e85 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; } |