aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c70
1 files changed, 38 insertions, 32 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 8bf2b77..469555a 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -569,9 +569,9 @@ make_node_stat (enum tree_code code MEM_STAT_DECL)
#endif
if (code == IDENTIFIER_NODE)
- t = ggc_alloc_zone_pass_stat (length, &tree_id_zone);
+ t = (tree) ggc_alloc_zone_pass_stat (length, &tree_id_zone);
else
- t = ggc_alloc_zone_pass_stat (length, &tree_zone);
+ t = (tree) ggc_alloc_zone_pass_stat (length, &tree_zone);
memset (t, 0, length);
@@ -674,7 +674,7 @@ copy_node_stat (tree node MEM_STAT_DECL)
gcc_assert (code != STATEMENT_LIST);
length = tree_size (node);
- t = ggc_alloc_zone_pass_stat (length, &tree_zone);
+ t = (tree) ggc_alloc_zone_pass_stat (length, &tree_zone);
memcpy (t, node, length);
if (!GIMPLE_TUPLE_P (node))
@@ -928,7 +928,7 @@ build_int_cst_wide (tree type, unsigned HOST_WIDE_INT low, HOST_WIDE_INT hi)
TREE_TYPE (int_cst_node) = type;
slot = htab_find_slot (int_cst_hash_table, int_cst_node, INSERT);
- t = *slot;
+ t = (tree) *slot;
if (!t)
{
/* Insert this one into the hash table. */
@@ -1104,7 +1104,7 @@ build_fixed (tree type, FIXED_VALUE_TYPE f)
FIXED_VALUE_TYPE *fp;
v = make_node (FIXED_CST);
- fp = ggc_alloc (sizeof (FIXED_VALUE_TYPE));
+ fp = GGC_NEW (FIXED_VALUE_TYPE);
memcpy (fp, &f, sizeof (FIXED_VALUE_TYPE));
TREE_TYPE (v) = type;
@@ -1125,7 +1125,7 @@ build_real (tree type, REAL_VALUE_TYPE d)
Consider doing it via real_convert now. */
v = make_node (REAL_CST);
- dp = ggc_alloc (sizeof (REAL_VALUE_TYPE));
+ dp = GGC_NEW (REAL_VALUE_TYPE);
memcpy (dp, &d, sizeof (REAL_VALUE_TYPE));
TREE_TYPE (v) = type;
@@ -1274,7 +1274,7 @@ make_tree_binfo_stat (unsigned base_binfos MEM_STAT_DECL)
tree_node_sizes[(int) binfo_kind] += length;
#endif
- t = ggc_alloc_zone_pass_stat (length, &tree_zone);
+ t = (tree) ggc_alloc_zone_pass_stat (length, &tree_zone);
memset (t, 0, offsetof (struct tree_binfo, base_binfos));
@@ -1299,7 +1299,7 @@ make_tree_vec_stat (int len MEM_STAT_DECL)
tree_node_sizes[(int) vec_kind] += length;
#endif
- t = ggc_alloc_zone_pass_stat (length, &tree_zone);
+ t = (tree) ggc_alloc_zone_pass_stat (length, &tree_zone);
memset (t, 0, length);
@@ -1773,7 +1773,7 @@ tree_cons_stat (tree purpose, tree value, tree chain MEM_STAT_DECL)
{
tree node;
- node = ggc_alloc_zone_pass_stat (sizeof (struct tree_list), &tree_zone);
+ node = (tree) ggc_alloc_zone_pass_stat (sizeof (struct tree_list), &tree_zone);
memset (node, 0, sizeof (struct tree_common));
@@ -3097,7 +3097,7 @@ build1_stat (enum tree_code code, tree type, tree node MEM_STAT_DECL)
gcc_assert (TREE_CODE_LENGTH (code) == 1);
- t = ggc_alloc_zone_pass_stat (length, &tree_zone);
+ t = (tree) ggc_alloc_zone_pass_stat (length, &tree_zone);
memset (t, 0, sizeof (struct tree_common));
@@ -4275,7 +4275,8 @@ build_variant_type_copy (tree type)
int
tree_map_base_eq (const void *va, const void *vb)
{
- const struct tree_map_base *const a = va, *const b = vb;
+ const struct tree_map_base *const a = (const struct tree_map_base *) va,
+ *const b = (const struct tree_map_base *) vb;
return (a->from == b->from);
}
@@ -4313,7 +4314,7 @@ decl_init_priority_lookup (tree decl)
gcc_assert (VAR_OR_FUNCTION_DECL_P (decl));
in.from = decl;
- h = htab_find (init_priority_for_decl, &in);
+ h = (struct tree_priority_map *) htab_find (init_priority_for_decl, &in);
return h ? h->init : DEFAULT_INIT_PRIORITY;
}
@@ -4327,7 +4328,7 @@ decl_fini_priority_lookup (tree decl)
gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
in.from = decl;
- h = htab_find (init_priority_for_decl, &in);
+ h = (struct tree_priority_map *) htab_find (init_priority_for_decl, &in);
return h ? h->fini : DEFAULT_INIT_PRIORITY;
}
@@ -4344,7 +4345,7 @@ decl_priority_info (tree decl)
in.base.from = decl;
loc = htab_find_slot (init_priority_for_decl, &in, INSERT);
- h = *loc;
+ h = (struct tree_priority_map *) *loc;
if (!h)
{
h = GGC_CNEW (struct tree_priority_map);
@@ -4390,8 +4391,8 @@ decl_restrict_base_lookup (tree from)
struct tree_map in;
in.base.from = from;
- h = htab_find_with_hash (restrict_base_for_decl, &in,
- htab_hash_pointer (from));
+ h = (struct tree_map *) htab_find_with_hash (restrict_base_for_decl, &in,
+ htab_hash_pointer (from));
return h ? h->to : NULL_TREE;
}
@@ -4403,7 +4404,7 @@ decl_restrict_base_insert (tree from, tree to)
struct tree_map *h;
void **loc;
- h = ggc_alloc (sizeof (struct tree_map));
+ h = GGC_NEW (struct tree_map);
h->hash = htab_hash_pointer (from);
h->base.from = from;
h->to = to;
@@ -4455,7 +4456,8 @@ decl_debug_expr_lookup (tree from)
struct tree_map *h, in;
in.base.from = from;
- h = htab_find_with_hash (debug_expr_for_decl, &in, htab_hash_pointer (from));
+ h = (struct tree_map *) htab_find_with_hash (debug_expr_for_decl, &in,
+ htab_hash_pointer (from));
if (h)
return h->to;
return NULL_TREE;
@@ -4469,7 +4471,7 @@ decl_debug_expr_insert (tree from, tree to)
struct tree_map *h;
void **loc;
- h = ggc_alloc (sizeof (struct tree_map));
+ h = GGC_NEW (struct tree_map);
h->hash = htab_hash_pointer (from);
h->base.from = from;
h->to = to;
@@ -4485,7 +4487,8 @@ decl_value_expr_lookup (tree from)
struct tree_map *h, in;
in.base.from = from;
- h = htab_find_with_hash (value_expr_for_decl, &in, htab_hash_pointer (from));
+ h = (struct tree_map *) htab_find_with_hash (value_expr_for_decl, &in,
+ htab_hash_pointer (from));
if (h)
return h->to;
return NULL_TREE;
@@ -4499,7 +4502,7 @@ decl_value_expr_insert (tree from, tree to)
struct tree_map *h;
void **loc;
- h = ggc_alloc (sizeof (struct tree_map));
+ h = GGC_NEW (struct tree_map);
h->hash = htab_hash_pointer (from);
h->base.from = from;
h->to = to;
@@ -4534,7 +4537,8 @@ type_hash_list (const_tree list, hashval_t hashcode)
static int
type_hash_eq (const void *va, const void *vb)
{
- const struct type_hash *const a = va, *const b = vb;
+ const struct type_hash *const a = (const struct type_hash *) va,
+ *const b = (const struct type_hash *) vb;
/* First test the things that are the same for all types. */
if (a->hash != b->hash
@@ -4653,7 +4657,8 @@ type_hash_lookup (hashval_t hashcode, tree type)
in.hash = hashcode;
in.type = type;
- h = htab_find_with_hash (type_hash_table, &in, hashcode);
+ h = (struct type_hash *) htab_find_with_hash (type_hash_table, &in,
+ hashcode);
if (h)
return h->type;
return NULL_TREE;
@@ -4668,7 +4673,7 @@ type_hash_add (hashval_t hashcode, tree type)
struct type_hash *h;
void **loc;
- h = ggc_alloc (sizeof (struct type_hash));
+ h = GGC_NEW (struct type_hash);
h->hash = hashcode;
h->type = type;
loc = htab_find_slot_with_hash (type_hash_table, h, hashcode, INSERT);
@@ -6703,7 +6708,7 @@ get_file_function_name (const char *type)
file = input_filename;
len = strlen (file);
- q = alloca (9 * 2 + len + 1);
+ q = (char *) alloca (9 * 2 + len + 1);
memcpy (q, file, len + 1);
clean_symbol_name (q);
@@ -6713,7 +6718,8 @@ get_file_function_name (const char *type)
p = q;
}
- buf = alloca (sizeof (FILE_FUNCTION_FORMAT) + strlen (p) + strlen (type));
+ buf = (char *) alloca (sizeof (FILE_FUNCTION_FORMAT) + strlen (p)
+ + strlen (type));
/* Set up the name of the file-level functions we may need.
Use a global object (which is already required to be unique over
@@ -6749,7 +6755,7 @@ tree_check_failed (const_tree node, const char *file,
char *tmp;
va_start (args, function);
length += strlen ("expected ");
- buffer = tmp = alloca (length);
+ buffer = tmp = (char *) alloca (length);
length = 0;
while ((code = va_arg (args, int)))
{
@@ -6788,7 +6794,7 @@ tree_not_check_failed (const_tree node, const char *file,
length += 4 + strlen (tree_code_name[code]);
va_end (args);
va_start (args, function);
- buffer = alloca (length);
+ buffer = (char *) alloca (length);
length = 0;
while ((code = va_arg (args, int)))
{
@@ -6837,7 +6843,7 @@ tree_range_check_failed (const_tree node, const char *file, int line,
length += 4 + strlen (tree_code_name[c]);
length += strlen ("expected ");
- buffer = alloca (length);
+ buffer = (char *) alloca (length);
length = 0;
for (c = c1; c <= c2; ++c)
@@ -6898,7 +6904,7 @@ omp_clause_range_check_failed (const_tree node, const char *file, int line,
length += 4 + strlen (omp_clause_code_name[c]);
length += strlen ("expected ");
- buffer = alloca (length);
+ buffer = (char *) alloca (length);
length = 0;
for (c = c1; c <= c2; ++c)
@@ -7720,7 +7726,7 @@ build_omp_clause (enum omp_clause_code code)
length = omp_clause_num_ops[code];
size = (sizeof (struct tree_omp_clause) + (length - 1) * sizeof (tree));
- t = ggc_alloc (size);
+ t = GGC_NEWVAR (union tree_node, size);
memset (t, 0, size);
TREE_SET_CODE (t, OMP_CLAUSE);
OMP_CLAUSE_SET_CODE (t, code);
@@ -7787,7 +7793,7 @@ build_vl_exp_stat (enum tree_code code, int len MEM_STAT_DECL)
tree_node_sizes[(int) e_kind] += length;
#endif
- t = ggc_alloc_zone_pass_stat (length, &tree_zone);
+ t = (tree) ggc_alloc_zone_pass_stat (length, &tree_zone);
memset (t, 0, length);