Commit 4fe52ce9 by Dale Johannesen Committed by Dale Johannesen

c-common.c (c_common_get_alias_set): Use GGC for type_hash_table.


2004-10-16  Dale Johannesen  <dalej@apple.com>

        * c-common.c (c_common_get_alias_set):  Use GGC for type_hash_table.

From-SVN: r89156
parent 410c47a4
2004-10-16 Dale Johannesen <dalej@apple.com>
* c-common.c (c_common_get_alias_set): Use GGC for type_hash_table.
2004-10-16 Zdenek Dvorak <dvorakz@suse.cz> 2004-10-16 Zdenek Dvorak <dvorakz@suse.cz>
PR tree-optimization/17766 PR tree-optimization/17766
......
...@@ -2592,6 +2592,8 @@ c_type_hash (const void *p) ...@@ -2592,6 +2592,8 @@ c_type_hash (const void *p)
return ((size << 24) | (i << shift)); return ((size << 24) | (i << shift));
} }
static GTY((param_is (union tree_node))) htab_t type_hash_table;
/* Return the typed-based alias set for T, which may be an expression /* Return the typed-based alias set for T, which may be an expression
or a type. Return -1 if we don't do anything special. */ or a type. Return -1 if we don't do anything special. */
...@@ -2600,7 +2602,6 @@ c_common_get_alias_set (tree t) ...@@ -2600,7 +2602,6 @@ c_common_get_alias_set (tree t)
{ {
tree u; tree u;
PTR *slot; PTR *slot;
static htab_t type_hash_table;
/* Permit type-punning when accessing a union, provided the access /* Permit type-punning when accessing a union, provided the access
is directly through the union. For example, this code does not is directly through the union. For example, this code does not
...@@ -2719,7 +2720,7 @@ c_common_get_alias_set (tree t) ...@@ -2719,7 +2720,7 @@ c_common_get_alias_set (tree t)
/* Look up t in hash table. Only one of the compatible types within each /* Look up t in hash table. Only one of the compatible types within each
alias set is recorded in the table. */ alias set is recorded in the table. */
if (!type_hash_table) if (!type_hash_table)
type_hash_table = htab_create (1021, c_type_hash, type_hash_table = htab_create_ggc (1021, c_type_hash,
(htab_eq) lang_hooks.types_compatible_p, (htab_eq) lang_hooks.types_compatible_p,
NULL); NULL);
slot = htab_find_slot (type_hash_table, t, INSERT); slot = htab_find_slot (type_hash_table, t, INSERT);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment