aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2015-12-27 14:33:19 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2015-12-27 13:33:19 +0000
commit71713fa639cb04dcfa44d22035c6e056b6393b00 (patch)
treec2f9b5e26278bf362e815a91bfb8ed6d1867f1f2
parent0b98ac42bfacd1e379d6bff5f6c6e7267bf74f84 (diff)
downloadgcc-71713fa639cb04dcfa44d22035c6e056b6393b00.zip
gcc-71713fa639cb04dcfa44d22035c6e056b6393b00.tar.gz
gcc-71713fa639cb04dcfa44d22035c6e056b6393b00.tar.bz2
ipa-visibility.c (function_and_variable_visibility): Do not dissolve comdat groups when in LTO mode.
* ipa-visibility.c (function_and_variable_visibility): Do not dissolve comdat groups when in LTO mode. From-SVN: r231965
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/ipa-visibility.c8
2 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 87c03cd..663beb7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2015-12-25 Jan Hubicka <hubicka@ucw.cz>
+
+ * ipa-visibility.c (function_and_variable_visibility): Do not
+ dissolve comdat groups when in LTO mode.
+
2015-12-25 Andreas Tobler <andreast@gcc.gnu.org>
* config/rs6000/freebsd64.h: Delete FREEBSD_DYNAMIC_LINKER32/64
diff --git a/gcc/ipa-visibility.c b/gcc/ipa-visibility.c
index 4b48d6e..1f8c2e8 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)
{