ggc.h (GGC_RESIZEVAR): New, reorder macros.

* ggc.h (GGC_RESIZEVAR): New, reorder macros.
	* tracer.c (tail_duplicate): Fix for -Wc++-compat.
	* tree-affine.c (aff_combination_expand, free_name_expansion):
	Likewise.
	* tree-cfg.c (replace_by_duplicate_decl, replace_ssa_name,
	move_stmt_r, new_label_mapper): Likewise.
	* tree-complex.c (cvc_lookup): Likewise.
	* tree-dfa.c (create_function_ann): Likewise.
	* tree-dump.c (dump_register): Likewise.
	* tree-if-conv.c (tree_if_conversion, add_to_predicate_list,
	find_phi_replacement_condition): Likewise.
	* tree-inline.c (copy_phis_for_bb, estimate_num_insns_1,
	tree_function_versioning): Likewise.
	* tree-into-ssa.c (cmp_dfsnum): Likewise.
	* tree-iterator.c (tsi_link_before, tsi_link_after): Likewise.
	* tree-nested.c (lookup_field_for_decl, lookup_tramp_for_decl,
	get_nonlocal_debug_decl, convert_nonlocal_reference,
	convert_nonlocal_omp_clauses, get_local_debug_decl,
	convert_local_reference, convert_local_omp_clauses,
	convert_nl_goto_reference, convert_nl_goto_receiver,
	convert_tramp_reference, convert_call_expr): Likewise.
	* tree-outof-ssa.c (contains_tree_r): Likewise.
	* tree-parloops.c (reduction_phi, initialize_reductions,
	eliminate_local_variables_1, add_field_for_reduction,
	add_field_for_name, create_phi_for_local_result,
	create_call_for_reduction_1, create_loads_for_reductions,
	create_stores_for_reduction, create_loads_and_stores_for_name):
	Likewise.
	* tree-phinodes.c (allocate_phi_node): Likewise.
	* tree-predcom.c (order_drefs, execute_pred_commoning_cbck):
	Likewise.
	* tree-sra.c (sra_elt_hash, sra_elt_eq, lookup_element):
	Likewise.
	* tree-ssa-alias.c (get_mem_sym_stats_for): Likewise.
	* tree-ssa-coalesce.c (compare_pairs): Likewise.
	* tree-ssa-loop-im.c (mem_ref_in_stmt, memref_hash, memref_eq,
	memref_free, gather_mem_refs_stmt, vtoe_hash, vtoe_eq, vtoe_free,
	record_vop_access, get_vop_accesses, get_vop_stores): Likewise.
	* tree-ssa-loop-prefetch.c (determine_loop_nest_reuse): Likewise. 
	* tree-ssa-sccvn.c (VN_INFO_GET, free_phi, free_reference,
	vn_nary_op_insert): Likewise.
	* tree-ssa.c (redirect_edge_var_map_add,
	redirect_edge_var_map_clear, redirect_edge_var_map_dup): Likewise.
	* tree-vectorizer.c (vectorize_loops): Likewise.
	* tree.c (make_node_stat, copy_node_stat, build_int_cst_wide,
	build_fixed, build_real, make_tree_binfo_stat, make_tree_vec_stat,
	tree_cons_stat, build1_stat, build_variant_type_copy,
	decl_init_priority_lookup, decl_fini_priority_lookup,
	decl_priority_info, decl_restrict_base_lookup,
	decl_restrict_base_insert, decl_debug_expr_lookup,
	decl_debug_expr_insert, decl_value_expr_lookup,
	decl_value_expr_insert, type_hash_eq, type_hash_lookup,
	type_hash_add, get_file_function_name, tree_check_failed,
	tree_not_check_failed, tree_range_check_failed,
	omp_clause_range_check_failed, build_omp_clause,
	build_vl_exp_stat): Likewise.
	* value-prof.c (gimple_histogram_value,
	gimple_duplicate_stmt_histograms): Likewise.
	* var-tracking.c (attrs_list_insert, attrs_list_copy,
	unshare_variable, variable_union_info_cmp_pos, variable_union,
	dataflow_set_different_1, dataflow_set_different_2,
	vt_find_locations, variable_was_changed, set_variable_part,
	emit_notes_for_differences_1, emit_notes_for_differences_2):
	Likewise.
	* varasm.c (prefix_name, emutls_decl, section_entry_eq,
	section_entry_hash, object_block_entry_eq,
	object_block_entry_hash, create_block_symbol,
	initialize_cold_section_name, default_function_rodata_section,
	strip_reg_name, set_user_assembler_name, const_desc_eq,
	build_constant_desc, output_constant_def, lookup_constant_def,
	const_desc_rtx_hash, const_desc_rtx_eq, const_rtx_hash_1,
	create_constant_pool, force_const_mem, compute_reloc_for_rtx_1,
	default_internal_label): Likewise.
	* varray.c (varray_init, varray_grow): Likewise.
	* vec.c (vec_gc_o_reserve_1, vec_heap_o_reserve_1): Likewise.

From-SVN: r136992
This commit is contained in:
Kaveh R. Ghazi 2008-06-20 18:34:07 +00:00 committed by Kaveh Ghazi
parent 952137502b
commit 3d9a9f947f
31 changed files with 287 additions and 185 deletions

View File

