Commit d3bfe4de by Kaveh R. Ghazi Committed by Kaveh Ghazi

driver-i386.c (detect_caches_amd, [...]): Fix -Wc++-compat and/or -Wcast-qual warnings.

	* config/i386/driver-i386.c (detect_caches_amd,
	detect_caches_intel, host_detect_local_cpu): Fix -Wc++-compat
	and/or -Wcast-qual warnings.
	*ggc-common.c (ggc_mark_roots, gt_pch_note_object,
	gt_pch_note_reorder, relocate_ptrs, write_pch_globals,
	gt_pch_save): Likewise.
	* ggc-page.c (push_depth, push_by_depth, alloc_anon, alloc_page,
	gt_ggc_m_S, clear_marks, ggc_pch_read): Likewise.
	* global.c (compute_regsets): Likewise.
	* graph.c (print_rtl_graph_with_bb, clean_graph_dump_file,
	finish_graph_dump_file): Likewise.
	* haifa-sched.c (schedule_block, extend_h_i_d, extend_ready,
	unlink_bb_notes): Likewise.
	* integrate.c (get_hard_reg_initial_val): Likewise.
	* ipa-prop.c (ipa_push_func_to_list): Likewise.
	* ipa-struct-reorg.c (gen_var_name, gen_cluster_name): Likewise.
	* local-alloc.c (update_equiv_regs): Likewise.
	* loop-invariant.c (check_invariant_table_size,
	hash_invariant_expr, eq_invariant_expr, find_or_insert_inv):
	Likewise.
	* loop-iv.c (check_iv_ref_table_size, analyzed_for_bivness_p,
	altered_reg_used, mark_altered): Likewise.
	* loop-unroll.c (si_info_eq, ve_info_eq, allocate_basic_variable,
	insert_var_expansion_initialization,
	combine_var_copies_in_loop_exit, apply_opt_in_copies,
	release_var_copies): Likewise.
	* matrix-reorg.c (mat_acc_phi_hash, mat_acc_phi_eq, mtt_info_eq,
	analyze_matrix_decl, add_allocation_site, analyze_transpose,
	analyze_accesses_for_phi_node, check_var_notmodified_p,
	check_allocation_function, find_sites_in_func,
	record_all_accesses_in_func, transform_access_sites,
	transform_allocation_sites): Likewise.
	* omp-low.c (new_omp_region, create_omp_child_function_name,
	check_omp_nesting_restrictions, check_combined_parallel,
	lower_omp_2, diagnose_sb_1, diagnose_sb_2): Likewise.
	* optabs.c (no_conflict_move_test, gen_libfunc, gen_fp_libfunc,
	gen_intv_fp_libfunc, gen_interclass_conv_libfunc,
	gen_intraclass_conv_libfunc, set_optab_libfunc, set_conv_libfunc):
	Likewise.
	* opts-common.c (prune_options): Likewise.
	* opts.c (add_input_filename, print_filtered_help,
	get_option_state): Likewise.
	* params.c (add_params): Likewise.
	* passes.c (set_pass_for_id, next_pass_1,
	do_per_function_toporder, pass_fini_dump_file): Likewise.
	* postreload.c (reload_cse_simplify_operands): Likewise.
	* predict.c (tree_predicted_by_p, tree_predict_edge,
	clear_bb_predictions, combine_predictions_for_bb): Likewise.

From-SVN: r137134
parent 04298b11
2008-06-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2008-06-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* config/i386/driver-i386.c (detect_caches_amd,
detect_caches_intel, host_detect_local_cpu): Fix -Wc++-compat
and/or -Wcast-qual warnings.
*ggc-common.c (ggc_mark_roots, gt_pch_note_object,
gt_pch_note_reorder, relocate_ptrs, write_pch_globals,
gt_pch_save): Likewise.
* ggc-page.c (push_depth, push_by_depth, alloc_anon, alloc_page,
gt_ggc_m_S, clear_marks, ggc_pch_read): Likewise.
* global.c (compute_regsets): Likewise.
* graph.c (print_rtl_graph_with_bb, clean_graph_dump_file,
finish_graph_dump_file): Likewise.
* haifa-sched.c (schedule_block, extend_h_i_d, extend_ready,
unlink_bb_notes): Likewise.
* integrate.c (get_hard_reg_initial_val): Likewise.
* ipa-prop.c (ipa_push_func_to_list): Likewise.
* ipa-struct-reorg.c (gen_var_name, gen_cluster_name): Likewise.
* local-alloc.c (update_equiv_regs): Likewise.
* loop-invariant.c (check_invariant_table_size,
hash_invariant_expr, eq_invariant_expr, find_or_insert_inv):
Likewise.
* loop-iv.c (check_iv_ref_table_size, analyzed_for_bivness_p,
altered_reg_used, mark_altered): Likewise.
* loop-unroll.c (si_info_eq, ve_info_eq, allocate_basic_variable,
insert_var_expansion_initialization,
combine_var_copies_in_loop_exit, apply_opt_in_copies,
release_var_copies): Likewise.
* matrix-reorg.c (mat_acc_phi_hash, mat_acc_phi_eq, mtt_info_eq,
analyze_matrix_decl, add_allocation_site, analyze_transpose,
analyze_accesses_for_phi_node, check_var_notmodified_p,
check_allocation_function, find_sites_in_func,
record_all_accesses_in_func, transform_access_sites,
transform_allocation_sites): Likewise.
* omp-low.c (new_omp_region, create_omp_child_function_name,
check_omp_nesting_restrictions, check_combined_parallel,
lower_omp_2, diagnose_sb_1, diagnose_sb_2): Likewise.
* optabs.c (no_conflict_move_test, gen_libfunc, gen_fp_libfunc,
gen_intv_fp_libfunc, gen_interclass_conv_libfunc,
gen_intraclass_conv_libfunc, set_optab_libfunc, set_conv_libfunc):
Likewise.
* opts-common.c (prune_options): Likewise.
* opts.c (add_input_filename, print_filtered_help,
get_option_state): Likewise.
* params.c (add_params): Likewise.
* passes.c (set_pass_for_id, next_pass_1,
do_per_function_toporder, pass_fini_dump_file): Likewise.
* postreload.c (reload_cse_simplify_operands): Likewise.
* predict.c (tree_predicted_by_p, tree_predict_edge,
clear_bb_predictions, combine_predictions_for_bb): Likewise.
2008-06-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* ra.h (add_neighbor): Fix -Wc++-compat and/or -Wcast-qual * ra.h (add_neighbor): Fix -Wc++-compat and/or -Wcast-qual
warnings. warnings.
* recog.c (check_asm_operands, validate_change_1): Likewise. * recog.c (check_asm_operands, validate_change_1): Likewise.
......
...@@ -70,7 +70,7 @@ decode_l2_cache (unsigned *l2_size, unsigned *l2_line, unsigned *l2_assoc) ...@@ -70,7 +70,7 @@ decode_l2_cache (unsigned *l2_size, unsigned *l2_line, unsigned *l2_assoc)
/* Returns the description of caches for an AMD processor. */ /* Returns the description of caches for an AMD processor. */
static char * static const char *
detect_caches_amd (unsigned max_ext_level) detect_caches_amd (unsigned max_ext_level)
{ {
unsigned eax, ebx, ecx, edx; unsigned eax, ebx, ecx, edx;
...@@ -78,7 +78,7 @@ detect_caches_amd (unsigned max_ext_level) ...@@ -78,7 +78,7 @@ detect_caches_amd (unsigned max_ext_level)
unsigned l2_sizekb, l2_line, l2_assoc; unsigned l2_sizekb, l2_line, l2_assoc;
if (max_ext_level < 0x80000005) if (max_ext_level < 0x80000005)
return (char *) ""; return "";
__cpuid (0x80000005, eax, ebx, ecx, edx); __cpuid (0x80000005, eax, ebx, ecx, edx);
...@@ -282,7 +282,7 @@ decode_caches_intel (unsigned reg, unsigned *l1_sizekb, unsigned *l1_line, ...@@ -282,7 +282,7 @@ decode_caches_intel (unsigned reg, unsigned *l1_sizekb, unsigned *l1_line,
/* Returns the description of caches for an intel processor. */ /* Returns the description of caches for an intel processor. */
static char * static const char *
detect_caches_intel (unsigned max_level, unsigned max_ext_level) detect_caches_intel (unsigned max_level, unsigned max_ext_level)
{ {
unsigned eax, ebx, ecx, edx; unsigned eax, ebx, ecx, edx;
...@@ -290,7 +290,7 @@ detect_caches_intel (unsigned max_level, unsigned max_ext_level) ...@@ -290,7 +290,7 @@ detect_caches_intel (unsigned max_level, unsigned max_ext_level)
unsigned l2_sizekb = 0, l2_line = 0, l2_assoc = 0; unsigned l2_sizekb = 0, l2_line = 0, l2_assoc = 0;
if (max_level < 2) if (max_level < 2)
return (char *) ""; return "";
__cpuid (2, eax, ebx, ecx, edx); __cpuid (2, eax, ebx, ecx, edx);
...@@ -304,7 +304,7 @@ detect_caches_intel (unsigned max_level, unsigned max_ext_level) ...@@ -304,7 +304,7 @@ detect_caches_intel (unsigned max_level, unsigned max_ext_level)
&l2_sizekb, &l2_line, &l2_assoc); &l2_sizekb, &l2_line, &l2_assoc);
if (!l1_sizekb) if (!l1_sizekb)
return (char *) ""; return "";
/* Newer Intel CPUs are equipped with AMD style L2 cache info */ /* Newer Intel CPUs are equipped with AMD style L2 cache info */
if (max_ext_level >= 0x80000006) if (max_ext_level >= 0x80000006)
...@@ -393,13 +393,13 @@ const char *host_detect_local_cpu (int argc, const char **argv) ...@@ -393,13 +393,13 @@ const char *host_detect_local_cpu (int argc, const char **argv)
if (!arch) if (!arch)
{ {
if (vendor == *(unsigned int*) "Auth") if (vendor == *(const unsigned int*) "Auth")
cache = detect_caches_amd (ext_level); cache = detect_caches_amd (ext_level);
else if (vendor == *(unsigned int*) "Genu") else if (vendor == *(const unsigned int*) "Genu")
cache = detect_caches_intel (max_level, ext_level); cache = detect_caches_intel (max_level, ext_level);
} }
if (vendor == *(unsigned int*) "Auth") if (vendor == *(const unsigned int*) "Auth")
{ {
processor = PROCESSOR_PENTIUM; processor = PROCESSOR_PENTIUM;
...@@ -412,7 +412,7 @@ const char *host_detect_local_cpu (int argc, const char **argv) ...@@ -412,7 +412,7 @@ const char *host_detect_local_cpu (int argc, const char **argv)
if (has_sse4a) if (has_sse4a)
processor = PROCESSOR_AMDFAM10; processor = PROCESSOR_AMDFAM10;
} }
else if (vendor == *(unsigned int*) "Geod") else if (vendor == *(const unsigned int*) "Geod")
processor = PROCESSOR_GEODE; processor = PROCESSOR_GEODE;
else else
{ {
......
...@@ -116,7 +116,8 @@ ggc_mark_roots (void) ...@@ -116,7 +116,8 @@ ggc_mark_roots (void)
if (*cti->base) if (*cti->base)
{ {
ggc_set_mark (*cti->base); ggc_set_mark (*cti->base);
htab_traverse_noresize (*cti->base, ggc_htab_delete, (void *) cti); htab_traverse_noresize (*cti->base, ggc_htab_delete,
CONST_CAST (void *, (const void *)cti));
ggc_set_mark ((*cti->base)->entries); ggc_set_mark ((*cti->base)->entries);
} }
...@@ -264,12 +265,12 @@ gt_pch_note_object (void *obj, void *note_ptr_cookie, ...@@ -264,12 +265,12 @@ gt_pch_note_object (void *obj, void *note_ptr_cookie,
return 0; return 0;
} }
*slot = xcalloc (sizeof (struct ptr_data), 1); *slot = XCNEW (struct ptr_data);
(*slot)->obj = obj; (*slot)->obj = obj;
(*slot)->note_ptr_fn = note_ptr_fn; (*slot)->note_ptr_fn = note_ptr_fn;
(*slot)->note_ptr_cookie = note_ptr_cookie; (*slot)->note_ptr_cookie = note_ptr_cookie;
if (note_ptr_fn == gt_pch_p_S) if (note_ptr_fn == gt_pch_p_S)
(*slot)->size = strlen (obj) + 1; (*slot)->size = strlen ((const char *)obj) + 1;
else else
(*slot)->size = ggc_get_size (obj); (*slot)->size = ggc_get_size (obj);
(*slot)->type = type; (*slot)->type = type;
...@@ -287,7 +288,8 @@ gt_pch_note_reorder (void *obj, void *note_ptr_cookie, ...@@ -287,7 +288,8 @@ gt_pch_note_reorder (void *obj, void *note_ptr_cookie,
if (obj == NULL || obj == (void *) 1) if (obj == NULL || obj == (void *) 1)
return; return;
data = htab_find_with_hash (saving_htab, obj, POINTER_HASH (obj)); data = (struct ptr_data *)
htab_find_with_hash (saving_htab, obj, POINTER_HASH (obj));
gcc_assert (data && data->note_ptr_cookie == note_ptr_cookie); gcc_assert (data && data->note_ptr_cookie == note_ptr_cookie);
data->reorder_fn = reorder_fn; data->reorder_fn = reorder_fn;
...@@ -370,7 +372,8 @@ relocate_ptrs (void *ptr_p, void *state_p) ...@@ -370,7 +372,8 @@ relocate_ptrs (void *ptr_p, void *state_p)
if (*ptr == NULL || *ptr == (void *)1) if (*ptr == NULL || *ptr == (void *)1)
return; return;
result = htab_find_with_hash (saving_htab, *ptr, POINTER_HASH (*ptr)); result = (struct ptr_data *)
htab_find_with_hash (saving_htab, *ptr, POINTER_HASH (*ptr));
gcc_assert (result); gcc_assert (result);
*ptr = result->new_addr; *ptr = result->new_addr;
} }
...@@ -398,8 +401,8 @@ write_pch_globals (const struct ggc_root_tab * const *tab, ...@@ -398,8 +401,8 @@ write_pch_globals (const struct ggc_root_tab * const *tab,
} }
else else
{ {
new_ptr = htab_find_with_hash (saving_htab, ptr, new_ptr = (struct ptr_data *)
POINTER_HASH (ptr)); htab_find_with_hash (saving_htab, ptr, POINTER_HASH (ptr));
if (fwrite (&new_ptr->new_addr, sizeof (void *), 1, state->f) if (fwrite (&new_ptr->new_addr, sizeof (void *), 1, state->f)
!= 1) != 1)
fatal_error ("can't write PCH file: %m"); fatal_error ("can't write PCH file: %m");
...@@ -502,7 +505,7 @@ gt_pch_save (FILE *f) ...@@ -502,7 +505,7 @@ gt_pch_save (FILE *f)
if (this_object_size < state.ptrs[i]->size) if (this_object_size < state.ptrs[i]->size)
{ {
this_object_size = state.ptrs[i]->size; this_object_size = state.ptrs[i]->size;
this_object = xrealloc (this_object, this_object_size); this_object = XRESIZEVAR (char, this_object, this_object_size);
} }
memcpy (this_object, state.ptrs[i]->obj, state.ptrs[i]->size); memcpy (this_object, state.ptrs[i]->obj, state.ptrs[i]->size);
if (state.ptrs[i]->reorder_fn != NULL) if (state.ptrs[i]->reorder_fn != NULL)
......
...@@ -503,7 +503,7 @@ push_depth (unsigned int i) ...@@ -503,7 +503,7 @@ push_depth (unsigned int i)
if (G.depth_in_use >= G.depth_max) if (G.depth_in_use >= G.depth_max)
{ {
G.depth_max *= 2; G.depth_max *= 2;
G.depth = xrealloc (G.depth, G.depth_max * sizeof (unsigned int)); G.depth = XRESIZEVEC (unsigned int, G.depth, G.depth_max);
} }
G.depth[G.depth_in_use++] = i; G.depth[G.depth_in_use++] = i;
} }
...@@ -516,10 +516,9 @@ push_by_depth (page_entry *p, unsigned long *s) ...@@ -516,10 +516,9 @@ push_by_depth (page_entry *p, unsigned long *s)
if (G.by_depth_in_use >= G.by_depth_max) if (G.by_depth_in_use >= G.by_depth_max)
{ {
G.by_depth_max *= 2; G.by_depth_max *= 2;
G.by_depth = xrealloc (G.by_depth, G.by_depth = XRESIZEVEC (page_entry *, G.by_depth, G.by_depth_max);
G.by_depth_max * sizeof (page_entry *)); G.save_in_use = XRESIZEVEC (unsigned long *, G.save_in_use,
G.save_in_use = xrealloc (G.save_in_use, G.by_depth_max);
G.by_depth_max * sizeof (unsigned long *));
} }
G.by_depth[G.by_depth_in_use] = p; G.by_depth[G.by_depth_in_use] = p;
G.save_in_use[G.by_depth_in_use++] = s; G.save_in_use[G.by_depth_in_use++] = s;
...@@ -657,11 +656,11 @@ static inline char * ...@@ -657,11 +656,11 @@ static inline char *
alloc_anon (char *pref ATTRIBUTE_UNUSED, size_t size) alloc_anon (char *pref ATTRIBUTE_UNUSED, size_t size)
{ {
#ifdef HAVE_MMAP_ANON #ifdef HAVE_MMAP_ANON
char *page = mmap (pref, size, PROT_READ | PROT_WRITE, char *page = (char *) mmap (pref, size, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
#endif #endif
#ifdef HAVE_MMAP_DEV_ZERO #ifdef HAVE_MMAP_DEV_ZERO
char *page = mmap (pref, size, PROT_READ | PROT_WRITE, char *page = (char *) mmap (pref, size, PROT_READ | PROT_WRITE,
MAP_PRIVATE, G.dev_zero_fd, 0); MAP_PRIVATE, G.dev_zero_fd, 0);
#endif #endif
...@@ -772,7 +771,7 @@ alloc_page (unsigned order) ...@@ -772,7 +771,7 @@ alloc_page (unsigned order)
memory order. */ memory order. */
for (i = GGC_QUIRE_SIZE - 1; i >= 1; i--) for (i = GGC_QUIRE_SIZE - 1; i >= 1; i--)
{ {
e = xcalloc (1, page_entry_size); e = XCNEWVAR (struct page_entry, page_entry_size);
e->order = order; e->order = order;
e->bytes = G.pagesize; e->bytes = G.pagesize;
e->page = page + (i << G.lg_pagesize); e->page = page + (i << G.lg_pagesize);
...@@ -857,7 +856,7 @@ alloc_page (unsigned order) ...@@ -857,7 +856,7 @@ alloc_page (unsigned order)
#endif #endif
if (entry == NULL) if (entry == NULL)
entry = xcalloc (1, page_entry_size); entry = XCNEWVAR (struct page_entry, page_entry_size);
entry->bytes = entry_size; entry->bytes = entry_size;
entry->page = page; entry->page = page;
...@@ -1285,7 +1284,7 @@ gt_ggc_m_S (const void *p) ...@@ -1285,7 +1284,7 @@ gt_ggc_m_S (const void *p)
a STRING_CST. */ a STRING_CST. */
gcc_assert (offset == offsetof (struct tree_string, str)); gcc_assert (offset == offsetof (struct tree_string, str));
p = ((const char *) p) - offset; p = ((const char *) p) - offset;
gt_ggc_mx_lang_tree_node ((void *) p); gt_ggc_mx_lang_tree_node (CONST_CAST (void *, p));
return; return;
} }
...@@ -1666,7 +1665,7 @@ clear_marks (void) ...@@ -1666,7 +1665,7 @@ clear_marks (void)
if (p->context_depth < G.context_depth) if (p->context_depth < G.context_depth)
{ {
if (! save_in_use_p (p)) if (! save_in_use_p (p))
save_in_use_p (p) = xmalloc (bitmap_size); save_in_use_p (p) = XNEWVAR (unsigned long, bitmap_size);
memcpy (save_in_use_p (p), p->in_use_p, bitmap_size); memcpy (save_in_use_p (p), p->in_use_p, bitmap_size);
} }
...@@ -2272,7 +2271,7 @@ ggc_pch_read (FILE *f, void *addr) ...@@ -2272,7 +2271,7 @@ ggc_pch_read (FILE *f, void *addr)
{ {
struct ggc_pch_ondisk d; struct ggc_pch_ondisk d;
unsigned i; unsigned i;
char *offs = addr; char *offs = (char *) addr;
unsigned long count_old_page_tables; unsigned long count_old_page_tables;
unsigned long count_new_page_tables; unsigned long count_new_page_tables;
...@@ -2318,7 +2317,7 @@ ggc_pch_read (FILE *f, void *addr) ...@@ -2318,7 +2317,7 @@ ggc_pch_read (FILE *f, void *addr)
bytes = ROUND_UP (d.totals[i] * OBJECT_SIZE (i), G.pagesize); bytes = ROUND_UP (d.totals[i] * OBJECT_SIZE (i), G.pagesize);
num_objs = bytes / OBJECT_SIZE (i); num_objs = bytes / OBJECT_SIZE (i);
entry = xcalloc (1, (sizeof (struct page_entry) entry = XCNEWVAR (struct page_entry, (sizeof (struct page_entry)
- sizeof (long) - sizeof (long)
+ BITMAP_SIZE (num_objs + 1))); + BITMAP_SIZE (num_objs + 1)));
entry->bytes = bytes; entry->bytes = bytes;
......
...@@ -216,7 +216,7 @@ compute_regsets (HARD_REG_SET *elim_set, ...@@ -216,7 +216,7 @@ compute_regsets (HARD_REG_SET *elim_set,
/* Like regs_ever_live, but 1 if a reg is set or clobbered from an asm. /* Like regs_ever_live, but 1 if a reg is set or clobbered from an asm.
Unlike regs_ever_live, elements of this array corresponding to Unlike regs_ever_live, elements of this array corresponding to
eliminable regs like the frame pointer are set if an asm sets them. */ eliminable regs like the frame pointer are set if an asm sets them. */
char *regs_asm_clobbered = alloca (FIRST_PSEUDO_REGISTER * sizeof (char)); char *regs_asm_clobbered = XALLOCAVEC (char, FIRST_PSEUDO_REGISTER);
#ifdef ELIMINABLE_REGS #ifdef ELIMINABLE_REGS
static const struct {const int from, to; } eliminables[] = ELIMINABLE_REGS; static const struct {const int from, to; } eliminables[] = ELIMINABLE_REGS;
......
...@@ -226,7 +226,7 @@ print_rtl_graph_with_bb (const char *base, rtx rtx_first) ...@@ -226,7 +226,7 @@ print_rtl_graph_with_bb (const char *base, rtx rtx_first)
rtx tmp_rtx; rtx tmp_rtx;
size_t namelen = strlen (base); size_t namelen = strlen (base);
size_t extlen = strlen (graph_ext[graph_dump_format]) + 1; size_t extlen = strlen (graph_ext[graph_dump_format]) + 1;
char *buf = alloca (namelen + extlen); char *buf = XALLOCAVEC (char, namelen + extlen);
FILE *fp; FILE *fp;
if (basic_block_info == NULL) if (basic_block_info == NULL)
...@@ -389,7 +389,7 @@ clean_graph_dump_file (const char *base) ...@@ -389,7 +389,7 @@ clean_graph_dump_file (const char *base)
{ {
size_t namelen = strlen (base); size_t namelen = strlen (base);
size_t extlen = strlen (graph_ext[graph_dump_format]) + 1; size_t extlen = strlen (graph_ext[graph_dump_format]) + 1;
char *buf = alloca (namelen + extlen); char *buf = XALLOCAVEC (char, namelen + extlen);
FILE *fp; FILE *fp;
memcpy (buf, base, namelen); memcpy (buf, base, namelen);
...@@ -413,7 +413,7 @@ finish_graph_dump_file (const char *base) ...@@ -413,7 +413,7 @@ finish_graph_dump_file (const char *base)
{ {
size_t namelen = strlen (base); size_t namelen = strlen (base);
size_t extlen = strlen (graph_ext[graph_dump_format]) + 1; size_t extlen = strlen (graph_ext[graph_dump_format]) + 1;
char *buf = alloca (namelen + extlen); char *buf = XALLOCAVEC (char, namelen + extlen);
FILE *fp; FILE *fp;
memcpy (buf, base, namelen); memcpy (buf, base, namelen);
......
...@@ -2179,7 +2179,7 @@ schedule_block (basic_block *target_bb, int rgn_n_insns1) ...@@ -2179,7 +2179,7 @@ schedule_block (basic_block *target_bb, int rgn_n_insns1)
q_ptr = 0; q_ptr = 0;
q_size = 0; q_size = 0;
insn_queue = alloca ((max_insn_queue_index + 1) * sizeof (rtx)); insn_queue = XALLOCAVEC (rtx, max_insn_queue_index + 1);
memset (insn_queue, 0, (max_insn_queue_index + 1) * sizeof (rtx)); memset (insn_queue, 0, (max_insn_queue_index + 1) * sizeof (rtx));
/* Start just before the beginning of time. */ /* Start just before the beginning of time. */
...@@ -3158,7 +3158,8 @@ extend_h_i_d (void) ...@@ -3158,7 +3158,8 @@ extend_h_i_d (void)
pseudos which do not cross calls. */ pseudos which do not cross calls. */
int new_max_uid = get_max_uid () + 1; int new_max_uid = get_max_uid () + 1;
h_i_d = xrecalloc (h_i_d, new_max_uid, old_max_uid, sizeof (*h_i_d)); h_i_d = (struct haifa_insn_data *)
xrecalloc (h_i_d, new_max_uid, old_max_uid, sizeof (*h_i_d));
old_max_uid = new_max_uid; old_max_uid = new_max_uid;
if (targetm.sched.h_i_d_extended) if (targetm.sched.h_i_d_extended)
...@@ -3175,7 +3176,7 @@ extend_ready (int n_new_insns) ...@@ -3175,7 +3176,7 @@ extend_ready (int n_new_insns)
readyp->veclen = rgn_n_insns + n_new_insns + 1 + issue_rate; readyp->veclen = rgn_n_insns + n_new_insns + 1 + issue_rate;
readyp->vec = XRESIZEVEC (rtx, readyp->vec, readyp->veclen); readyp->vec = XRESIZEVEC (rtx, readyp->vec, readyp->veclen);
ready_try = xrecalloc (ready_try, rgn_n_insns + n_new_insns + 1, ready_try = (char *) xrecalloc (ready_try, rgn_n_insns + n_new_insns + 1,
rgn_n_insns + 1, sizeof (char)); rgn_n_insns + 1, sizeof (char));
rgn_n_insns += n_new_insns; rgn_n_insns += n_new_insns;
...@@ -4098,7 +4099,7 @@ unlink_bb_notes (basic_block first, basic_block last) ...@@ -4098,7 +4099,7 @@ unlink_bb_notes (basic_block first, basic_block last)
if (first == last) if (first == last)
return; return;
bb_header = xmalloc (last_basic_block * sizeof (*bb_header)); bb_header = XNEWVEC (rtx, last_basic_block);
/* Make a sentinel. */ /* Make a sentinel. */
if (last->next_bb != EXIT_BLOCK_PTR) if (last->next_bb != EXIT_BLOCK_PTR)
......
...@@ -237,19 +237,18 @@ get_hard_reg_initial_val (enum machine_mode mode, unsigned int regno) ...@@ -237,19 +237,18 @@ get_hard_reg_initial_val (enum machine_mode mode, unsigned int regno)
ivs = crtl->hard_reg_initial_vals; ivs = crtl->hard_reg_initial_vals;
if (ivs == 0) if (ivs == 0)
{ {
ivs = ggc_alloc (sizeof (initial_value_struct)); ivs = GGC_NEW (initial_value_struct);
ivs->num_entries = 0; ivs->num_entries = 0;
ivs->max_entries = 5; ivs->max_entries = 5;
ivs->entries = ggc_alloc (5 * sizeof (initial_value_pair)); ivs->entries = GGC_NEWVEC (initial_value_pair, 5);
crtl->hard_reg_initial_vals = ivs; crtl->hard_reg_initial_vals = ivs;
} }
if (ivs->num_entries >= ivs->max_entries) if (ivs->num_entries >= ivs->max_entries)
{ {
ivs->max_entries += 5; ivs->max_entries += 5;
ivs->entries = ggc_realloc (ivs->entries, ivs->entries = GGC_RESIZEVEC (initial_value_pair, ivs->entries,
ivs->max_entries ivs->max_entries);
* sizeof (initial_value_pair));
} }
ivs->entries[ivs->num_entries].hard_reg = gen_rtx_REG (mode, regno); ivs->entries[ivs->num_entries].hard_reg = gen_rtx_REG (mode, regno);
......
...@@ -52,7 +52,7 @@ ipa_push_func_to_list (struct ipa_func_list **wl, struct cgraph_node *mt) ...@@ -52,7 +52,7 @@ ipa_push_func_to_list (struct ipa_func_list **wl, struct cgraph_node *mt)
{ {
struct ipa_func_list *temp; struct ipa_func_list *temp;
temp = xcalloc (1, sizeof (struct ipa_func_list)); temp = XCNEW (struct ipa_func_list);
temp->node = mt; temp->node = mt;
temp->next = *wl; temp->next = *wl;
*wl = temp; *wl = temp;
......
...@@ -1954,7 +1954,7 @@ gen_var_name (tree orig_decl, unsigned HOST_WIDE_INT i) ...@@ -1954,7 +1954,7 @@ gen_var_name (tree orig_decl, unsigned HOST_WIDE_INT i)
appropriate new name for the new variable. */ appropriate new name for the new variable. */
old_name = IDENTIFIER_POINTER (DECL_NAME (orig_decl)); old_name = IDENTIFIER_POINTER (DECL_NAME (orig_decl));
prefix = alloca (strlen (old_name) + 1); prefix = XALLOCAVEC (char, strlen (old_name) + 1);
strcpy (prefix, old_name); strcpy (prefix, old_name);
ASM_FORMAT_PRIVATE_NAME (new_name, prefix, i); ASM_FORMAT_PRIVATE_NAME (new_name, prefix, i);
return get_identifier (new_name); return get_identifier (new_name);
...@@ -2827,7 +2827,7 @@ gen_cluster_name (tree decl, int clust_num, int str_num) ...@@ -2827,7 +2827,7 @@ gen_cluster_name (tree decl, int clust_num, int str_num)
ASM_FORMAT_PRIVATE_NAME(tmp_name, "struct", str_num); ASM_FORMAT_PRIVATE_NAME(tmp_name, "struct", str_num);
len = strlen (tmp_name ? tmp_name : orig_name) + strlen ("_sub"); len = strlen (tmp_name ? tmp_name : orig_name) + strlen ("_sub");
prefix = alloca (len + 1); prefix = XALLOCAVEC (char, len + 1);
memcpy (prefix, tmp_name ? tmp_name : orig_name, memcpy (prefix, tmp_name ? tmp_name : orig_name,
strlen (tmp_name ? tmp_name : orig_name)); strlen (tmp_name ? tmp_name : orig_name));
strcpy (prefix + strlen (tmp_name ? tmp_name : orig_name), "_sub"); strcpy (prefix + strlen (tmp_name ? tmp_name : orig_name), "_sub");
......
...@@ -806,7 +806,7 @@ update_equiv_regs (void) ...@@ -806,7 +806,7 @@ update_equiv_regs (void)
bitmap cleared_regs; bitmap cleared_regs;
reg_equiv = XCNEWVEC (struct equivalence, max_regno); reg_equiv = XCNEWVEC (struct equivalence, max_regno);
reg_equiv_init = ggc_alloc_cleared (max_regno * sizeof (rtx)); reg_equiv_init = GGC_CNEWVEC (rtx, max_regno);
reg_equiv_init_size = max_regno; reg_equiv_init_size = max_regno;
init_alias_analysis (); init_alias_analysis ();
......
...@@ -164,8 +164,7 @@ check_invariant_table_size (void) ...@@ -164,8 +164,7 @@ check_invariant_table_size (void)
if (invariant_table_size < DF_DEFS_TABLE_SIZE()) if (invariant_table_size < DF_DEFS_TABLE_SIZE())
{ {
unsigned int new_size = DF_DEFS_TABLE_SIZE () + (DF_DEFS_TABLE_SIZE () / 4); unsigned int new_size = DF_DEFS_TABLE_SIZE () + (DF_DEFS_TABLE_SIZE () / 4);
invariant_table = xrealloc (invariant_table, invariant_table = XRESIZEVEC (struct invariant *, invariant_table, new_size);
sizeof (struct rtx_iv *) * new_size);
memset (&invariant_table[invariant_table_size], 0, memset (&invariant_table[invariant_table_size], 0,
(new_size - invariant_table_size) * sizeof (struct rtx_iv *)); (new_size - invariant_table_size) * sizeof (struct rtx_iv *));
invariant_table_size = new_size; invariant_table_size = new_size;
...@@ -417,7 +416,8 @@ invariant_expr_equal_p (rtx insn1, rtx e1, rtx insn2, rtx e2) ...@@ -417,7 +416,8 @@ invariant_expr_equal_p (rtx insn1, rtx e1, rtx insn2, rtx e2)
static hashval_t static hashval_t
hash_invariant_expr (const void *e) hash_invariant_expr (const void *e)
{ {
const struct invariant_expr_entry *entry = e; const struct invariant_expr_entry *const entry =
(const struct invariant_expr_entry *) e;
return entry->hash; return entry->hash;
} }
...@@ -427,8 +427,10 @@ hash_invariant_expr (const void *e) ...@@ -427,8 +427,10 @@ hash_invariant_expr (const void *e)
static int static int
eq_invariant_expr (const void *e1, const void *e2) eq_invariant_expr (const void *e1, const void *e2)
{ {
const struct invariant_expr_entry *entry1 = e1; const struct invariant_expr_entry *const entry1 =
const struct invariant_expr_entry *entry2 = e2; (const struct invariant_expr_entry *) e1;
const struct invariant_expr_entry *const entry2 =
(const struct invariant_expr_entry *) e2;
if (entry1->mode != entry2->mode) if (entry1->mode != entry2->mode)
return 0; return 0;
...@@ -454,7 +456,7 @@ find_or_insert_inv (htab_t eq, rtx expr, enum machine_mode mode, ...@@ -454,7 +456,7 @@ find_or_insert_inv (htab_t eq, rtx expr, enum machine_mode mode,
pentry.inv = inv; pentry.inv = inv;
pentry.mode = mode; pentry.mode = mode;
slot = htab_find_slot_with_hash (eq, &pentry, hash, INSERT); slot = htab_find_slot_with_hash (eq, &pentry, hash, INSERT);
entry = *slot; entry = (struct invariant_expr_entry *) *slot;
if (entry) if (entry)
return entry->inv; return entry->inv;
......
...@@ -173,8 +173,7 @@ check_iv_ref_table_size (void) ...@@ -173,8 +173,7 @@ check_iv_ref_table_size (void)
if (iv_ref_table_size < DF_DEFS_TABLE_SIZE()) if (iv_ref_table_size < DF_DEFS_TABLE_SIZE())
{ {
unsigned int new_size = DF_DEFS_TABLE_SIZE () + (DF_DEFS_TABLE_SIZE () / 4); unsigned int new_size = DF_DEFS_TABLE_SIZE () + (DF_DEFS_TABLE_SIZE () / 4);
iv_ref_table = xrealloc (iv_ref_table, iv_ref_table = XRESIZEVEC (struct rtx_iv *, iv_ref_table, new_size);
sizeof (struct rtx_iv *) * new_size);
memset (&iv_ref_table[iv_ref_table_size], 0, memset (&iv_ref_table[iv_ref_table_size], 0,
(new_size - iv_ref_table_size) * sizeof (struct rtx_iv *)); (new_size - iv_ref_table_size) * sizeof (struct rtx_iv *));
iv_ref_table_size = new_size; iv_ref_table_size = new_size;
...@@ -819,7 +818,8 @@ record_iv (struct df_ref *def, struct rtx_iv *iv) ...@@ -819,7 +818,8 @@ record_iv (struct df_ref *def, struct rtx_iv *iv)
static bool static bool
analyzed_for_bivness_p (rtx def, struct rtx_iv *iv) analyzed_for_bivness_p (rtx def, struct rtx_iv *iv)
{ {
struct biv_entry *biv = htab_find_with_hash (bivs, def, REGNO (def)); struct biv_entry *biv =
(struct biv_entry *) htab_find_with_hash (bivs, def, REGNO (def));
if (!biv) if (!biv)
return false; return false;
...@@ -1304,7 +1304,7 @@ altered_reg_used (rtx *reg, void *alt) ...@@ -1304,7 +1304,7 @@ altered_reg_used (rtx *reg, void *alt)
if (!REG_P (*reg)) if (!REG_P (*reg))
return 0; return 0;
return REGNO_REG_SET_P (alt, REGNO (*reg)); return REGNO_REG_SET_P ((bitmap) alt, REGNO (*reg));
} }
/* Marks registers altered by EXPR in set ALT. */ /* Marks registers altered by EXPR in set ALT. */
...@@ -1317,7 +1317,7 @@ mark_altered (rtx expr, const_rtx by ATTRIBUTE_UNUSED, void *alt) ...@@ -1317,7 +1317,7 @@ mark_altered (rtx expr, const_rtx by ATTRIBUTE_UNUSED, void *alt)
if (!REG_P (expr)) if (!REG_P (expr))
return; return;
SET_REGNO_REG_SET (alt, REGNO (expr)); SET_REGNO_REG_SET ((bitmap) alt, REGNO (expr));
} }
/* Checks whether RHS is simple enough to process. */ /* Checks whether RHS is simple enough to process. */
......
...@@ -1491,8 +1491,8 @@ si_info_hash (const void *ivts) ...@@ -1491,8 +1491,8 @@ si_info_hash (const void *ivts)
static int static int
si_info_eq (const void *ivts1, const void *ivts2) si_info_eq (const void *ivts1, const void *ivts2)
{ {
const struct iv_to_split *i1 = ivts1; const struct iv_to_split *const i1 = (const struct iv_to_split *) ivts1;
const struct iv_to_split *i2 = ivts2; const struct iv_to_split *const i2 = (const struct iv_to_split *) ivts2;
return i1->insn == i2->insn; return i1->insn == i2->insn;
} }
...@@ -1511,8 +1511,8 @@ ve_info_hash (const void *ves) ...@@ -1511,8 +1511,8 @@ ve_info_hash (const void *ves)
static int static int
ve_info_eq (const void *ivts1, const void *ivts2) ve_info_eq (const void *ivts1, const void *ivts2)
{ {
const struct var_to_expand *i1 = ivts1; const struct var_to_expand *const i1 = (const struct var_to_expand *) ivts1;
const struct var_to_expand *i2 = ivts2; const struct var_to_expand *const i2 = (const struct var_to_expand *) ivts2;
return i1->insn == i2->insn; return i1->insn == i2->insn;
} }
...@@ -1867,7 +1867,7 @@ get_ivts_expr (rtx expr, struct iv_to_split *ivts) ...@@ -1867,7 +1867,7 @@ get_ivts_expr (rtx expr, struct iv_to_split *ivts)
static int static int
allocate_basic_variable (void **slot, void *data ATTRIBUTE_UNUSED) allocate_basic_variable (void **slot, void *data ATTRIBUTE_UNUSED)
{ {
struct iv_to_split *ivts = *slot; struct iv_to_split *ivts = (struct iv_to_split *) *slot;
rtx expr = *get_ivts_expr (single_set (ivts->insn), ivts); rtx expr = *get_ivts_expr (single_set (ivts->insn), ivts);
ivts->base_var = gen_reg_rtx (GET_MODE (expr)); ivts->base_var = gen_reg_rtx (GET_MODE (expr));
...@@ -2040,7 +2040,7 @@ expand_var_during_unrolling (struct var_to_expand *ve, rtx insn) ...@@ -2040,7 +2040,7 @@ expand_var_during_unrolling (struct var_to_expand *ve, rtx insn)
static int static int
insert_var_expansion_initialization (void **slot, void *place_p) insert_var_expansion_initialization (void **slot, void *place_p)
{ {
struct var_to_expand *ve = *slot; struct var_to_expand *ve = (struct var_to_expand *) *slot;
basic_block place = (basic_block)place_p; basic_block place = (basic_block)place_p;
rtx seq, var, zero_init, insn; rtx seq, var, zero_init, insn;
unsigned i; unsigned i;
...@@ -2088,7 +2088,7 @@ insert_var_expansion_initialization (void **slot, void *place_p) ...@@ -2088,7 +2088,7 @@ insert_var_expansion_initialization (void **slot, void *place_p)
static int static int
combine_var_copies_in_loop_exit (void **slot, void *place_p) combine_var_copies_in_loop_exit (void **slot, void *place_p)
{ {
struct var_to_expand *ve = *slot; struct var_to_expand *ve = (struct var_to_expand *) *slot;
basic_block place = (basic_block)place_p; basic_block place = (basic_block)place_p;
rtx sum = ve->reg; rtx sum = ve->reg;
rtx expr, seq, var, insn; rtx expr, seq, var, insn;
...@@ -2181,7 +2181,8 @@ apply_opt_in_copies (struct opt_info *opt_info, ...@@ -2181,7 +2181,8 @@ apply_opt_in_copies (struct opt_info *opt_info,
/* Apply splitting iv optimization. */ /* Apply splitting iv optimization. */
if (opt_info->insns_to_split) if (opt_info->insns_to_split)
{ {
ivts = htab_find (opt_info->insns_to_split, &ivts_templ); ivts = (struct iv_to_split *)
htab_find (opt_info->insns_to_split, &ivts_templ);
if (ivts) if (ivts)
{ {
...@@ -2196,7 +2197,8 @@ apply_opt_in_copies (struct opt_info *opt_info, ...@@ -2196,7 +2197,8 @@ apply_opt_in_copies (struct opt_info *opt_info,
/* Apply variable expansion optimization. */ /* Apply variable expansion optimization. */
if (unrolling && opt_info->insns_with_var_to_expand) if (unrolling && opt_info->insns_with_var_to_expand)
{ {
ves = htab_find (opt_info->insns_with_var_to_expand, &ve_templ); ves = (struct var_to_expand *)
htab_find (opt_info->insns_with_var_to_expand, &ve_templ);
if (ves) if (ves)
{ {
gcc_assert (GET_CODE (PATTERN (insn)) gcc_assert (GET_CODE (PATTERN (insn))
...@@ -2246,7 +2248,8 @@ apply_opt_in_copies (struct opt_info *opt_info, ...@@ -2246,7 +2248,8 @@ apply_opt_in_copies (struct opt_info *opt_info,
ivts_templ.insn = orig_insn; ivts_templ.insn = orig_insn;
if (opt_info->insns_to_split) if (opt_info->insns_to_split)
{ {
ivts = htab_find (opt_info->insns_to_split, &ivts_templ); ivts = (struct iv_to_split *)
htab_find (opt_info->insns_to_split, &ivts_templ);
if (ivts) if (ivts)
{ {
if (!delta) if (!delta)
...@@ -2266,7 +2269,7 @@ apply_opt_in_copies (struct opt_info *opt_info, ...@@ -2266,7 +2269,7 @@ apply_opt_in_copies (struct opt_info *opt_info,
static int static int
release_var_copies (void **slot, void *data ATTRIBUTE_UNUSED) release_var_copies (void **slot, void *data ATTRIBUTE_UNUSED)
{ {
struct var_to_expand *ve = *slot; struct var_to_expand *ve = (struct var_to_expand *) *slot;
VEC_free (rtx, heap, ve->var_expansions); VEC_free (rtx, heap, ve->var_expansions);
......
...@@ -358,7 +358,8 @@ static bool check_transpose_p; ...@@ -358,7 +358,8 @@ static bool check_transpose_p;
static hashval_t static hashval_t
mat_acc_phi_hash (const void *p) mat_acc_phi_hash (const void *p)
{ {
const struct matrix_access_phi_node *ma_phi = p; const struct matrix_access_phi_node *const ma_phi =
(const struct matrix_access_phi_node *) p;
return htab_hash_pointer (ma_phi->phi); return htab_hash_pointer (ma_phi->phi);
} }
...@@ -368,8 +369,10 @@ mat_acc_phi_hash (const void *p) ...@@ -368,8 +369,10 @@ mat_acc_phi_hash (const void *p)
static int static int
mat_acc_phi_eq (const void *p1, const void *p2) mat_acc_phi_eq (const void *p1, const void *p2)
{ {
const struct matrix_access_phi_node *phi1 = p1; const struct matrix_access_phi_node *const phi1 =
const struct matrix_access_phi_node *phi2 = p2; (const struct matrix_access_phi_node *) p1;
const struct matrix_access_phi_node *const phi2 =
(const struct matrix_access_phi_node *) p2;
if (phi1->phi == phi2->phi) if (phi1->phi == phi2->phi)
return 1; return 1;
...@@ -397,8 +400,8 @@ mtt_info_hash (const void *mtt) ...@@ -397,8 +400,8 @@ mtt_info_hash (const void *mtt)
static int static int
mtt_info_eq (const void *mtt1, const void *mtt2) mtt_info_eq (const void *mtt1, const void *mtt2)
{ {
const struct matrix_info *i1 = mtt1; const struct matrix_info *const i1 = (const struct matrix_info *) mtt1;
const struct matrix_info *i2 = mtt2; const struct matrix_info *const i2 = (const struct matrix_info *) mtt2;
if (i1->decl == i2->decl) if (i1->decl == i2->decl)
return true; return true;
...@@ -521,7 +524,7 @@ analyze_matrix_decl (tree var_decl) ...@@ -521,7 +524,7 @@ analyze_matrix_decl (tree var_decl)
/* Check to see if this pointer is already in there. */ /* Check to see if this pointer is already in there. */
tmpmi.decl = var_decl; tmpmi.decl = var_decl;
mi = htab_find (matrices_to_reorg, &tmpmi); mi = (struct matrix_info *) htab_find (matrices_to_reorg, &tmpmi);
if (mi) if (mi)
return NULL; return NULL;
...@@ -738,13 +741,13 @@ add_allocation_site (struct matrix_info *mi, tree stmt, int level) ...@@ -738,13 +741,13 @@ add_allocation_site (struct matrix_info *mi, tree stmt, int level)
calls like calloc and realloc. */ calls like calloc and realloc. */
if (!mi->malloc_for_level) if (!mi->malloc_for_level)
{ {
mi->malloc_for_level = xcalloc (level + 1, sizeof (tree)); mi->malloc_for_level = XCNEWVEC (tree, level + 1);
mi->max_malloced_level = level + 1; mi->max_malloced_level = level + 1;
} }
else if (mi->max_malloced_level <= level) else if (mi->max_malloced_level <= level)
{ {
mi->malloc_for_level mi->malloc_for_level
= xrealloc (mi->malloc_for_level, (level + 1) * sizeof (tree)); = XRESIZEVEC (tree, mi->malloc_for_level, level + 1);
/* Zero the newly allocated items. */ /* Zero the newly allocated items. */
memset (&(mi->malloc_for_level[mi->max_malloced_level + 1]), memset (&(mi->malloc_for_level[mi->max_malloced_level + 1]),
...@@ -879,7 +882,7 @@ analyze_matrix_allocation_site (struct matrix_info *mi, tree stmt, ...@@ -879,7 +882,7 @@ analyze_matrix_allocation_site (struct matrix_info *mi, tree stmt,
static int static int
analyze_transpose (void **slot, void *data ATTRIBUTE_UNUSED) analyze_transpose (void **slot, void *data ATTRIBUTE_UNUSED)
{ {
struct matrix_info *mi = *slot; struct matrix_info *mi = (struct matrix_info *) *slot;
int min_escape_l = mi->min_indirect_level_escape; int min_escape_l = mi->min_indirect_level_escape;
struct loop *loop; struct loop *loop;
affine_iv iv; affine_iv iv;
...@@ -1079,7 +1082,8 @@ analyze_accesses_for_phi_node (struct matrix_info *mi, tree use_stmt, ...@@ -1079,7 +1082,8 @@ analyze_accesses_for_phi_node (struct matrix_info *mi, tree use_stmt,
struct matrix_access_phi_node tmp_maphi, *maphi, **pmaphi; struct matrix_access_phi_node tmp_maphi, *maphi, **pmaphi;
tmp_maphi.phi = use_stmt; tmp_maphi.phi = use_stmt;
if ((maphi = htab_find (htab_mat_acc_phi_nodes, &tmp_maphi))) if ((maphi = (struct matrix_access_phi_node *)
htab_find (htab_mat_acc_phi_nodes, &tmp_maphi)))
{ {
if (maphi->indirection_level == current_indirect_level) if (maphi->indirection_level == current_indirect_level)
return; return;
...@@ -1358,7 +1362,7 @@ check_var_notmodified_p (tree * tp, int *walk_subtrees, void *data) ...@@ -1358,7 +1362,7 @@ check_var_notmodified_p (tree * tp, int *walk_subtrees, void *data)
{ {
basic_block bb; basic_block bb;
tree t = *tp; tree t = *tp;
tree fn = data; tree fn = (tree) data;
block_stmt_iterator bsi; block_stmt_iterator bsi;
tree stmt; tree stmt;
...@@ -1482,7 +1486,7 @@ check_allocation_function (void **slot, void *data ATTRIBUTE_UNUSED) ...@@ -1482,7 +1486,7 @@ check_allocation_function (void **slot, void *data ATTRIBUTE_UNUSED)
int level; int level;
block_stmt_iterator bsi; block_stmt_iterator bsi;
basic_block bb_level_0; basic_block bb_level_0;
struct matrix_info *mi = *slot; struct matrix_info *mi = (struct matrix_info *) *slot;
sbitmap visited; sbitmap visited;
if (!mi->malloc_for_level) if (!mi->malloc_for_level)
...@@ -1587,7 +1591,8 @@ find_sites_in_func (bool record) ...@@ -1587,7 +1591,8 @@ find_sites_in_func (bool record)
&& TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == VAR_DECL) && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == VAR_DECL)
{ {
tmpmi.decl = GIMPLE_STMT_OPERAND (stmt, 0); tmpmi.decl = GIMPLE_STMT_OPERAND (stmt, 0);
if ((mi = htab_find (matrices_to_reorg, &tmpmi))) if ((mi = (struct matrix_info *) htab_find (matrices_to_reorg,
&tmpmi)))
{ {
sbitmap_zero (visited_stmts_1); sbitmap_zero (visited_stmts_1);
analyze_matrix_allocation_site (mi, stmt, 0, visited_stmts_1); analyze_matrix_allocation_site (mi, stmt, 0, visited_stmts_1);
...@@ -1598,7 +1603,8 @@ find_sites_in_func (bool record) ...@@ -1598,7 +1603,8 @@ find_sites_in_func (bool record)
&& TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == VAR_DECL) && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == VAR_DECL)
{ {
tmpmi.decl = GIMPLE_STMT_OPERAND (stmt, 1); tmpmi.decl = GIMPLE_STMT_OPERAND (stmt, 1);
if ((mi = htab_find (matrices_to_reorg, &tmpmi))) if ((mi = (struct matrix_info *) htab_find (matrices_to_reorg,
&tmpmi)))
{ {
sbitmap_zero (visited_stmts_1); sbitmap_zero (visited_stmts_1);
analyze_matrix_accesses (mi, analyze_matrix_accesses (mi,
...@@ -1645,7 +1651,7 @@ record_all_accesses_in_func (void) ...@@ -1645,7 +1651,7 @@ record_all_accesses_in_func (void)
chain for this SSA_VAR and check for escapes or apply the chain for this SSA_VAR and check for escapes or apply the
flattening. */ flattening. */
tmpmi.decl = rhs; tmpmi.decl = rhs;
if ((mi = htab_find (matrices_to_reorg, &tmpmi))) if ((mi = (struct matrix_info *) htab_find (matrices_to_reorg, &tmpmi)))
{ {
/* This variable will track the visited PHI nodes, so we can limit /* This variable will track the visited PHI nodes, so we can limit
its size to the maximum number of SSA names. */ its size to the maximum number of SSA names. */
...@@ -1714,7 +1720,7 @@ static int ...@@ -1714,7 +1720,7 @@ static int
transform_access_sites (void **slot, void *data ATTRIBUTE_UNUSED) transform_access_sites (void **slot, void *data ATTRIBUTE_UNUSED)
{ {
block_stmt_iterator bsi; block_stmt_iterator bsi;
struct matrix_info *mi = *slot; struct matrix_info *mi = (struct matrix_info *) *slot;
int min_escape_l = mi->min_indirect_level_escape; int min_escape_l = mi->min_indirect_level_escape;
struct access_site_info *acc_info; struct access_site_info *acc_info;
int i; int i;
...@@ -1942,7 +1948,7 @@ transform_allocation_sites (void **slot, void *data ATTRIBUTE_UNUSED) ...@@ -1942,7 +1948,7 @@ transform_allocation_sites (void **slot, void *data ATTRIBUTE_UNUSED)
int min_escape_l; int min_escape_l;
int id; int id;
mi = *slot; mi = (struct matrix_info *) *slot;
min_escape_l = mi->min_indirect_level_escape; min_escape_l = mi->min_indirect_level_escape;
...@@ -2184,7 +2190,7 @@ transform_allocation_sites (void **slot, void *data ATTRIBUTE_UNUSED) ...@@ -2184,7 +2190,7 @@ transform_allocation_sites (void **slot, void *data ATTRIBUTE_UNUSED)
static int static int
dump_matrix_reorg_analysis (void **slot, void *data ATTRIBUTE_UNUSED) dump_matrix_reorg_analysis (void **slot, void *data ATTRIBUTE_UNUSED)
{ {
struct matrix_info *mi = *slot; struct matrix_info *mi = (struct matrix_info *) *slot;
if (!dump_file) if (!dump_file)
return 1; return 1;
......
...@@ -1097,7 +1097,7 @@ debug_all_omp_regions (void) ...@@ -1097,7 +1097,7 @@ debug_all_omp_regions (void)
struct omp_region * struct omp_region *
new_omp_region (basic_block bb, enum tree_code type, struct omp_region *parent) new_omp_region (basic_block bb, enum tree_code type, struct omp_region *parent)
{ {
struct omp_region *region = xcalloc (1, sizeof (*region)); struct omp_region *region = XCNEW (struct omp_region);
region->outer = parent; region->outer = parent;
region->entry = bb; region->entry = bb;
...@@ -1493,7 +1493,7 @@ create_omp_child_function_name (bool task_copy) ...@@ -1493,7 +1493,7 @@ create_omp_child_function_name (bool task_copy)
const char *suffix; const char *suffix;
suffix = task_copy ? "_omp_cpyfn" : "_omp_fn"; suffix = task_copy ? "_omp_cpyfn" : "_omp_fn";
prefix = alloca (len + strlen (suffix) + 1); prefix = XALLOCAVEC (char, len + strlen (suffix) + 1);
memcpy (prefix, IDENTIFIER_POINTER (name), len); memcpy (prefix, IDENTIFIER_POINTER (name), len);
strcpy (prefix + len, suffix); strcpy (prefix + len, suffix);
#ifndef NO_DOT_IN_LABEL #ifndef NO_DOT_IN_LABEL
...@@ -1853,8 +1853,8 @@ check_omp_nesting_restrictions (tree t, omp_context *ctx) ...@@ -1853,8 +1853,8 @@ check_omp_nesting_restrictions (tree t, omp_context *ctx)
static tree static tree
scan_omp_1 (tree *tp, int *walk_subtrees, void *data) scan_omp_1 (tree *tp, int *walk_subtrees, void *data)
{ {
struct walk_stmt_info *wi = data; struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
omp_context *ctx = wi->info; omp_context *ctx = (omp_context *) wi->info;
tree t = *tp; tree t = *tp;
if (EXPR_HAS_LOCATION (t)) if (EXPR_HAS_LOCATION (t))
...@@ -5800,8 +5800,8 @@ lower_omp_for (tree *stmt_p, omp_context *ctx) ...@@ -5800,8 +5800,8 @@ lower_omp_for (tree *stmt_p, omp_context *ctx)
static tree static tree
check_combined_parallel (tree *tp, int *walk_subtrees, void *data) check_combined_parallel (tree *tp, int *walk_subtrees, void *data)
{ {
struct walk_stmt_info *wi = data; struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
int *info = wi->info; int *info = (int *) wi->info;
*walk_subtrees = 0; *walk_subtrees = 0;
switch (TREE_CODE (*tp)) switch (TREE_CODE (*tp))
...@@ -6194,7 +6194,7 @@ static tree ...@@ -6194,7 +6194,7 @@ static tree
lower_omp_2 (tree *tp, int *walk_subtrees, void *data) lower_omp_2 (tree *tp, int *walk_subtrees, void *data)
{ {
tree t = *tp; tree t = *tp;
omp_context *ctx = data; omp_context *ctx = (omp_context *) data;
/* Any variable with DECL_VALUE_EXPR needs to be regimplified. */ /* Any variable with DECL_VALUE_EXPR needs to be regimplified. */
if (TREE_CODE (t) == VAR_DECL if (TREE_CODE (t) == VAR_DECL
...@@ -6470,7 +6470,7 @@ diagnose_sb_0 (tree *stmt_p, tree branch_ctx, tree label_ctx) ...@@ -6470,7 +6470,7 @@ diagnose_sb_0 (tree *stmt_p, tree branch_ctx, tree label_ctx)
static tree static tree
diagnose_sb_1 (tree *tp, int *walk_subtrees, void *data) diagnose_sb_1 (tree *tp, int *walk_subtrees, void *data)
{ {
struct walk_stmt_info *wi = data; struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
tree context = (tree) wi->info; tree context = (tree) wi->info;
tree inner_context; tree inner_context;
tree t = *tp; tree t = *tp;
...@@ -6532,7 +6532,7 @@ diagnose_sb_1 (tree *tp, int *walk_subtrees, void *data) ...@@ -6532,7 +6532,7 @@ diagnose_sb_1 (tree *tp, int *walk_subtrees, void *data)
static tree static tree
diagnose_sb_2 (tree *tp, int *walk_subtrees, void *data) diagnose_sb_2 (tree *tp, int *walk_subtrees, void *data)
{ {
struct walk_stmt_info *wi = data; struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
tree context = (tree) wi->info; tree context = (tree) wi->info;
splay_tree_node n; splay_tree_node n;
tree t = *tp; tree t = *tp;
......
...@@ -3801,7 +3801,7 @@ struct no_conflict_data ...@@ -3801,7 +3801,7 @@ struct no_conflict_data
static void static void
no_conflict_move_test (rtx dest, const_rtx set, void *p0) no_conflict_move_test (rtx dest, const_rtx set, void *p0)
{ {
struct no_conflict_data *p= p0; struct no_conflict_data *p= (struct no_conflict_data *) p0;
/* If this inns directly contributes to setting the target, it must stay. */ /* If this inns directly contributes to setting the target, it must stay. */
if (reg_overlap_mentioned_p (p->target, dest)) if (reg_overlap_mentioned_p (p->target, dest))
...@@ -5463,7 +5463,7 @@ gen_libfunc (optab optable, const char *opname, int suffix, enum machine_mode mo ...@@ -5463,7 +5463,7 @@ gen_libfunc (optab optable, const char *opname, int suffix, enum machine_mode mo
unsigned opname_len = strlen (opname); unsigned opname_len = strlen (opname);
const char *mname = GET_MODE_NAME (mode); const char *mname = GET_MODE_NAME (mode);
unsigned mname_len = strlen (mname); unsigned mname_len = strlen (mname);
char *libfunc_name = alloca (2 + opname_len + mname_len + 1 + 1); char *libfunc_name = XALLOCAVEC (char, 2 + opname_len + mname_len + 1 + 1);
char *p; char *p;
const char *q; const char *q;
...@@ -5511,7 +5511,7 @@ gen_fp_libfunc (optab optable, const char *opname, char suffix, ...@@ -5511,7 +5511,7 @@ gen_fp_libfunc (optab optable, const char *opname, char suffix,
gen_libfunc (optable, opname, suffix, mode); gen_libfunc (optable, opname, suffix, mode);
if (DECIMAL_FLOAT_MODE_P (mode)) if (DECIMAL_FLOAT_MODE_P (mode))
{ {
dec_opname = alloca (sizeof (DECIMAL_PREFIX) + strlen (opname)); dec_opname = XALLOCAVEC (char, sizeof (DECIMAL_PREFIX) + strlen (opname));
/* For BID support, change the name to have either a bid_ or dpd_ prefix /* For BID support, change the name to have either a bid_ or dpd_ prefix
depending on the low level floating format used. */ depending on the low level floating format used. */
memcpy (dec_opname, DECIMAL_PREFIX, sizeof (DECIMAL_PREFIX) - 1); memcpy (dec_opname, DECIMAL_PREFIX, sizeof (DECIMAL_PREFIX) - 1);
...@@ -5579,7 +5579,7 @@ gen_intv_fp_libfunc (optab optable, const char *name, char suffix, ...@@ -5579,7 +5579,7 @@ gen_intv_fp_libfunc (optab optable, const char *name, char suffix,
if (GET_MODE_CLASS (mode) == MODE_INT) if (GET_MODE_CLASS (mode) == MODE_INT)
{ {
int len = strlen (name); int len = strlen (name);
char *v_name = alloca (len + 2); char *v_name = XALLOCAVEC (char, len + 2);
strcpy (v_name, name); strcpy (v_name, name);
v_name[len] = 'v'; v_name[len] = 'v';
v_name[len + 1] = 0; v_name[len + 1] = 0;
...@@ -5683,13 +5683,13 @@ gen_interclass_conv_libfunc (convert_optab tab, ...@@ -5683,13 +5683,13 @@ gen_interclass_conv_libfunc (convert_optab tab,
mname_len = strlen (GET_MODE_NAME (tmode)) + strlen (GET_MODE_NAME (fmode)); mname_len = strlen (GET_MODE_NAME (tmode)) + strlen (GET_MODE_NAME (fmode));
nondec_name = alloca (2 + opname_len + mname_len + 1 + 1); nondec_name = XALLOCAVEC (char, 2 + opname_len + mname_len + 1 + 1);
nondec_name[0] = '_'; nondec_name[0] = '_';
nondec_name[1] = '_'; nondec_name[1] = '_';
memcpy (&nondec_name[2], opname, opname_len); memcpy (&nondec_name[2], opname, opname_len);
nondec_suffix = nondec_name + opname_len + 2; nondec_suffix = nondec_name + opname_len + 2;
dec_name = alloca (2 + dec_len + opname_len + mname_len + 1 + 1); dec_name = XALLOCAVEC (char, 2 + dec_len + opname_len + mname_len + 1 + 1);
dec_name[0] = '_'; dec_name[0] = '_';
dec_name[1] = '_'; dec_name[1] = '_';
memcpy (&dec_name[2], DECIMAL_PREFIX, dec_len); memcpy (&dec_name[2], DECIMAL_PREFIX, dec_len);
...@@ -5808,13 +5808,13 @@ gen_intraclass_conv_libfunc (convert_optab tab, const char *opname, ...@@ -5808,13 +5808,13 @@ gen_intraclass_conv_libfunc (convert_optab tab, const char *opname,
mname_len = strlen (GET_MODE_NAME (tmode)) + strlen (GET_MODE_NAME (fmode)); mname_len = strlen (GET_MODE_NAME (tmode)) + strlen (GET_MODE_NAME (fmode));
nondec_name = alloca (2 + opname_len + mname_len + 1 + 1); nondec_name = XALLOCAVEC (char, 2 + opname_len + mname_len + 1 + 1);
nondec_name[0] = '_'; nondec_name[0] = '_';
nondec_name[1] = '_'; nondec_name[1] = '_';
memcpy (&nondec_name[2], opname, opname_len); memcpy (&nondec_name[2], opname, opname_len);
nondec_suffix = nondec_name + opname_len + 2; nondec_suffix = nondec_name + opname_len + 2;
dec_name = alloca (2 + dec_len + opname_len + mname_len + 1 + 1); dec_name = XALLOCAVEC (char, 2 + dec_len + opname_len + mname_len + 1 + 1);
dec_name[0] = '_'; dec_name[0] = '_';
dec_name[1] = '_'; dec_name[1] = '_';
memcpy (&dec_name[2], DECIMAL_PREFIX, dec_len); memcpy (&dec_name[2], DECIMAL_PREFIX, dec_len);
...@@ -6026,7 +6026,7 @@ set_optab_libfunc (optab optable, enum machine_mode mode, const char *name) ...@@ -6026,7 +6026,7 @@ set_optab_libfunc (optab optable, enum machine_mode mode, const char *name)
val = 0; val = 0;
slot = (struct libfunc_entry **) htab_find_slot (libfunc_hash, &e, INSERT); slot = (struct libfunc_entry **) htab_find_slot (libfunc_hash, &e, INSERT);
if (*slot == NULL) if (*slot == NULL)
*slot = ggc_alloc (sizeof (struct libfunc_entry)); *slot = GGC_NEW (struct libfunc_entry);
(*slot)->optab = (size_t) (optable - &optab_table[0]); (*slot)->optab = (size_t) (optable - &optab_table[0]);
(*slot)->mode1 = mode; (*slot)->mode1 = mode;
(*slot)->mode2 = VOIDmode; (*slot)->mode2 = VOIDmode;
...@@ -6053,7 +6053,7 @@ set_conv_libfunc (convert_optab optable, enum machine_mode tmode, ...@@ -6053,7 +6053,7 @@ set_conv_libfunc (convert_optab optable, enum machine_mode tmode,
val = 0; val = 0;
slot = (struct libfunc_entry **) htab_find_slot (libfunc_hash, &e, INSERT); slot = (struct libfunc_entry **) htab_find_slot (libfunc_hash, &e, INSERT);
if (*slot == NULL) if (*slot == NULL)
*slot = ggc_alloc (sizeof (struct libfunc_entry)); *slot = GGC_NEW (struct libfunc_entry);
(*slot)->optab = (size_t) (optable - &convert_optab_table[0]); (*slot)->optab = (size_t) (optable - &convert_optab_table[0]);
(*slot)->mode1 = tmode; (*slot)->mode1 = tmode;
(*slot)->mode2 = fmode; (*slot)->mode2 = fmode;
......
...@@ -131,8 +131,8 @@ void ...@@ -131,8 +131,8 @@ void
prune_options (int *argcp, char ***argvp) prune_options (int *argcp, char ***argvp)
{ {
int argc = *argcp; int argc = *argcp;
int *options = xmalloc (argc * sizeof (*options)); int *options = XNEWVEC (int, argc);
char **argv = xmalloc (argc * sizeof (char *)); char **argv = XNEWVEC (char *, argc);
int i, arg_count, need_prune = 0; int i, arg_count, need_prune = 0;
const struct cl_option *option; const struct cl_option *option;
size_t opt_index; size_t opt_index;
......
...@@ -651,7 +651,7 @@ static void ...@@ -651,7 +651,7 @@ static void
add_input_filename (const char *filename) add_input_filename (const char *filename)
{ {
num_in_fnames++; num_in_fnames++;
in_fnames = xrealloc (in_fnames, num_in_fnames * sizeof (in_fnames[0])); in_fnames = XRESIZEVEC (const char *, in_fnames, num_in_fnames);
in_fnames[num_in_fnames - 1] = filename; in_fnames[num_in_fnames - 1] = filename;
} }
...@@ -1134,7 +1134,7 @@ print_filtered_help (unsigned int include_flags, ...@@ -1134,7 +1134,7 @@ print_filtered_help (unsigned int include_flags,
} }
if (!printed) if (!printed)
printed = xcalloc (1, cl_options_count); printed = XCNEWVAR (char, cl_options_count);
for (i = 0; i < cl_options_count; i++) for (i = 0; i < cl_options_count; i++)
{ {
...@@ -2143,7 +2143,7 @@ get_option_state (int option, struct cl_option_state *state) ...@@ -2143,7 +2143,7 @@ get_option_state (int option, struct cl_option_state *state)
state->data = *(const char **) cl_options[option].flag_var; state->data = *(const char **) cl_options[option].flag_var;
if (state->data == 0) if (state->data == 0)
state->data = ""; state->data = "";
state->size = strlen (state->data) + 1; state->size = strlen ((const char *) state->data) + 1;
break; break;
} }
return true; return true;
......
...@@ -40,8 +40,8 @@ void ...@@ -40,8 +40,8 @@ void
add_params (const param_info params[], size_t n) add_params (const param_info params[], size_t n)
{ {
/* Allocate enough space for the new parameters. */ /* Allocate enough space for the new parameters. */
compiler_params = xrealloc (compiler_params, compiler_params = XRESIZEVEC (param_info, compiler_params,
(num_compiler_params + n) * sizeof (param_info)); num_compiler_params + n);
/* Copy them into the table. */ /* Copy them into the table. */
memcpy (compiler_params + num_compiler_params, memcpy (compiler_params + num_compiler_params,
params, params,
......
...@@ -346,7 +346,7 @@ set_pass_for_id (int id, struct opt_pass *pass) ...@@ -346,7 +346,7 @@ set_pass_for_id (int id, struct opt_pass *pass)
pass->static_pass_number = id; pass->static_pass_number = id;
if (passes_by_id_size <= id) if (passes_by_id_size <= id)
{ {
passes_by_id = xrealloc (passes_by_id, (id + 1) * sizeof (void *)); passes_by_id = XRESIZEVEC (struct opt_pass *, passes_by_id, id + 1);
memset (passes_by_id + passes_by_id_size, 0, memset (passes_by_id + passes_by_id_size, 0,
(id + 1 - passes_by_id_size) * sizeof (void *)); (id + 1 - passes_by_id_size) * sizeof (void *));
passes_by_id_size = id + 1; passes_by_id_size = id + 1;
...@@ -449,7 +449,7 @@ next_pass_1 (struct opt_pass **list, struct opt_pass *pass) ...@@ -449,7 +449,7 @@ next_pass_1 (struct opt_pass **list, struct opt_pass *pass)
{ {
struct opt_pass *new; struct opt_pass *new;
new = xmalloc (sizeof (*new)); new = XNEW (struct opt_pass);
memcpy (new, pass, sizeof (*new)); memcpy (new, pass, sizeof (*new));
new->next = NULL; new->next = NULL;
...@@ -884,7 +884,7 @@ do_per_function_toporder (void (*callback) (void *data), void *data) ...@@ -884,7 +884,7 @@ do_per_function_toporder (void (*callback) (void *data), void *data)
else else
{ {
gcc_assert (!order); gcc_assert (!order);
order = ggc_alloc (sizeof (*order) * cgraph_n_nodes); order = GGC_NEWVEC (struct cgraph_node *, cgraph_n_nodes);
nnodes = cgraph_postorder (order); nnodes = cgraph_postorder (order);
for (i = nnodes - 1; i >= 0; i--) for (i = nnodes - 1; i >= 0; i--)
{ {
...@@ -1150,7 +1150,7 @@ pass_fini_dump_file (struct opt_pass *pass) ...@@ -1150,7 +1150,7 @@ pass_fini_dump_file (struct opt_pass *pass)
static void static void
update_properties_after_pass (void *data) update_properties_after_pass (void *data)
{ {
struct opt_pass *pass = data; struct opt_pass *pass = (struct opt_pass *) data;
cfun->curr_properties = (cfun->curr_properties | pass->properties_provided) cfun->curr_properties = (cfun->curr_properties | pass->properties_provided)
& ~pass->properties_destroyed; & ~pass->properties_destroyed;
} }
......
...@@ -394,9 +394,9 @@ reload_cse_simplify_operands (rtx insn, rtx testreg) ...@@ -394,9 +394,9 @@ reload_cse_simplify_operands (rtx insn, rtx testreg)
if (! constrain_operands (1)) if (! constrain_operands (1))
fatal_insn_not_found (insn); fatal_insn_not_found (insn);
alternative_reject = alloca (recog_data.n_alternatives * sizeof (int)); alternative_reject = XALLOCAVEC (int, recog_data.n_alternatives);
alternative_nregs = alloca (recog_data.n_alternatives * sizeof (int)); alternative_nregs = XALLOCAVEC (int, recog_data.n_alternatives);
alternative_order = alloca (recog_data.n_alternatives * sizeof (int)); alternative_order = XALLOCAVEC (int, recog_data.n_alternatives);
memset (alternative_reject, 0, recog_data.n_alternatives * sizeof (int)); memset (alternative_reject, 0, recog_data.n_alternatives * sizeof (int));
memset (alternative_nregs, 0, recog_data.n_alternatives * sizeof (int)); memset (alternative_nregs, 0, recog_data.n_alternatives * sizeof (int));
...@@ -487,7 +487,7 @@ reload_cse_simplify_operands (rtx insn, rtx testreg) ...@@ -487,7 +487,7 @@ reload_cse_simplify_operands (rtx insn, rtx testreg)
int regno; int regno;
const char *p; const char *p;
op_alt_regno[i] = alloca (recog_data.n_alternatives * sizeof (int)); op_alt_regno[i] = XALLOCAVEC (int, recog_data.n_alternatives);
for (j = 0; j < recog_data.n_alternatives; j++) for (j = 0; j < recog_data.n_alternatives; j++)
op_alt_regno[i][j] = -1; op_alt_regno[i][j] = -1;
......
...@@ -211,7 +211,7 @@ tree_predicted_by_p (const_basic_block bb, enum br_predictor predictor) ...@@ -211,7 +211,7 @@ tree_predicted_by_p (const_basic_block bb, enum br_predictor predictor)
if (!preds) if (!preds)
return false; return false;
for (i = *preds; i; i = i->ep_next) for (i = (struct edge_prediction *) *preds; i; i = i->ep_next)
if (i->ep_predictor == predictor) if (i->ep_predictor == predictor)
return true; return true;
return false; return false;
...@@ -316,7 +316,7 @@ tree_predict_edge (edge e, enum br_predictor predictor, int probability) ...@@ -316,7 +316,7 @@ tree_predict_edge (edge e, enum br_predictor predictor, int probability)
struct edge_prediction *i = XNEW (struct edge_prediction); struct edge_prediction *i = XNEW (struct edge_prediction);
void **preds = pointer_map_insert (bb_predictions, e->src); void **preds = pointer_map_insert (bb_predictions, e->src);
i->ep_next = *preds; i->ep_next = (struct edge_prediction *) *preds;
*preds = i; *preds = i;
i->ep_probability = probability; i->ep_probability = probability;
i->ep_predictor = predictor; i->ep_predictor = predictor;
...@@ -366,7 +366,7 @@ clear_bb_predictions (basic_block bb) ...@@ -366,7 +366,7 @@ clear_bb_predictions (basic_block bb)
if (!preds) if (!preds)
return; return;
for (pred = *preds; pred; pred = next) for (pred = (struct edge_prediction *) *preds; pred; pred = next)
{ {
next = pred->ep_next; next = pred->ep_next;
free (pred); free (pred);
...@@ -638,7 +638,7 @@ combine_predictions_for_bb (basic_block bb) ...@@ -638,7 +638,7 @@ combine_predictions_for_bb (basic_block bb)
{ {
/* We implement "first match" heuristics and use probability guessed /* We implement "first match" heuristics and use probability guessed
by predictor with smallest index. */ by predictor with smallest index. */
for (pred = *preds; pred; pred = pred->ep_next) for (pred = (struct edge_prediction *) *preds; pred; pred = pred->ep_next)
{ {
int predictor = pred->ep_predictor; int predictor = pred->ep_predictor;
int probability = pred->ep_probability; int probability = pred->ep_probability;
...@@ -688,7 +688,7 @@ combine_predictions_for_bb (basic_block bb) ...@@ -688,7 +688,7 @@ combine_predictions_for_bb (basic_block bb)
if (preds) if (preds)
{ {
for (pred = *preds; pred; pred = pred->ep_next) for (pred = (struct edge_prediction *) *preds; pred; pred = pred->ep_next)
{ {
int predictor = pred->ep_predictor; int predictor = pred->ep_predictor;
int probability = pred->ep_probability; int probability = pred->ep_probability;
......
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