]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ipa-visibility.c (function_and_variable_visibility): Do not dissolve comdat groups...
authorJan Hubicka <hubicka@ucw.cz>
Sun, 27 Dec 2015 13:33:19 +0000 (14:33 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sun, 27 Dec 2015 13:33:19 +0000 (13:33 +0000)
* ipa-visibility.c (function_and_variable_visibility): Do not
dissolve comdat groups when in LTO mode.

From-SVN: r231965

gcc/ChangeLog
gcc/ipa-visibility.c

index 87c03cdf16d8b6faaf68af9e4cc66c99b26129c2..663beb7cce0a571ad4be3d8dc89d5c654d8e485d 100644 (file)
@@ -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
index 4b48d6e5b8b2371be8796b2130f7a2ee71d34186..1f8c2e8db6928e9a28b902a4d189cf12224e4143 100644 (file)
@@ -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)
            {