re PR tree-optimization/21304 (very long compile times with large cpp file from kdebi...
authorAndrew Pinski <pinskia@physics.uc.edu>
Fri, 14 Oct 2005 03:01:42 +0000 (03:01 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Fri, 14 Oct 2005 03:01:42 +0000 (20:01 -0700)
2005-10-13  Andrew Pinski  <pinskia@physics.uc.edu>

        PR tree-opt/21304
        * tree-dfa.c (add_referenced_var): Only look at decls which
        have TREE_CONSTANT or TREE_READONLY set instead of if
        !TREE_PUBLIC or !TREE_CONSTANT.

From-SVN: r105390

gcc/ChangeLog
gcc/tree-dfa.c

index f30de32ba0e374d9f754399b969aa5df3a2f267c..c7b6f33b93baeef9b42445b38e7df494a1a65f2c 100644 (file)
@@ -1,3 +1,10 @@
+2005-10-13  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR tree-opt/21304
+       * tree-dfa.c (add_referenced_var): Only look at decls which
+       have TREE_CONSTANT or TREE_READONLY set instead of if
+       !TREE_PUBLIC or !TREE_CONSTANT.
+
 2005-10-13  James E Wilson  <wilson@specifix.com>
 
        * doc/invoke.texi: For -x, add f95-cpp-input.
index 866ac6e17c5525d39267bd67b32d6a99ef1f2dcb..9fc48d5cbe8c8fdb77941a46917763acb7aaf55f 100644 (file)
@@ -651,9 +651,9 @@ add_referenced_var (tree var, struct walk_state *walk_state)
             optimizers.  */
           && !DECL_EXTERNAL (var)
          /* It's not necessary to walk the initial value of non-constant
-            public variables because it cannot be propagated by the
+            variables because it cannot be propagated by the
             optimizers.  */
-         && (!TREE_PUBLIC (var) || !TREE_CONSTANT (var)))
+         && (TREE_CONSTANT (var) || TREE_READONLY (var)))
        walk_tree (&DECL_INITIAL (var), find_vars_r, walk_state, 0);
     }
 }