@ -1,3 +1,81 @@
2008-06-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* ggc.h (GGC_RESIZEVAR): New, reorder macros.
* tracer.c (tail_duplicate): Fix for -Wc++-compat.
* tree-affine.c (aff_combination_expand, free_name_expansion):
Likewise.
* tree-cfg.c (replace_by_duplicate_decl, replace_ssa_name,
move_stmt_r, new_label_mapper): Likewise.
* tree-complex.c (cvc_lookup): Likewise.
* tree-dfa.c (create_function_ann): Likewise.
* tree-dump.c (dump_register): Likewise.
* tree-if-conv.c (tree_if_conversion, add_to_predicate_list,
find_phi_replacement_condition): Likewise.
* tree-inline.c (copy_phis_for_bb, estimate_num_insns_1,
tree_function_versioning): Likewise.
* tree-into-ssa.c (cmp_dfsnum): Likewise.
* tree-iterator.c (tsi_link_before, tsi_link_after): Likewise.
* tree-nested.c (lookup_field_for_decl, lookup_tramp_for_decl,
get_nonlocal_debug_decl, convert_nonlocal_reference,
convert_nonlocal_omp_clauses, get_local_debug_decl,
convert_local_reference, convert_local_omp_clauses,
convert_nl_goto_reference, convert_nl_goto_receiver,
convert_tramp_reference, convert_call_expr): Likewise.
* tree-outof-ssa.c (contains_tree_r): Likewise.
* tree-parloops.c (reduction_phi, initialize_reductions,
eliminate_local_variables_1, add_field_for_reduction,
add_field_for_name, create_phi_for_local_result,
create_call_for_reduction_1, create_loads_for_reductions,
create_stores_for_reduction, create_loads_and_stores_for_name):
Likewise.
* tree-phinodes.c (allocate_phi_node): Likewise.
* tree-predcom.c (order_drefs, execute_pred_commoning_cbck):
Likewise.
* tree-sra.c (sra_elt_hash, sra_elt_eq, lookup_element):
Likewise.
* tree-ssa-alias.c (get_mem_sym_stats_for): Likewise.
* tree-ssa-coalesce.c (compare_pairs): Likewise.
* tree-ssa-loop-im.c (mem_ref_in_stmt, memref_hash, memref_eq,
memref_free, gather_mem_refs_stmt, vtoe_hash, vtoe_eq, vtoe_free,
record_vop_access, get_vop_accesses, get_vop_stores): Likewise.
* tree-ssa-loop-prefetch.c (determine_loop_nest_reuse): Likewise.
* tree-ssa-sccvn.c (VN_INFO_GET, free_phi, free_reference,
vn_nary_op_insert): Likewise.
* tree-ssa.c (redirect_edge_var_map_add,
redirect_edge_var_map_clear, redirect_edge_var_map_dup): Likewise.
* tree-vectorizer.c (vectorize_loops): Likewise.
* tree.c (make_node_stat, copy_node_stat, build_int_cst_wide,
build_fixed, build_real, make_tree_binfo_stat, make_tree_vec_stat,
tree_cons_stat, build1_stat, build_variant_type_copy,
decl_init_priority_lookup, decl_fini_priority_lookup,
decl_priority_info, decl_restrict_base_lookup,
decl_restrict_base_insert, decl_debug_expr_lookup,
decl_debug_expr_insert, decl_value_expr_lookup,
decl_value_expr_insert, type_hash_eq, type_hash_lookup,
type_hash_add, get_file_function_name, tree_check_failed,
tree_not_check_failed, tree_range_check_failed,
omp_clause_range_check_failed, build_omp_clause,
build_vl_exp_stat): Likewise.
* value-prof.c (gimple_histogram_value,
gimple_duplicate_stmt_histograms): Likewise.
* var-tracking.c (attrs_list_insert, attrs_list_copy,
unshare_variable, variable_union_info_cmp_pos, variable_union,
dataflow_set_different_1, dataflow_set_different_2,
vt_find_locations, variable_was_changed, set_variable_part,
emit_notes_for_differences_1, emit_notes_for_differences_2):
Likewise.
* varasm.c (prefix_name, emutls_decl, section_entry_eq,
section_entry_hash, object_block_entry_eq,
object_block_entry_hash, create_block_symbol,
initialize_cold_section_name, default_function_rodata_section,
strip_reg_name, set_user_assembler_name, const_desc_eq,
build_constant_desc, output_constant_def, lookup_constant_def,
const_desc_rtx_hash, const_desc_rtx_eq, const_rtx_hash_1,
create_constant_pool, force_const_mem, compute_reloc_for_rtx_1,
default_internal_label): Likewise.
* varray.c (varray_init, varray_grow): Likewise.
* vec.c (vec_gc_o_reserve_1, vec_heap_o_reserve_1): Likewise.
2008-06-20 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (*jcc_fused_1): Handle all valid compare

View File

