]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree.c (build_shared_int_cst): Make cache file scope, and GTY it.
authorNathan Sidwell <nathan@codesourcery.com>
Fri, 2 Aug 2002 17:21:34 +0000 (17:21 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Fri, 2 Aug 2002 17:21:34 +0000 (17:21 +0000)
* tree.c (build_shared_int_cst): Make cache file scope, and
GTY it.

From-SVN: r55992

gcc/cp/ChangeLog
gcc/cp/tree.c

index e4def020fb70a339900c0526b346edfbd149c041..24bec896b3578a64eb68e28c437f5783243d94eb 100644 (file)
@@ -1,3 +1,8 @@
+2002-08-02  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * tree.c (build_shared_int_cst): Make cache file scope, and
+       GTY it.
+
 2002-08-02  Jason Merrill  <jason@redhat.com>
 
        * cp-lang.c (LANG_HOOKS_EXPR_SIZE): Define.
index ea456f00b5fd52392724242016c9581f7c6731f3..e3ba4e104366bc03a1c972657ea542ddfbb53bfa 100644 (file)
@@ -1505,19 +1505,19 @@ build_min VPARAMS ((enum tree_code code, tree tt, ...))
    same node; therefore, callers should never modify the node
    returned.  */
 
+static GTY(()) tree shared_int_cache[256];
+
 tree
 build_shared_int_cst (i)
      int i;
 {
-  static tree cache[256];
-
   if (i >= 256)
     return build_int_2 (i, 0);
   
-  if (!cache[i])
-    cache[i] = build_int_2 (i, 0);
+  if (!shared_int_cache[i])
+    shared_int_cache[i] = build_int_2 (i, 0);
   
-  return cache[i];
+  return shared_int_cache[i];
 }
 
 tree