cgraph.c (cgraph_make_decl_local): Handle DECL_ONE_ONLY similarly to DECL_COMDAT.
authorJan Hubicka <jh@suse.cz>
Tue, 14 Jun 2011 12:48:06 +0000 (14:48 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 14 Jun 2011 12:48:06 +0000 (12:48 +0000)
* cgraph.c (cgraph_make_decl_local): Handle DECL_ONE_ONLY
similarly to DECL_COMDAT.
* cgraphunit.c (cgraph_analyze_function): Likewise.
* ipa.c (function_and_variable_visibility): Likewise.

From-SVN: r175015

gcc/ChangeLog
gcc/cgraph.c
gcc/cgraphunit.c
gcc/ipa.c

index fdfe9c4837b986688f919791b89eee11ad9ba73a..c1f7568d541286a2376a59579f560a2c64428e13 100644 (file)
@@ -1,3 +1,10 @@
+2011-06-13  Jan Hubicka  <jh@suse.cz>
+
+       * cgraph.c (cgraph_make_decl_local): Handle DECL_ONE_ONLY
+       similarly to DECL_COMDAT.
+       * cgraphunit.c (cgraph_analyze_function): Likewise.
+       * ipa.c (function_and_variable_visibility): Likewise.
+
 2011-06-13  Jan Hubicka  <jh@suse.cz>
 
        * lto-streamer-out.c (lto_output_ts_binfo_tree_pointers): Do not output
index dfa5439ad9638d011c04aebe9c832b58ddc2b92f..86e72072eabfbddeef974997a37fb8a01282e9b3 100644 (file)
@@ -2487,7 +2487,7 @@ cgraph_make_decl_local (tree decl)
     DECL_COMMON (decl) = 0;
   else gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
 
-  if (DECL_COMDAT (decl))
+  if (DECL_ONE_ONLY (decl) || DECL_COMDAT (decl))
     {
       /* It is possible that we are linking against library defining same COMDAT
         function.  To avoid conflict we need to rename our local name of the
index b01f22b2b23ecab17bd67f7f106ed8c235b441b0..0e7842cd896f9d27f8ed7ea4a7bc6ddc85f437b4 100644 (file)
@@ -830,9 +830,9 @@ cgraph_analyze_function (struct cgraph_node *node)
       if (TREE_PUBLIC (node->decl) && node->same_body_alias)
        {
           DECL_EXTERNAL (node->decl) = DECL_EXTERNAL (node->thunk.alias);
-         if (DECL_COMDAT (node->thunk.alias))
+         if (DECL_ONE_ONLY (node->thunk.alias))
            {
-             DECL_COMDAT (node->decl) = 1;
+             DECL_COMDAT (node->decl) = DECL_COMDAT (node->thunk.alias);
              DECL_COMDAT_GROUP (node->decl) = DECL_COMDAT_GROUP (node->thunk.alias);
              if (DECL_ONE_ONLY (node->thunk.alias) && !node->same_comdat_group)
                {
index 07a90b51203fecccd3aea813f66a82cded1d9440..0edb344c5e577bc352db19201f149b756e0ca01a 100644 (file)
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -904,9 +904,9 @@ function_and_variable_visibility (bool whole_program)
 
             We also need to arrange the thunk into the same comdat group as
             the function it reffers to.  */
-         if (DECL_COMDAT (decl_node->decl))
+         if (DECL_ONE_ONLY (decl_node->decl))
            {
-             DECL_COMDAT (node->decl) = 1;
+             DECL_COMDAT (node->decl) = DECL_COMDAT (decl_node->decl);
              DECL_COMDAT_GROUP (node->decl) = DECL_COMDAT_GROUP (decl_node->decl);
              if (DECL_ONE_ONLY (decl_node->decl) && !node->same_comdat_group)
                {