@ -237,9 +237,10 @@ extern void dump_ggc_loc_statistics (bool);
#define GGC_CNEW(T) ((T *) ggc_alloc_cleared (sizeof (T)))
#define GGC_NEWVEC(T, N) ((T *) ggc_alloc ((N) * sizeof(T)))
#define GGC_CNEWVEC(T, N) ((T *) ggc_alloc_cleared ((N) * sizeof(T)))
#define GGC_RESIZEVEC(T, P, N) ((T *) ggc_realloc ((P), (N) * sizeof (T)))
#define GGC_NEWVAR(T, S) ((T *) ggc_alloc ((S)))
#define GGC_CNEWVAR(T, S) ((T *) ggc_alloc_cleared ((S)))
#define GGC_RESIZEVEC(T, P, N) ((T *) ggc_realloc ((P), (N) * sizeof (T)))
#define GGC_RESIZEVAR(T, P, N) ((T *) ggc_realloc ((P), (N)))
#define ggc_alloc_rtvec(NELT) \
((rtvec) ggc_alloc_zone (sizeof (struct rtvec_def) + ((NELT) - 1) \

View File

@ -265,7 +265,7 @@ tail_duplicate (void)
while (traced_insns < cover_insns && nduplicated < max_dup_insns
&& !fibheap_empty (heap))
{
basic_block bb = fibheap_extract_min (heap);
basic_block bb = (basic_block) fibheap_extract_min (heap);
int n, pos;
if (!bb)

View File

@ -609,7 +609,7 @@ aff_combination_expand (aff_tree *comb, struct pointer_map_t **cache)
if (!*cache)
*cache = pointer_map_create ();
slot = pointer_map_insert (*cache, e);
exp = *slot;
exp = (struct name_expansion *) *slot;
if (!exp)
{
@ -690,7 +690,7 @@ static bool
free_name_expansion (const void *key ATTRIBUTE_UNUSED, void **value,
void *data ATTRIBUTE_UNUSED)
{
struct name_expansion *exp = *value;
struct name_expansion *const exp = (struct name_expansion *) *value;
free (exp);
return true;

View File

@ -5622,7 +5622,7 @@ replace_by_duplicate_decl (tree *tp, struct pointer_map_t *vars_map,
*loc = new_t;
}
else
new_t = *loc;
new_t = (tree) *loc;
*tp = new_t;
}
@ -5658,7 +5658,7 @@ replace_ssa_name (tree name, struct pointer_map_t *vars_map,
*loc = new_name;
}
else
new_name = *loc;
new_name = (tree) *loc;
return new_name;
}
@ -5713,7 +5713,8 @@ move_stmt_r (tree *tp, int *walk_subtrees, void *data)
{
struct tree_map in, *out;
in.base.from = t;
out = htab_find_with_hash (p->new_label_map, &in, DECL_UID (t));
out = (struct tree_map *)
htab_find_with_hash (p->new_label_map, &in, DECL_UID (t));
if (out)
*tp = t = out->to;
}
@ -5972,7 +5973,7 @@ new_label_mapper (tree decl, void *data)
gcc_assert (TREE_CODE (decl) == LABEL_DECL);
m = xmalloc (sizeof (struct tree_map));
m = XNEW (struct tree_map);
m->hash = DECL_UID (decl);
m->base.from = decl;
m->to = create_artificial_label ();

View File

@ -66,7 +66,7 @@ cvc_lookup (unsigned int uid)
{
struct int_tree_map *h, in;
in.uid = uid;
h = htab_find_with_hash (complex_variable_components, &in, uid);
h = (struct int_tree_map *) htab_find_with_hash (complex_variable_components, &in, uid);
return h ? h->to : NULL;
}

View File

@ -166,7 +166,7 @@ create_function_ann (tree t)
gcc_assert (TREE_CODE (t) == FUNCTION_DECL);
gcc_assert (!t->base.ann || t->base.ann->common.type == FUNCTION_ANN);
ann = ggc_alloc (sizeof (*ann));
ann = (function_ann_t) ggc_alloc (sizeof (*ann));
memset ((void *) ann, 0, sizeof (*ann));
ann->common.type = FUNCTION_ANN;

View File

@ -843,9 +843,9 @@ dump_register (const char *suffix, const char *swtch, const char *glob,
extra_dump_files_alloced = 32;
else
extra_dump_files_alloced *= 2;
extra_dump_files = xrealloc (extra_dump_files,
sizeof (struct dump_file_info)
* extra_dump_files_alloced);
extra_dump_files = XRESIZEVEC (struct dump_file_info,
extra_dump_files,
extra_dump_files_alloced);
}
memset (&extra_dump_files[this], 0, sizeof (struct dump_file_info));

View File

@ -171,7 +171,7 @@ tree_if_conversion (struct loop *loop, bool for_vectorizer)
bb = ifc_bbs [i];
/* Update condition using predicate list. */
cond = bb->aux;
cond = (tree) bb->aux;
/* Process all statements in this basic block.
Remove conditional expression, if any, and annotate
@ -620,7 +620,7 @@ if_convertible_loop_p (struct loop *loop, bool for_vectorizer ATTRIBUTE_UNUSED)
static void
add_to_predicate_list (basic_block bb, tree new_cond)
{
tree cond = bb->aux;
tree cond = (tree) bb->aux;
if (cond)
cond = fold_build2 (TRUTH_OR_EXPR, boolean_type_node,
@ -737,7 +737,7 @@ find_phi_replacement_condition (struct loop *loop,
See PR23115. */
/* Select condition that is not TRUTH_NOT_EXPR. */
tmp_cond = (first_edge->src)->aux;
tmp_cond = (tree) (first_edge->src)->aux;
gcc_assert (tmp_cond);
if (TREE_CODE (tmp_cond) == TRUTH_NOT_EXPR)
@ -755,13 +755,13 @@ find_phi_replacement_condition (struct loop *loop,
|| dominated_by_p (CDI_DOMINATORS,
second_edge->src, first_edge->src))
{
*cond = (second_edge->src)->aux;
*cond = (tree) (second_edge->src)->aux;
/* If there is a condition on an incoming edge,
AND it with the incoming bb predicate. */
if (second_edge->aux)
*cond = build2 (TRUTH_AND_EXPR, boolean_type_node,
*cond, second_edge->aux);
*cond, (tree) second_edge->aux);
if (TREE_CODE (*cond) == TRUTH_NOT_EXPR)
/* We can be smart here and choose inverted
@ -774,13 +774,13 @@ find_phi_replacement_condition (struct loop *loop,
else
{
/* FIRST_BB is not loop header */
*cond = (first_edge->src)->aux;
*cond = (tree) (first_edge->src)->aux;
/* If there is a condition on an incoming edge,
AND it with the incoming bb predicate. */
if (first_edge->aux)
*cond = build2 (TRUTH_AND_EXPR, boolean_type_node,
*cond, first_edge->aux);
*cond, (tree) first_edge->aux);
}
/* Create temp. for the condition. Vectorizer prefers to have gimple

View File

@ -1201,7 +1201,7 @@ copy_edges_for_bb (basic_block bb, gcov_type count_scale, basic_block ret_bb)
static void
copy_phis_for_bb (basic_block bb, copy_body_data *id)
{
basic_block new_bb = bb->aux;
basic_block const new_bb = (basic_block) bb->aux;
edge_iterator ei;
tree phi;
@ -1219,7 +1219,7 @@ copy_phis_for_bb (basic_block bb, copy_body_data *id)
= new_phi = create_phi_node (new_res, new_bb);
FOR_EACH_EDGE (new_edge, ei, new_bb->preds)
{
edge old_edge = find_edge (new_edge->src->aux, bb);
edge const old_edge = find_edge ((basic_block) new_edge->src->aux, bb);
tree arg = PHI_ARG_DEF_FROM_EDGE (phi, old_edge);
tree new_arg = arg;
@ -2173,7 +2173,7 @@ struct eni_data
static tree
estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data)
{
struct eni_data *d = data;
struct eni_data *const d = (struct eni_data *) data;
tree x = *tp;
unsigned cost;
@ -3589,7 +3589,7 @@ tree_function_versioning (tree old_decl, tree new_decl, varray_type tree_map,
if (tree_map)
for (i = 0; i < VARRAY_ACTIVE_SIZE (tree_map); i++)
{
replace_info = VARRAY_GENERIC_PTR (tree_map, i);
replace_info = (struct ipa_replace_map *) VARRAY_GENERIC_PTR (tree_map, i);
if (replace_info->replace_p)
insert_decl_map (&id, replace_info->old_tree,
replace_info->new_tree);

View File

@ -787,8 +787,8 @@ struct dom_dfsnum
static int
cmp_dfsnum (const void *a, const void *b)
{
const struct dom_dfsnum *da = a;
const struct dom_dfsnum *db = b;
const struct dom_dfsnum *const da = (const struct dom_dfsnum *) a;
const struct dom_dfsnum *const db = (const struct dom_dfsnum *) b;
return (int) da->dfs_num - (int) db->dfs_num;
}

View File

@ -89,7 +89,7 @@ tsi_link_before (tree_stmt_iterator *i, tree t, enum tsi_iterator_update mode)
}
else
{
head = ggc_alloc (sizeof (*head));
head = GGC_NEW (struct tree_statement_list_node);
head->prev = NULL;
head->next = NULL;
head->stmt = t;
@ -165,7 +165,7 @@ tsi_link_after (tree_stmt_iterator *i, tree t, enum tsi_iterator_update mode)
}
else
{
head = ggc_alloc (sizeof (*head));
head = GGC_NEW (struct tree_statement_list_node);
head->prev = NULL;
head->next = NULL;
head->stmt = t;

View File

@ -258,7 +258,7 @@ lookup_field_for_decl (struct nesting_info *info, tree decl,
if (insert == NO_INSERT)
{
slot = pointer_map_contains (info->field_map, decl);
return slot ? *slot : NULL;
return slot ? (tree) *slot : NULL_TREE;
}
slot = pointer_map_insert (info->field_map, decl);
@ -291,7 +291,7 @@ lookup_field_for_decl (struct nesting_info *info, tree decl,
info->any_parm_remapped = true;
}
return *slot;
return (tree) *slot;
}
/* Build or return the variable that holds the static chain within
@ -450,7 +450,7 @@ lookup_tramp_for_decl (struct nesting_info *info, tree decl,
if (insert == NO_INSERT)
{
slot = pointer_map_contains (info->var_map, decl);
return slot ? *slot : NULL;
return slot ? (tree) *slot : NULL_TREE;
}
slot = pointer_map_insert (info->var_map, decl);
@ -467,7 +467,7 @@ lookup_tramp_for_decl (struct nesting_info *info, tree decl,
info->any_tramp_created = true;
}
return *slot;
return (tree) *slot;
}
/* Build or return the field within the non-local frame state that holds
@ -896,7 +896,7 @@ get_nonlocal_debug_decl (struct nesting_info *info, tree decl)
slot = pointer_map_insert (info->var_map, decl);
if (*slot)
return *slot;
return (tree) *slot;
target_context = decl_function_context (decl);
@ -961,7 +961,7 @@ static tree
convert_nonlocal_reference (tree *tp, int *walk_subtrees, void *data)
{
struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
struct nesting_info *info = wi->info;
struct nesting_info *const info = (struct nesting_info *) wi->info;
tree t = *tp;
tree save_local_var_chain;
bitmap save_suppress;
@ -1053,7 +1053,8 @@ convert_nonlocal_reference (tree *tp, int *walk_subtrees, void *data)
where we only accept variables (and min_invariant, presumably),
then compute the address into a temporary. */
if (save_val_only)
*tp = tsi_gimplify_val (wi->info, t, &wi->tsi);
*tp = tsi_gimplify_val ((struct nesting_info *) wi->info,
t, &wi->tsi);
}
}
break;
@ -1165,7 +1166,7 @@ convert_nonlocal_reference (tree *tp, int *walk_subtrees, void *data)
static bool
convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
{
struct nesting_info *info = wi->info;
struct nesting_info *const info = (struct nesting_info *) wi->info;
bool need_chain = false, need_stmts = false;
tree clause, decl;
int dummy;
@ -1277,7 +1278,7 @@ get_local_debug_decl (struct nesting_info *info, tree decl, tree field)
slot = pointer_map_insert (info->var_map, decl);
if (*slot)
return *slot;
return (tree) *slot;
/* Make sure frame_decl gets created. */
(void) get_frame_type (info);
@ -1318,7 +1319,7 @@ static tree
convert_local_reference (tree *tp, int *walk_subtrees, void *data)
{
struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
struct nesting_info *info = wi->info;
struct nesting_info *const info = (struct nesting_info *) wi->info;
tree t = *tp, field, x;
bool save_val_only;
tree save_local_var_chain;
@ -1388,7 +1389,7 @@ convert_local_reference (tree *tp, int *walk_subtrees, void *data)
/* If we are in a context where we only accept values, then
compute the address into a temporary. */
if (save_val_only)
*tp = tsi_gimplify_val (wi->info, t, &wi->tsi);
*tp = tsi_gimplify_val ((struct nesting_info *)wi->info, t, &wi->tsi);
}
break;
@ -1501,7 +1502,7 @@ convert_local_reference (tree *tp, int *walk_subtrees, void *data)
static bool
convert_local_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
{
struct nesting_info *info = wi->info;
struct nesting_info *const info = (struct nesting_info *) wi->info;
bool need_frame = false, need_stmts = false;
tree clause, decl;
int dummy;
@ -1613,7 +1614,7 @@ static tree
convert_nl_goto_reference (tree *tp, int *walk_subtrees, void *data)
{
struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
struct nesting_info *info = wi->info, *i;
struct nesting_info *const info = (struct nesting_info *) wi->info, *i;
tree t = *tp, label, new_label, target_context, x, field;
void **slot;
@ -1645,7 +1646,7 @@ convert_nl_goto_reference (tree *tp, int *walk_subtrees, void *data)
*slot = new_label;
}
else
new_label = *slot;
new_label = (tree) *slot;
/* Build: __builtin_nl_goto(new_label, &chain->nl_goto_field). */
field = get_nl_goto_field (i);
@ -1671,7 +1672,7 @@ static tree
convert_nl_goto_receiver (tree *tp, int *walk_subtrees, void *data)
{
struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
struct nesting_info *info = wi->info;
struct nesting_info *const info = (struct nesting_info *) wi->info;
tree t = *tp, label, new_label, x;
tree_stmt_iterator tmp_tsi;
void **slot;
@ -1710,7 +1711,7 @@ static tree
convert_tramp_reference (tree *tp, int *walk_subtrees, void *data)
{
struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
struct nesting_info *info = wi->info, *i;
struct nesting_info *const info = (struct nesting_info *) wi->info, *i;
tree t = *tp, decl, target_context, x;
*walk_subtrees = 0;
@ -1793,7 +1794,7 @@ static tree
convert_call_expr (tree *tp, int *walk_subtrees, void *data)
{
struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
struct nesting_info *info = wi->info;
struct nesting_info *const info = (struct nesting_info *) wi->info;
tree t = *tp, decl, target_context;
char save_static_chain_added;
int i;

View File

@ -881,7 +881,7 @@ contains_tree_r (tree * tp, int *walk_subtrees, void *data)
if (*tp == data)
{
*walk_subtrees = 0;
return data;
return (tree) data;
}
else
return NULL_TREE;

View File

@ -208,7 +208,7 @@ reduction_phi (htab_t reduction_list, tree phi)
return NULL;
tmpred.reduc_phi = phi;
red = htab_find (reduction_list, &tmpred);
red = (struct reduction_info *) htab_find (reduction_list, &tmpred);
return red;
}
@ -527,7 +527,7 @@ initialize_reductions (void **slot, void *data)
tree bvar, type, arg;
edge e;
struct reduction_info *reduc = *slot;
struct reduction_info *const reduc = (struct reduction_info *) *slot;
struct loop *loop = (struct loop *) data;
/* Create initialization in preheader:
@ -583,7 +583,7 @@ struct elv_data
static tree
eliminate_local_variables_1 (tree *tp, int *walk_subtrees, void *data)
{
struct elv_data *dta = data;
struct elv_data *const dta = (struct elv_data *) data;
tree t = *tp, var, addr, addr_type, type, obj;
if (DECL_P (t))
@ -853,8 +853,8 @@ static int
add_field_for_reduction (void **slot, void *data)
{
struct reduction_info *red = *slot;
tree type = data;
struct reduction_info *const red = (struct reduction_info *) *slot;
tree const type = (tree) data;
tree var = SSA_NAME_VAR (GIMPLE_STMT_OPERAND (red->reduc_stmt, 0));
tree field = build_decl (FIELD_DECL, DECL_NAME (var), TREE_TYPE (var));
@ -871,8 +871,8 @@ add_field_for_reduction (void **slot, void *data)
static int
add_field_for_name (void **slot, void *data)
{
struct name_to_copy_elt *elt = *slot;
tree type = data;
struct name_to_copy_elt *const elt = (struct name_to_copy_elt *) *slot;
tree type = (tree) data;
tree name = ssa_name (elt->version);
tree var = SSA_NAME_VAR (name);
tree field = build_decl (FIELD_DECL, DECL_NAME (var), TREE_TYPE (var));
@ -893,8 +893,8 @@ add_field_for_name (void **slot, void *data)
static int
create_phi_for_local_result (void **slot, void *data)
{
struct reduction_info *reduc = *slot;
struct loop *loop = data;
struct reduction_info *const reduc = (struct reduction_info *) *slot;
const struct loop *const loop = (const struct loop *) data;
edge e;
tree new_phi;
basic_block store_bb;
@ -942,8 +942,8 @@ struct clsn_data
static int
create_call_for_reduction_1 (void **slot, void *data)
{
struct reduction_info *reduc = *slot;
struct clsn_data *clsn_data = data;
struct reduction_info *const reduc = (struct reduction_info *) *slot;
struct clsn_data *const clsn_data = (struct clsn_data *) data;
block_stmt_iterator bsi;
tree type = TREE_TYPE (PHI_RESULT (reduc->reduc_phi));
tree struct_type = TREE_TYPE (TREE_TYPE (clsn_data->load));
@ -1013,8 +1013,8 @@ create_call_for_reduction (struct loop *loop, htab_t reduction_list,
static int
create_loads_for_reductions (void **slot, void *data)
{
struct reduction_info *red = *slot;
struct clsn_data *clsn_data = data;
struct reduction_info *const red = (struct reduction_info *) *slot;
struct clsn_data *const clsn_data = (struct clsn_data *) data;
tree stmt;
block_stmt_iterator bsi;
tree type = TREE_TYPE (GIMPLE_STMT_OPERAND (red->reduc_stmt, 0));
@ -1074,8 +1074,8 @@ create_final_loads_for_reduction (htab_t reduction_list,
static int
create_stores_for_reduction (void **slot, void *data)
{
struct reduction_info *red = *slot;
struct clsn_data *clsn_data = data;
struct reduction_info *const red = (struct reduction_info *) *slot;
struct clsn_data *const clsn_data = (struct clsn_data *) data;
tree stmt;
block_stmt_iterator bsi;
tree type = TREE_TYPE (GIMPLE_STMT_OPERAND (red->reduc_stmt, 0));
@ -1099,8 +1099,8 @@ create_stores_for_reduction (void **slot, void *data)
static int
create_loads_and_stores_for_name (void **slot, void *data)
{
struct name_to_copy_elt *elt = *slot;
struct clsn_data *clsn_data = data;
struct name_to_copy_elt *const elt = (struct name_to_copy_elt *) *slot;
struct clsn_data *const clsn_data = (struct clsn_data *) data;
tree stmt;
block_stmt_iterator bsi;
tree type = TREE_TYPE (elt->new_name);

View File

@ -152,7 +152,7 @@ allocate_phi_node (int len)
}
else
{
phi = ggc_alloc (size);
phi = (tree) ggc_alloc (size);
#ifdef GATHER_STATISTICS
phi_nodes_created++;
tree_node_counts[(int) phi_kind]++;

View File

@ -885,8 +885,8 @@ filter_suitable_components (struct loop *loop, struct component *comps)
static int
order_drefs (const void *a, const void *b)
{
const dref *da = a;
const dref *db = b;
const dref *const da = (const dref *) a;
const dref *const db = (const dref *) b;
int offcmp = double_int_scmp ((*da)->offset, (*db)->offset);
if (offcmp != 0)
@ -1843,7 +1843,7 @@ struct epcc_data
static void
execute_pred_commoning_cbck (struct loop *loop, void *data)
{
struct epcc_data *dta = data;
struct epcc_data *const dta = (struct epcc_data *) data;
/* Restore phi nodes that were replaced by ssa names before
tree_transform_and_unroll_loop (see detailed description in

View File

@ -487,7 +487,7 @@ sra_hash_tree (tree t)
static hashval_t
sra_elt_hash (const void *x)
{
const struct sra_elt *e = x;
const struct sra_elt *const e = (const struct sra_elt *) x;
const struct sra_elt *p;
hashval_t h;
@ -510,8 +510,8 @@ sra_elt_hash (const void *x)
static int
sra_elt_eq (const void *x, const void *y)
{
const struct sra_elt *a = x;
const struct sra_elt *b = y;
const struct sra_elt *const a = (const struct sra_elt *) x;
const struct sra_elt *const b = (const struct sra_elt *) y;
tree ae, be;
const struct sra_elt *ap = a->parent;
const struct sra_elt *bp = b->parent;
@ -592,7 +592,7 @@ lookup_element (struct sra_elt *parent, tree child, tree type,
elt = *slot;
if (!elt && insert == INSERT)
{
*slot = elt = obstack_alloc (&sra_obstack, sizeof (*elt));
*slot = elt = XOBNEW (&sra_obstack, struct sra_elt);
memset (elt, 0, sizeof (*elt));
elt->parent = parent;

View File

@ -228,7 +228,7 @@ get_mem_sym_stats_for (tree var)
slot = pointer_map_insert (map, var);
if (*slot == NULL)
{
stats = pool_alloc (mem_sym_stats_pool);
stats = (struct mem_sym_stats_d *) pool_alloc (mem_sym_stats_pool);
memset (stats, 0, sizeof (*stats));
stats->var = var;
*slot = (void *) stats;

View File

@ -315,8 +315,8 @@ add_coalesce (coalesce_list_p cl, int p1, int p2,
static int
compare_pairs (const void *p1, const void *p2)
{
const_coalesce_pair_p const * pp1 = p1;
const_coalesce_pair_p const * pp2 = p2;
const_coalesce_pair_p const *const pp1 = (const_coalesce_pair_p const *) p1;
const_coalesce_pair_p const *const pp2 = (const_coalesce_pair_p const *) p2;
int result;
result = (* pp2)->cost - (* pp1)->cost;

View File

@ -619,7 +619,7 @@ mem_ref_in_stmt (tree stmt)
gcc_assert (!store);
hash = iterative_hash_expr (*mem, 0);
ref = htab_find_with_hash (memory_accesses.refs, *mem, hash);
ref = (mem_ref_p) htab_find_with_hash (memory_accesses.refs, *mem, hash);
gcc_assert (ref != NULL);
return ref;
@ -1165,7 +1165,7 @@ force_move_till (tree ref, tree *index, void *data)
static hashval_t
memref_hash (const void *obj)
{
const struct mem_ref *mem = obj;
const struct mem_ref *const mem = (const struct mem_ref *) obj;
return mem->hash;
}
@ -1176,9 +1176,9 @@ memref_hash (const void *obj)
static int
memref_eq (const void *obj1, const void *obj2)
{
const struct mem_ref *mem1 = obj1;
const struct mem_ref *const mem1 = (const struct mem_ref *) obj1;
return operand_equal_p (mem1->mem, (tree) obj2, 0);
return operand_equal_p (mem1->mem, (const_tree) obj2, 0);
}
/* Releases list of memory reference locations ACCS. */
@ -1203,7 +1203,7 @@ free_mem_ref_locs (mem_ref_locs_p accs)
static void
memref_free (void *obj)
{
struct mem_ref *mem = obj;
struct mem_ref *const mem = (struct mem_ref *) obj;
unsigned i;
mem_ref_locs_p accs;
@ -1322,7 +1322,7 @@ gather_mem_refs_stmt (struct loop *loop, tree stmt)
if (*slot)
{
ref = *slot;
ref = (mem_ref_p) *slot;
id = ref->id;
}
else
@ -1416,7 +1416,8 @@ struct vop_to_refs_elt
static hashval_t
vtoe_hash (const void *obj)
{
const struct vop_to_refs_elt *vtoe = obj;
const struct vop_to_refs_elt *const vtoe =
(const struct vop_to_refs_elt *) obj;
return vtoe->uid;
}
@ -1427,8 +1428,9 @@ vtoe_hash (const void *obj)
static int
vtoe_eq (const void *obj1, const void *obj2)
{
const struct vop_to_refs_elt *vtoe = obj1;
const unsigned *uid = obj2;
const struct vop_to_refs_elt *const vtoe =
(const struct vop_to_refs_elt *) obj1;
const unsigned *const uid = (const unsigned *) obj2;
return vtoe->uid == *uid;
}
@ -1438,7 +1440,8 @@ vtoe_eq (const void *obj1, const void *obj2)
static void
vtoe_free (void *obj)
{
struct vop_to_refs_elt *vtoe = obj;
struct vop_to_refs_elt *const vtoe =
(struct vop_to_refs_elt *) obj;
BITMAP_FREE (vtoe->refs_all);
BITMAP_FREE (vtoe->refs_stored);
@ -1463,7 +1466,7 @@ record_vop_access (htab_t vop_to_refs, unsigned vop, unsigned ref, bool stored)
*slot = vtoe;
}
else
vtoe = *slot;
vtoe = (struct vop_to_refs_elt *) *slot;
bitmap_set_bit (vtoe->refs_all, ref);
if (stored)
@ -1476,7 +1479,8 @@ record_vop_access (htab_t vop_to_refs, unsigned vop, unsigned ref, bool stored)
static bitmap
get_vop_accesses (htab_t vop_to_refs, unsigned vop)
{
struct vop_to_refs_elt *vtoe = htab_find_with_hash (vop_to_refs, &vop, vop);
struct vop_to_refs_elt *const vtoe =
(struct vop_to_refs_elt *) htab_find_with_hash (vop_to_refs, &vop, vop);
return vtoe->refs_all;
}
@ -1486,7 +1490,8 @@ get_vop_accesses (htab_t vop_to_refs, unsigned vop)
static bitmap
get_vop_stores (htab_t vop_to_refs, unsigned vop)
{
struct vop_to_refs_elt *vtoe = htab_find_with_hash (vop_to_refs, &vop, vop);
struct vop_to_refs_elt *const vtoe =
(struct vop_to_refs_elt *) htab_find_with_hash (vop_to_refs, &vop, vop);
return vtoe->refs_stored;
}

View File

@ -1355,7 +1355,7 @@ determine_loop_nest_reuse (struct loop *loop, struct mem_ref_group *refs,
for (i = 0; VEC_iterate (data_reference_p, datarefs, i, dr); i++)
{
dist = self_reuse_distance (dr, loop_data_size, n, loop);
ref = dr->aux;
ref = (struct mem_ref *) dr->aux;
if (ref->reuse_distance > dist)
ref->reuse_distance = dist;
@ -1370,8 +1370,8 @@ determine_loop_nest_reuse (struct loop *loop, struct mem_ref_group *refs,
if (DDR_ARE_DEPENDENT (dep) == chrec_known)
continue;
ref = DDR_A (dep)->aux;
refb = DDR_B (dep)->aux;
ref = (struct mem_ref *) DDR_A (dep)->aux;
refb = (struct mem_ref *) DDR_B (dep)->aux;
if (DDR_ARE_DEPENDENT (dep) == chrec_dont_know
|| DDR_NUM_DIST_VECTS (dep) == 0)

View File

@ -261,7 +261,7 @@ VN_INFO_GET (tree name)
{
vn_ssa_aux_t newinfo;
newinfo = obstack_alloc (&vn_ssa_aux_obstack, sizeof (struct vn_ssa_aux));
newinfo = XOBNEW (&vn_ssa_aux_obstack, struct vn_ssa_aux);
memset (newinfo, 0, sizeof (struct vn_ssa_aux));
if (SSA_NAME_VERSION (name) >= VEC_length (vn_ssa_aux_t, vn_ssa_aux_table))
VEC_safe_grow (vn_ssa_aux_t, heap, vn_ssa_aux_table,
@ -277,7 +277,7 @@ VN_INFO_GET (tree name)
static void
free_phi (void *vp)
{
vn_phi_t phi = vp;
vn_phi_t phi = (vn_phi_t) vp;
VEC_free (tree, heap, phi->phiargs);
}
@ -286,7 +286,7 @@ free_phi (void *vp)
static void
free_reference (void *vp)
{
vn_reference_t vr = vp;
vn_reference_t vr = (vn_reference_t) vp;
VEC_free (vn_reference_op_s, heap, vr->operands);
}
@ -921,7 +921,7 @@ vn_nary_op_insert (tree op, tree result)
vn_nary_op_t vno1;
unsigned i;
vno1 = obstack_alloc (&current_info->nary_obstack,
vno1 = (vn_nary_op_t) obstack_alloc (&current_info->nary_obstack,
(sizeof (struct vn_nary_op_s)
- sizeof (tree) * (4 - length)));
vno1->opcode = TREE_CODE (op);

View File

@ -63,7 +63,7 @@ redirect_edge_var_map_add (edge e, tree result, tree def)
edge_var_maps = pointer_map_create ();
slot = pointer_map_insert (edge_var_maps, e);
old_head = head = *slot;
old_head = head = (edge_var_map_vector) *slot;
if (!head)
{
head = VEC_alloc (edge_var_map, heap, 5);
@ -96,7 +96,7 @@ redirect_edge_var_map_clear (edge e)
if (slot)
{
head = *slot;
head = (edge_var_map_vector) *slot;
VEC_free (edge_var_map, heap, head);
*slot = NULL;
}
@ -121,7 +121,7 @@ redirect_edge_var_map_dup (edge newe, edge olde)
old_slot = pointer_map_contains (edge_var_maps, olde);
if (!old_slot)
return;
head = *old_slot;
head = (edge_var_map_vector) *old_slot;
if (head)
*new_slot = VEC_copy (edge_var_map, heap, head);

View File

@ -2712,7 +2712,7 @@ vectorize_loops (void)
loop = get_loop (i);
if (!loop)
continue;
loop_vinfo = loop->aux;
loop_vinfo = (loop_vec_info) loop->aux;
destroy_loop_vec_info (loop_vinfo, true);
loop->aux = NULL;
}

View File

@ -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);

View File

@ -148,8 +148,8 @@ gimple_histogram_value (struct function *fun, tree stmt)
{
if (!VALUE_HISTOGRAMS (fun))
return NULL;
return htab_find_with_hash (VALUE_HISTOGRAMS (fun), stmt,
htab_hash_pointer (stmt));
return (histogram_value) htab_find_with_hash (VALUE_HISTOGRAMS (fun), stmt,
htab_hash_pointer (stmt));
}
/* Add histogram for STMT. */
@ -331,7 +331,7 @@ gimple_duplicate_stmt_histograms (struct function *fun, tree stmt,
histogram_value new = gimple_alloc_histogram_value (fun, val->type, NULL, NULL);
memcpy (new, val, sizeof (*val));
new->hvalue.stmt = stmt;
new->hvalue.counters = xmalloc (sizeof (*new->hvalue.counters) * new->n_counters);
new->hvalue.counters = XNEWVAR (gcov_type, sizeof (*new->hvalue.counters) * new->n_counters);
memcpy (new->hvalue.counters, val->hvalue.counters, sizeof (*new->hvalue.counters) * new->n_counters);
gimple_add_histogram_value (fun, stmt, new);
}

View File

@ -693,7 +693,7 @@ attrs_list_insert (attrs *listp, tree decl, HOST_WIDE_INT offset, rtx loc)
{
attrs list;
list = pool_alloc (attrs_pool);
list = (attrs) pool_alloc (attrs_pool);
list->loc = loc;
list->decl = decl;
list->offset = offset;
@ -711,7 +711,7 @@ attrs_list_copy (attrs *dstp, attrs src)
attrs_list_clear (dstp);
for (; src; src = src->next)
{
n = pool_alloc (attrs_pool);
n = (attrs) pool_alloc (attrs_pool);
n->loc = src->loc;
n->decl = src->decl;
n->offset = src->offset;
@ -750,7 +750,7 @@ unshare_variable (dataflow_set *set, variable var,
variable new_var;
int i;
new_var = pool_alloc (var_pool);
new_var = (variable) pool_alloc (var_pool);
new_var->decl = var->decl;
new_var->refcount = 1;
var->refcount--;
@ -767,7 +767,7 @@ unshare_variable (dataflow_set *set, variable var,
{
location_chain new_lc;
new_lc = pool_alloc (loc_chain_pool);
new_lc = (location_chain) pool_alloc (loc_chain_pool);
new_lc->next = NULL;
if (node->init > initialized)
new_lc->init = node->init;
@ -1095,8 +1095,10 @@ struct variable_union_info
static int
variable_union_info_cmp_pos (const void *n1, const void *n2)
{
const struct variable_union_info *i1 = n1;
const struct variable_union_info *i2 = n2;
const struct variable_union_info *const i1 =
(const struct variable_union_info *) n1;
const struct variable_union_info *const i2 =
( const struct variable_union_info *) n2;
if (i1->pos != i2->pos)
return i1->pos - i2->pos;
@ -1275,7 +1277,7 @@ variable_union (void **slot, void *data)
location_chain new_node;
/* Copy the location from SRC. */
new_node = pool_alloc (loc_chain_pool);
new_node = (location_chain) pool_alloc (loc_chain_pool);
new_node->loc = node->loc;
new_node->init = node->init;
if (!node->set_src || MEM_P (node->set_src))
@ -1326,7 +1328,7 @@ variable_union (void **slot, void *data)
{
location_chain new_lc;
new_lc = pool_alloc (loc_chain_pool);
new_lc = (location_chain) pool_alloc (loc_chain_pool);
new_lc->next = NULL;
new_lc->init = node->init;
if (!node->set_src || MEM_P (node->set_src))
@ -1455,7 +1457,7 @@ dataflow_set_different_1 (void **slot, void *data)
variable var1, var2;
var1 = *(variable *) slot;
var2 = htab_find_with_hash (htab, var1->decl,
var2 = (variable) htab_find_with_hash (htab, var1->decl,
VARIABLE_HASH_VAL (var1->decl));
if (!var2)
{
@ -1487,7 +1489,7 @@ dataflow_set_different_2 (void **slot, void *data)
variable var1, var2;
var1 = *(variable *) slot;
var2 = htab_find_with_hash (htab, var1->decl,
var2 = (variable) htab_find_with_hash (htab, var1->decl,
VARIABLE_HASH_VAL (var1->decl));
if (!var2)
{
@ -2177,7 +2179,7 @@ vt_find_locations (void)
while (!fibheap_empty (worklist))
{
bb = fibheap_extract_min (worklist);
bb = (basic_block) fibheap_extract_min (worklist);
RESET_BIT (in_worklist, bb->index);
if (!TEST_BIT (visited, bb->index))
{
@ -2352,7 +2354,7 @@ variable_was_changed (variable var, htab_t htab)
variable empty_var;
void **old;
empty_var = pool_alloc (var_pool);
empty_var = (variable) pool_alloc (var_pool);
empty_var->decl = var->decl;
empty_var->refcount = 1;
empty_var->n_var_parts = 0;
@ -2433,7 +2435,7 @@ set_variable_part (dataflow_set *set, rtx loc, tree decl, HOST_WIDE_INT offset,
if (!*slot)
{
/* Create new variable information. */
var = pool_alloc (var_pool);
var = (variable) pool_alloc (var_pool);
var->decl = decl;
var->refcount = 1;
var->n_var_parts = 1;
@ -2525,7 +2527,7 @@ set_variable_part (dataflow_set *set, rtx loc, tree decl, HOST_WIDE_INT offset,
}
/* Add the location to the beginning. */
node = pool_alloc (loc_chain_pool);
node = (location_chain) pool_alloc (loc_chain_pool);
node->loc = loc;
node->init = initialized;
node->set_src = set_src;
@ -2888,7 +2890,7 @@ emit_notes_for_differences_1 (void **slot, void *data)
variable old_var, new_var;
old_var = *(variable *) slot;
new_var = htab_find_with_hash (new_vars, old_var->decl,
new_var = (variable) htab_find_with_hash (new_vars, old_var->decl,
VARIABLE_HASH_VAL (old_var->decl));
if (!new_var)
@ -2896,7 +2898,7 @@ emit_notes_for_differences_1 (void **slot, void *data)
/* Variable has disappeared. */
variable empty_var;
empty_var = pool_alloc (var_pool);
empty_var = (variable) pool_alloc (var_pool);
empty_var->decl = old_var->decl;
empty_var->refcount = 1;
empty_var->n_var_parts = 0;
@ -2921,7 +2923,7 @@ emit_notes_for_differences_2 (void **slot, void *data)
variable old_var, new_var;
new_var = *(variable *) slot;
old_var = htab_find_with_hash (old_vars, new_var->decl,
old_var = (variable) htab_find_with_hash (old_vars, new_var->decl,
VARIABLE_HASH_VAL (new_var->decl));
if (!old_var)
{

View File

@ -216,7 +216,7 @@ prefix_name (const char *prefix, tree name)
{
unsigned plen = strlen (prefix);
unsigned nlen = strlen (IDENTIFIER_POINTER (name));
char *toname = alloca (plen + nlen + 1);
char *toname = (char *) alloca (plen + nlen + 1);
memcpy (toname, prefix, plen);
memcpy (toname + plen, IDENTIFIER_POINTER (name), nlen + 1);
@ -366,7 +366,7 @@ emutls_decl (tree decl)
in.hash = htab_hash_string (IDENTIFIER_POINTER (name));
in.base.from = decl;
loc = htab_find_slot_with_hash (emutls_htab, &in, in.hash, INSERT);
h = *loc;
h = (struct tree_map *) *loc;
if (h != NULL)
to = h->to;
else
@ -374,7 +374,7 @@ emutls_decl (tree decl)
to = build_decl (VAR_DECL, get_emutls_object_name (name),
get_emutls_object_type ());
h = ggc_alloc (sizeof (struct tree_map));
h = GGC_NEW (struct tree_map);
h->hash = in.hash;
h->base.from = decl;
h->to = to;
@ -469,8 +469,8 @@ emutls_finish (void)
static int
section_entry_eq (const void *p1, const void *p2)
{
const section *old = p1;
const char *new = p2;
const section *old = (const section *) p1;
const char *new = (const char *) p2;
return strcmp (old->named.name, new) == 0;
}
@ -478,7 +478,7 @@ section_entry_eq (const void *p1, const void *p2)
static hashval_t
section_entry_hash (const void *p)
{
const section *old = p;
const section *old = (const section *) p;
return htab_hash_string (old->named.name);
}
@ -497,8 +497,8 @@ hash_section (section *sect)
static int
object_block_entry_eq (const void *p1, const void *p2)
{
const struct object_block *old = p1;
const section *new = p2;
const struct object_block *old = (const struct object_block *) p1;
const section *new = (const section *) p2;
return old->sect == new;
}
@ -506,7 +506,7 @@ object_block_entry_eq (const void *p1, const void *p2)
static hashval_t
object_block_entry_hash (const void *p)
{
const struct object_block *old = p;
const struct object_block *old = (const struct object_block *) p;
return hash_section (old->sect);
}
@ -626,7 +626,7 @@ create_block_symbol (const char *label, struct object_block *block,
/* Create the extended SYMBOL_REF. */
size = RTX_HDR_SIZE + sizeof (struct block_symbol);
symbol = ggc_alloc_zone (size, &rtl_zone);
symbol = (rtx) ggc_alloc_zone (size, &rtl_zone);
/* Initialize the normal SYMBOL_REF fields. */
memset (symbol, 0, size);
@ -656,7 +656,7 @@ initialize_cold_section_name (void)
dsn = DECL_SECTION_NAME (current_function_decl);
if (flag_function_sections && dsn)
{
name = alloca (TREE_STRING_LENGTH (dsn) + 1);
name = (char *) alloca (TREE_STRING_LENGTH (dsn) + 1);
memcpy (name, TREE_STRING_POINTER (dsn), TREE_STRING_LENGTH (dsn) + 1);
stripped_name = targetm.strip_name_encoding (name);
@ -870,7 +870,7 @@ default_function_rodata_section (tree decl)
if (DECL_ONE_ONLY (decl) && HAVE_COMDAT_GROUP)
{
size_t len = strlen (name) + 3;
char* rname = alloca (len);
char* rname = (char *) alloca (len);
strcpy (rname, ".rodata");
strcat (rname, name + 5);
@ -881,7 +881,7 @@ default_function_rodata_section (tree decl)
&& strncmp (name, ".gnu.linkonce.t.", 16) == 0)
{
size_t len = strlen (name) + 1;
char *rname = alloca (len);
char *rname = (char *) alloca (len);
memcpy (rname, name, len);
rname[14] = 'r';
@ -892,7 +892,7 @@ default_function_rodata_section (tree decl)
&& strncmp (name, ".text.", 6) == 0)
{
size_t len = strlen (name) + 1;
char *rname = alloca (len + 2);
char *rname = (char *) alloca (len + 2);
memcpy (rname, ".rodata", 7);
memcpy (rname + 7, name + 5, len - 5);
@ -1015,7 +1015,7 @@ strip_reg_name (const char *name)
void
set_user_assembler_name (tree decl, const char *name)
{
char *starred = alloca (strlen (name) + 2);
char *starred = (char *) alloca (strlen (name) + 2);
starred[0] = '*';
strcpy (starred + 1, name);
change_decl_assembler_name (decl, get_identifier (starred));
@ -2887,8 +2887,10 @@ const_hash_1 (const tree exp)
static int
const_desc_eq (const void *p1, const void *p2)
{
const struct constant_descriptor_tree *c1 = p1;
const struct constant_descriptor_tree *c2 = p2;
const struct constant_descriptor_tree *const c1
= (const struct constant_descriptor_tree *) p1;
const struct constant_descriptor_tree *const c2
= (const struct constant_descriptor_tree *) p2;
if (c1->hash != c2->hash)
return 0;
return compare_constant (c1->value, c2->value);
@ -3151,7 +3153,7 @@ build_constant_desc (tree exp)
int labelno;
struct constant_descriptor_tree *desc;
desc = ggc_alloc (sizeof (*desc));
desc = GGC_NEW (struct constant_descriptor_tree);
desc->value = copy_constant (exp);
/* Propagate marked-ness to copied constant. */
@ -3219,7 +3221,7 @@ output_constant_def (tree exp, int defer)
key.hash = const_hash_1 (exp);
loc = htab_find_slot_with_hash (const_desc_htab, &key, key.hash, INSERT);
desc = *loc;
desc = (struct constant_descriptor_tree *) *loc;
if (desc == 0)
{
desc = build_constant_desc (exp);
@ -3330,7 +3332,8 @@ lookup_constant_def (tree exp)
key.value = exp;
key.hash = const_hash_1 (exp);
desc = htab_find_with_hash (const_desc_htab, &key, key.hash);
desc = (struct constant_descriptor_tree *)
htab_find_with_hash (const_desc_htab, &key, key.hash);
return (desc ? desc->rtl : NULL_RTX);
}
@ -3378,15 +3381,18 @@ struct constant_descriptor_rtx GTY((chain_next ("%h.next")))
static hashval_t
const_desc_rtx_hash (const void *ptr)
{
const struct constant_descriptor_rtx *desc = ptr;
const struct constant_descriptor_rtx *const desc
= (const struct constant_descriptor_rtx *) ptr;
return desc->hash;
}
static int
const_desc_rtx_eq (const void *a, const void *b)
{
const struct constant_descriptor_rtx *x = a;
const struct constant_descriptor_rtx *y = b;
const struct constant_descriptor_rtx *const x
= (const struct constant_descriptor_rtx *) a;
const struct constant_descriptor_rtx *const y
= (const struct constant_descriptor_rtx *) b;
if (x->mode != y->mode)
return 0;
@ -3467,7 +3473,7 @@ const_rtx_hash_1 (rtx *xp, void *data)
break;
}
hp = data;
hp = (hashval_t *) data;
*hp = *hp * 509 + h;
return 0;
}
@ -3490,7 +3496,7 @@ create_constant_pool (void)
{
struct rtx_constant_pool *pool;
pool = ggc_alloc (sizeof (struct rtx_constant_pool));
pool = GGC_NEW (struct rtx_constant_pool);
pool->const_rtx_htab = htab_create_ggc (31, const_desc_rtx_hash,
const_desc_rtx_eq, NULL);
pool->first = NULL;
@ -3549,14 +3555,14 @@ force_const_mem (enum machine_mode mode, rtx x)
tmp.mode = mode;
hash = const_rtx_hash (x);
slot = htab_find_slot_with_hash (pool->const_rtx_htab, &tmp, hash, INSERT);
desc = *slot;
desc = (struct constant_descriptor_rtx *) *slot;
/* If the constant was already present, return its memory. */
if (desc)
return copy_rtx (desc->mem);
/* Otherwise, create a new descriptor. */
desc = ggc_alloc (sizeof (*desc));
desc = GGC_NEW (struct constant_descriptor_rtx);
*slot = desc;
/* Align the location counter as required by EXP's data type. */
@ -6046,7 +6052,7 @@ default_unique_section (tree decl, int reloc)
static int
compute_reloc_for_rtx_1 (rtx *xp, void *data)
{
int *preloc = data;
int *preloc = (int *) data;
rtx x = *xp;
switch (GET_CODE (x))
@ -6323,7 +6329,7 @@ void
default_internal_label (FILE *stream, const char *prefix,
unsigned long labelno)
{
char *const buf = alloca (40 + strlen (prefix));
char *const buf = (char *) alloca (40 + strlen (prefix));
ASM_GENERATE_INTERNAL_LABEL (buf, prefix, labelno);
ASM_OUTPUT_INTERNAL_LABEL (stream, buf);
}

View File

@ -126,9 +126,9 @@ varray_init (size_t num_elements, enum varray_data_enum element_kind,
desc->allocated += data_size + VARRAY_HDR_SIZE;
#endif
if (element[element_kind].uses_ggc)
ptr = ggc_alloc_cleared (VARRAY_HDR_SIZE + data_size);
ptr = GGC_CNEWVAR (struct varray_head_tag, VARRAY_HDR_SIZE + data_size);
else
ptr = xcalloc (VARRAY_HDR_SIZE + data_size, 1);
ptr = XCNEWVAR (struct varray_head_tag, VARRAY_HDR_SIZE + data_size);
ptr->num_elements = num_elements;
ptr->elements_used = 0;
@ -159,9 +159,11 @@ varray_grow (varray_type va, size_t n)
if (element[va->type].uses_ggc)
va = ggc_realloc (va, VARRAY_HDR_SIZE + data_size);
va = GGC_RESIZEVAR (struct varray_head_tag, va,
VARRAY_HDR_SIZE + data_size);
else
va = xrealloc (va, VARRAY_HDR_SIZE + data_size);
va = XRESIZEVAR (struct varray_head_tag, va,
VARRAY_HDR_SIZE + data_size);
va->num_elements = n;
if (n > old_elements)
memset (&va->data.vdt_c[old_data_size], 0, data_size - old_data_size);

View File

@ -95,7 +95,7 @@ static void *
vec_gc_o_reserve_1 (void *vec, int reserve, size_t vec_offset, size_t elt_size,
bool exact MEM_STAT_DECL)
{
struct vec_prefix *pfx = vec;
struct vec_prefix *pfx = (struct vec_prefix *) vec;
unsigned alloc = alloc = calculate_allocation (pfx, reserve, exact);
if (!alloc)
@ -167,7 +167,7 @@ static void *
vec_heap_o_reserve_1 (void *vec, int reserve, size_t vec_offset,
size_t elt_size, bool exact MEM_STAT_DECL)
{
struct vec_prefix *pfx = vec;
struct vec_prefix *pfx = (struct vec_prefix *) vec;
unsigned alloc = calculate_allocation (pfx, reserve, exact);
if (!alloc)