ipa-reference.c (add_static_var): Remove redundant all_module_statics check.
authorJan Hubicka <jh@suse.cz>
Fri, 28 May 2010 15:56:16 +0000 (17:56 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 28 May 2010 15:56:16 +0000 (15:56 +0000)
* ipa-reference.c (add_static_var): Remove redundant all_module_statics check.
(ipa_reference_write_optimization_summary): Call is_proper_for_analysis only
on local statics.

From-SVN: r159982

gcc/ChangeLog
gcc/ipa-reference.c

index a4903566b0fe08b69f03e1a8a506bd00a3c96ff4..dff48eee06ec285960b39ac3a94e4cf9bca347c1 100644 (file)
@@ -1,3 +1,9 @@
+2010-05-28  Jan Hubicka  <jh@suse.cz>
+
+       * ipa-reference.c (add_static_var): Remove redundant all_module_statics check.
+       (ipa_reference_write_optimization_summary): Call is_proper_for_analysis only
+       on local statics.
+
 2010-05-28  Iain Sandoe  <iains@gcc.gnu.org>
 
         * config.gcc (*-*-darwin*): Adjust t-make fragments for Darwin.
index bee05651de04d2e736a19a0583b7da8e6a85468e..2fc9bed2cabe0eddb8e4563a684df7737b166bb4 100644 (file)
@@ -239,13 +239,10 @@ add_static_var (tree var)
 {
   int uid = DECL_UID (var);
   gcc_assert (TREE_CODE (var) == VAR_DECL);
-  if (!bitmap_bit_p (all_module_statics, uid))
-    {
-      if (dump_file)
-       splay_tree_insert (reference_vars_to_consider,
-                          uid, (splay_tree_value)var);
-      bitmap_set_bit (all_module_statics, uid);
-    }
+  if (dump_file)
+    splay_tree_insert (reference_vars_to_consider,
+                      uid, (splay_tree_value)var);
+  bitmap_set_bit (all_module_statics, uid);
 }
 
 /* Return true if the variable T is the right kind of static variable to
@@ -962,15 +959,15 @@ ipa_reference_write_optimization_summary (cgraph_node_set set,
 
   /* See what variables we are interested in.  */
   for (vnode = varpool_nodes; vnode; vnode = vnode->next)
-    if (referenced_from_this_partition_p (&vnode->ref_list, set, vset))
+    if (!vnode->externally_visible
+       && vnode->analyzed
+       && is_proper_for_analysis (vnode->decl)
+       && referenced_from_this_partition_p (&vnode->ref_list, set, vset))
       {
        tree decl = vnode->decl;
-       if (is_proper_for_analysis (decl))
-         {
-           bitmap_set_bit (ltrans_statics, DECL_UID (decl));
-           splay_tree_insert (reference_vars_to_consider,
-                              DECL_UID (decl), (splay_tree_value)decl);
-         }
+       bitmap_set_bit (ltrans_statics, DECL_UID (decl));
+       splay_tree_insert (reference_vars_to_consider,
+                          DECL_UID (decl), (splay_tree_value)decl);
       }
 
   for (node = cgraph_nodes; node; node = node->next)