aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2002-08-02 17:21:34 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2002-08-02 17:21:34 +0000
commit41ab2ae207ddb60bb5b4966b6f45cc3f0017ba2d (patch)
treeb00e3f0ca70c58d1a47d5a3ffa0478032c7e53de /gcc
parent055dd007b341fdc4e5eaf579ed0e49952838f5ce (diff)
downloadgcc-41ab2ae207ddb60bb5b4966b6f45cc3f0017ba2d.zip
gcc-41ab2ae207ddb60bb5b4966b6f45cc3f0017ba2d.tar.gz
gcc-41ab2ae207ddb60bb5b4966b6f45cc3f0017ba2d.tar.bz2
tree.c (build_shared_int_cst): Make cache file scope, and GTY it.
* tree.c (build_shared_int_cst): Make cache file scope, and GTY it. From-SVN: r55992
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/tree.c10
2 files changed, 10 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e4def02..24bec89 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index ea456f0..e3ba4e1 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -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