summaryrefslogtreecommitdiff
path: root/gcc/ipa-visibility.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-12-27 13:33:19 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-12-27 13:33:19 +0000
commit7b3390b4f06997177addab2c63c39a5bb5ce8eca (patch)
treec2f9b5e26278bf362e815a91bfb8ed6d1867f1f2 /gcc/ipa-visibility.c
parentbf9325f8610a4042de86441ce91fb1de4c0dca00 (diff)
downloadgcc-7b3390b4f06997177addab2c63c39a5bb5ce8eca.tar.gz
* ipa-visibility.c (function_and_variable_visibility): Do not
dissolve comdat groups when in LTO mode. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231965 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-visibility.c')
-rw-r--r--gcc/ipa-visibility.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/ipa-visibility.c b/gcc/ipa-visibility.c
index 4b48d6e5b8b..1f8c2e8db69 100644
--- a/gcc/ipa-visibility.c
+++ b/gcc/ipa-visibility.c
@@ -493,8 +493,12 @@ function_and_variable_visibility (bool whole_program)
DECL_COMDAT (node->decl) = 0;
/* For external decls stop tracking same_comdat_group. It doesn't matter
- what comdat group they are in when they won't be emitted in this TU. */
- if (node->same_comdat_group && DECL_EXTERNAL (node->decl))
+ what comdat group they are in when they won't be emitted in this TU.
+
+ An exception is LTO where we may end up with both external
+ and non-external declarations in the same comdat group in
+ the case declarations was not merged. */
+ if (node->same_comdat_group && DECL_EXTERNAL (node->decl) && !in_lto_p)
{
if (flag_checking)
{