Commit 858904db by Gabriel Dos Reis Committed by Gabriel Dos Reis

tree-vn.c (vn_add): Use XNEW.

        * tree-vn.c (vn_add): Use XNEW.
        * tree-ssa-ccp.c (ccp_initialize): Use XNEWVEC.
        (ccp_fold): Likewise.
        (fold_stmt_r): Use explicit cast to convert from void *.
        * tree-outof-ssa.c (new_temp_expr_table): Use XCNEWVEC.
        (new_temp_expr_table): Likewise.
        * gimplify.c (lookup_tmp_var): Use XNEW.
        (gimplify_asm_expr): Use explcit cast to convert from void *.
        * tree-into-ssa.c (get_ssa_name_ann): Likewise.
        (get_def_blocks_for): Use XNEW.
        (add_to_repl_tbl): Likewise.
        (mark_def_sites): Use explicit cast to convert from void *.
        (def_blocks_free): Likewise.
        (mark_def_sites_initialize_block): Likewise.
        (update_ssa): Use XNEWVEC.
        * tree-dfa.c (create_var_ann): Use GGC_NEW.
        (create_stmt_ann): Likewise.
        (create_tree_ann): Likewise.
        (referenced_var_insert): Likewise.
        (set_default_def): Likewise.
        (referenced_var_lookup_if_exists): Use explicit cast to
        * convert
        from void *.
        (referenced_var_lookup): Likewise.
        (default_def): Likewise.
        (set_default_def): Likewise.
        * tree-cfg.c (create_bb): Likewise.
        (edge_to_cases_cleanup): Likewise.
        (verify_node_sharing): Likewise.
        (record_switch_edge): Use XNEW.
        (cleanup_dead_labels): Use XCNEWVEC.
        (tree_duplicate_sese_region): Use XNEWVEC.
        * tree-scalar-evolution.c (get_instantiated_value): Likewise.
        * tree-ssa.c (verify_ssa): Use XCNEWVEC.
        (int_tree_map_eq): Use explicit cast to convert from void *.
        * libgcov.c (gcov_exit): Use explicit cast to convert from
        * void *.
        (__gcov_execl): Likewise.
        (__gcov_execlp): Likewise.
        (__gcov_execle): Likewise.
        * tree-eh.c (struct_ptr_eq): Likewise.
        (struct_ptr_hash): Likewise.
        (lookup_stmt_eh_region_fn): Likewise.
        (outside_finally_tree): Likewise.
        (find_goto_replacement): Likewise.
        (make_eh_edge): Likewise.
        (mark_eh_edge): Likewise.
        (add_stmt_to_eh_region_fn): Use GGC_NEW.
        (record_in_finally_tree): Use XNEW.
        (maybe_record_in_goto_queue): Use XRESIZEVEC.
        (lower_try_finally_copy): Use XCNEWVEC.

From-SVN: r108736
parent 0e27ef71
...@@ -6,6 +6,58 @@ ...@@ -6,6 +6,58 @@
2005-12-17 Gabriel Dos Reis <gdr@integrable-solutions.net> 2005-12-17 Gabriel Dos Reis <gdr@integrable-solutions.net>
* tree-vn.c (vn_add): Use XNEW.
* tree-ssa-ccp.c (ccp_initialize): Use XNEWVEC.
(ccp_fold): Likewise.
(fold_stmt_r): Use explicit cast to convert from void *.
* tree-outof-ssa.c (new_temp_expr_table): Use XCNEWVEC.
(new_temp_expr_table): Likewise.
* gimplify.c (lookup_tmp_var): Use XNEW.
(gimplify_asm_expr): Use explcit cast to convert from void *.
* tree-into-ssa.c (get_ssa_name_ann): Likewise.
(get_def_blocks_for): Use XNEW.
(add_to_repl_tbl): Likewise.
(mark_def_sites): Use explicit cast to convert from void *.
(def_blocks_free): Likewise.
(mark_def_sites_initialize_block): Likewise.
(update_ssa): Use XNEWVEC.
* tree-dfa.c (create_var_ann): Use GGC_NEW.
(create_stmt_ann): Likewise.
(create_tree_ann): Likewise.
(referenced_var_insert): Likewise.
(set_default_def): Likewise.
(referenced_var_lookup_if_exists): Use explicit cast to convert
from void *.
(referenced_var_lookup): Likewise.
(default_def): Likewise.
(set_default_def): Likewise.
* tree-cfg.c (create_bb): Likewise.
(edge_to_cases_cleanup): Likewise.
(verify_node_sharing): Likewise.
(record_switch_edge): Use XNEW.
(cleanup_dead_labels): Use XCNEWVEC.
(tree_duplicate_sese_region): Use XNEWVEC.
* tree-scalar-evolution.c (get_instantiated_value): Likewise.
* tree-ssa.c (verify_ssa): Use XCNEWVEC.
(int_tree_map_eq): Use explicit cast to convert from void *.
* libgcov.c (gcov_exit): Use explicit cast to convert from void *.
(__gcov_execl): Likewise.
(__gcov_execlp): Likewise.
(__gcov_execle): Likewise.
* tree-eh.c (struct_ptr_eq): Likewise.
(struct_ptr_hash): Likewise.
(lookup_stmt_eh_region_fn): Likewise.
(outside_finally_tree): Likewise.
(find_goto_replacement): Likewise.
(make_eh_edge): Likewise.
(mark_eh_edge): Likewise.
(add_stmt_to_eh_region_fn): Use GGC_NEW.
(record_in_finally_tree): Use XNEW.
(maybe_record_in_goto_queue): Use XRESIZEVEC.
(lower_try_finally_copy): Use XCNEWVEC.
2005-12-17 Gabriel Dos Reis <gdr@integrable-solutions.net>
* tree-inline.c (copy_body_r): Use explicit cast when converting * tree-inline.c (copy_body_r): Use explicit cast when converting
from void *. from void *.
(copy_bb): Likewise. (copy_bb): Likewise.
......
...@@ -473,7 +473,7 @@ lookup_tmp_var (tree val, bool is_formal) ...@@ -473,7 +473,7 @@ lookup_tmp_var (tree val, bool is_formal)
slot = htab_find_slot (gimplify_ctxp->temp_htab, (void *)&elt, INSERT); slot = htab_find_slot (gimplify_ctxp->temp_htab, (void *)&elt, INSERT);
if (*slot == NULL) if (*slot == NULL)
{ {
elt_p = xmalloc (sizeof (*elt_p)); elt_p = XNEW (elt_t);
elt_p->val = val; elt_p->val = val;
elt_p->temp = ret = create_tmp_from_val (val); elt_p->temp = ret = create_tmp_from_val (val);
*slot = (void *) elt_p; *slot = (void *) elt_p;
...@@ -3705,7 +3705,7 @@ gimplify_asm_expr (tree *expr_p, tree *pre_p, tree *post_p) ...@@ -3705,7 +3705,7 @@ gimplify_asm_expr (tree *expr_p, tree *pre_p, tree *post_p)
break; break;
} }
str = alloca (len); str = (char *) alloca (len);
for (beg = p + 1, dst = str;;) for (beg = p + 1, dst = str;;)
{ {
const char *tem; const char *tem;
......
...@@ -218,7 +218,7 @@ gcov_exit (void) ...@@ -218,7 +218,7 @@ gcov_exit (void)
prefix_length = 0; prefix_length = 0;
/* Allocate and initialize the filename scratch space. */ /* Allocate and initialize the filename scratch space. */
gi_filename = alloca (prefix_length + gcov_max_filename + 1); gi_filename = (char *) alloca (prefix_length + gcov_max_filename + 1);
if (prefix_length) if (prefix_length)
memcpy (gi_filename, gcov_prefix, prefix_length); memcpy (gi_filename, gcov_prefix, prefix_length);
gi_filename_up = gi_filename + prefix_length; gi_filename_up = gi_filename + prefix_length;
...@@ -786,7 +786,7 @@ __gcov_execl (const char *path, const char *arg, ...) ...@@ -786,7 +786,7 @@ __gcov_execl (const char *path, const char *arg, ...)
length++; length++;
va_end (ap); va_end (ap);
args = alloca (length * sizeof (void *)); args = (char **) alloca (length * sizeof (void *));
args[0] = (char *) arg; args[0] = (char *) arg;
for (i = 1; i < length; i++) for (i = 1; i < length; i++)
args[i] = va_arg (aq, char *); args[i] = va_arg (aq, char *);
...@@ -817,7 +817,7 @@ __gcov_execlp (const char *path, const char *arg, ...) ...@@ -817,7 +817,7 @@ __gcov_execlp (const char *path, const char *arg, ...)
length++; length++;
va_end (ap); va_end (ap);
args = alloca (length * sizeof (void *)); args = (char **) alloca (length * sizeof (void *));
args[0] = (char *) arg; args[0] = (char *) arg;
for (i = 1; i < length; i++) for (i = 1; i < length; i++)
args[i] = va_arg (aq, char *); args[i] = va_arg (aq, char *);
...@@ -849,7 +849,7 @@ __gcov_execle (const char *path, const char *arg, ...) ...@@ -849,7 +849,7 @@ __gcov_execle (const char *path, const char *arg, ...)
length++; length++;
va_end (ap); va_end (ap);
args = alloca (length * sizeof (void *)); args = (char **) alloca (length * sizeof (void *));
args[0] = (char *) arg; args[0] = (char *) arg;
for (i = 1; i < length; i++) for (i = 1; i < length; i++)
args[i] = va_arg (aq, char *); args[i] = va_arg (aq, char *);
......
...@@ -374,7 +374,7 @@ create_bb (void *h, void *e, basic_block after) ...@@ -374,7 +374,7 @@ create_bb (void *h, void *e, basic_block after)
bb->index = last_basic_block; bb->index = last_basic_block;
bb->flags = BB_NEW; bb->flags = BB_NEW;
bb->stmt_list = h ? h : alloc_stmt_list (); bb->stmt_list = h ? (tree) h : alloc_stmt_list ();
/* Add the new block to the linked list of blocks. */ /* Add the new block to the linked list of blocks. */
link_block (bb, after); link_block (bb, after);
...@@ -640,7 +640,7 @@ edge_to_cases_eq (const void *p1, const void *p2) ...@@ -640,7 +640,7 @@ edge_to_cases_eq (const void *p1, const void *p2)
static void static void
edge_to_cases_cleanup (void *p) edge_to_cases_cleanup (void *p)
{ {
struct edge_to_cases_elt *elt = p; struct edge_to_cases_elt *elt = (struct edge_to_cases_elt *) p;
tree t, next; tree t, next;
for (t = elt->case_labels; t; t = next) for (t = elt->case_labels; t; t = next)
...@@ -691,7 +691,7 @@ record_switch_edge (edge e, tree case_label) ...@@ -691,7 +691,7 @@ record_switch_edge (edge e, tree case_label)
/* Build a hash table element so we can see if E is already /* Build a hash table element so we can see if E is already
in the table. */ in the table. */
elt = xmalloc (sizeof (struct edge_to_cases_elt)); elt = XNEW (struct edge_to_cases_elt);
elt->e = e; elt->e = e;
elt->case_labels = case_label; elt->case_labels = case_label;
...@@ -942,7 +942,7 @@ void ...@@ -942,7 +942,7 @@ void
cleanup_dead_labels (void) cleanup_dead_labels (void)
{ {
basic_block bb; basic_block bb;
label_for_bb = xcalloc (last_basic_block, sizeof (tree)); label_for_bb = XCNEWVEC (tree, last_basic_block);
/* Find a suitable label for each block. We use the first user-defined /* Find a suitable label for each block. We use the first user-defined
label if there is one, or otherwise just the first label we see. */ label if there is one, or otherwise just the first label we see. */
...@@ -3453,7 +3453,7 @@ verify_node_sharing (tree * tp, int *walk_subtrees, void *data) ...@@ -3453,7 +3453,7 @@ verify_node_sharing (tree * tp, int *walk_subtrees, void *data)
slot = htab_find_slot (htab, *tp, INSERT); slot = htab_find_slot (htab, *tp, INSERT);
if (*slot) if (*slot)
return *slot; return (tree) *slot;
*slot = *tp; *slot = *tp;
return NULL; return NULL;
...@@ -4343,7 +4343,7 @@ tree_duplicate_sese_region (edge entry, edge exit, ...@@ -4343,7 +4343,7 @@ tree_duplicate_sese_region (edge entry, edge exit,
if (!region_copy) if (!region_copy)
{ {
region_copy = xmalloc (sizeof (basic_block) * n_region); region_copy = XNEWVEC (basic_block, n_region);
free_region_copy = true; free_region_copy = true;
} }
...@@ -4351,7 +4351,7 @@ tree_duplicate_sese_region (edge entry, edge exit, ...@@ -4351,7 +4351,7 @@ tree_duplicate_sese_region (edge entry, edge exit,
/* Record blocks outside the region that are dominated by something /* Record blocks outside the region that are dominated by something
inside. */ inside. */
doms = xmalloc (sizeof (basic_block) * n_basic_blocks); doms = XNEWVEC (basic_block, n_basic_blocks);
initialize_original_copy_tables (); initialize_original_copy_tables ();
n_doms = get_dominated_by_region (CDI_DOMINATORS, region, n_region, doms); n_doms = get_dominated_by_region (CDI_DOMINATORS, region, n_region, doms);
......
...@@ -157,7 +157,7 @@ create_var_ann (tree t) ...@@ -157,7 +157,7 @@ create_var_ann (tree t)
gcc_assert (DECL_P (t)); gcc_assert (DECL_P (t));
gcc_assert (!t->common.ann || t->common.ann->common.type == VAR_ANN); gcc_assert (!t->common.ann || t->common.ann->common.type == VAR_ANN);
ann = ggc_alloc (sizeof (*ann)); ann = GGC_NEW (struct var_ann_d);
memset ((void *) ann, 0, sizeof (*ann)); memset ((void *) ann, 0, sizeof (*ann));
ann->common.type = VAR_ANN; ann->common.type = VAR_ANN;
...@@ -178,7 +178,7 @@ create_stmt_ann (tree t) ...@@ -178,7 +178,7 @@ create_stmt_ann (tree t)
gcc_assert (is_gimple_stmt (t)); gcc_assert (is_gimple_stmt (t));
gcc_assert (!t->common.ann || t->common.ann->common.type == STMT_ANN); gcc_assert (!t->common.ann || t->common.ann->common.type == STMT_ANN);
ann = ggc_alloc (sizeof (*ann)); ann = GGC_NEW (struct stmt_ann_d);
memset ((void *) ann, 0, sizeof (*ann)); memset ((void *) ann, 0, sizeof (*ann));
ann->common.type = STMT_ANN; ann->common.type = STMT_ANN;
...@@ -201,7 +201,7 @@ create_tree_ann (tree t) ...@@ -201,7 +201,7 @@ create_tree_ann (tree t)
gcc_assert (t); gcc_assert (t);
gcc_assert (!t->common.ann || t->common.ann->common.type == TREE_ANN_COMMON); gcc_assert (!t->common.ann || t->common.ann->common.type == TREE_ANN_COMMON);
ann = ggc_alloc (sizeof (*ann)); ann = GGC_NEW (union tree_ann_d);
memset ((void *) ann, 0, sizeof (*ann)); memset ((void *) ann, 0, sizeof (*ann));
ann->common.type = TREE_ANN_COMMON; ann->common.type = TREE_ANN_COMMON;
...@@ -580,7 +580,7 @@ referenced_var_lookup_if_exists (unsigned int uid) ...@@ -580,7 +580,7 @@ referenced_var_lookup_if_exists (unsigned int uid)
{ {
struct int_tree_map *h, in; struct int_tree_map *h, in;
in.uid = uid; in.uid = uid;
h = htab_find_with_hash (referenced_vars, &in, uid); h = (struct int_tree_map *) htab_find_with_hash (referenced_vars, &in, uid);
if (h) if (h)
return h->to; return h->to;
return NULL_TREE; return NULL_TREE;
...@@ -594,7 +594,7 @@ referenced_var_lookup (unsigned int uid) ...@@ -594,7 +594,7 @@ referenced_var_lookup (unsigned int uid)
{ {
struct int_tree_map *h, in; struct int_tree_map *h, in;
in.uid = uid; in.uid = uid;
h = htab_find_with_hash (referenced_vars, &in, uid); h = (struct int_tree_map *) htab_find_with_hash (referenced_vars, &in, uid);
gcc_assert (h || uid == 0); gcc_assert (h || uid == 0);
if (h) if (h)
return h->to; return h->to;
...@@ -609,7 +609,7 @@ referenced_var_insert (unsigned int uid, tree to) ...@@ -609,7 +609,7 @@ referenced_var_insert (unsigned int uid, tree to)
struct int_tree_map *h; struct int_tree_map *h;
void **loc; void **loc;
h = ggc_alloc (sizeof (struct int_tree_map)); h = GGC_NEW (struct int_tree_map);
h->uid = uid; h->uid = uid;
h->to = to; h->to = to;
loc = htab_find_slot_with_hash (referenced_vars, h, uid, INSERT); loc = htab_find_slot_with_hash (referenced_vars, h, uid, INSERT);
...@@ -625,7 +625,8 @@ default_def (tree var) ...@@ -625,7 +625,8 @@ default_def (tree var)
struct int_tree_map *h, in; struct int_tree_map *h, in;
gcc_assert (SSA_VAR_P (var)); gcc_assert (SSA_VAR_P (var));
in.uid = DECL_UID (var); in.uid = DECL_UID (var);
h = htab_find_with_hash (default_defs, &in, DECL_UID (var)); h = (struct int_tree_map *) htab_find_with_hash (default_defs, &in,
DECL_UID (var));
if (h) if (h)
return h->to; return h->to;
return NULL_TREE; return NULL_TREE;
...@@ -653,14 +654,14 @@ set_default_def (tree var, tree def) ...@@ -653,14 +654,14 @@ set_default_def (tree var, tree def)
/* Default definition might be changed by tail call optimization. */ /* Default definition might be changed by tail call optimization. */
if (!*loc) if (!*loc)
{ {
h = ggc_alloc (sizeof (struct int_tree_map)); h = GGC_NEW (struct int_tree_map);
h->uid = DECL_UID (var); h->uid = DECL_UID (var);
h->to = def; h->to = def;
*(struct int_tree_map **) loc = h; *(struct int_tree_map **) loc = h;
} }
else else
{ {
h = *loc; h = (struct int_tree_map *) *loc;
h->to = def; h->to = def;
} }
} }
......
...@@ -57,15 +57,15 @@ using_eh_for_cleanups (void) ...@@ -57,15 +57,15 @@ using_eh_for_cleanups (void)
static int static int
struct_ptr_eq (const void *a, const void *b) struct_ptr_eq (const void *a, const void *b)
{ {
const void * const * x = a; const void * const * x = (const void * const *) a;
const void * const * y = b; const void * const * y = (const void * const *) b;
return *x == *y; return *x == *y;
} }
static hashval_t static hashval_t
struct_ptr_hash (const void *a) struct_ptr_hash (const void *a)
{ {
const void * const * x = a; const void * const * x = (const void * const *) a;
return (size_t)*x >> 4; return (size_t)*x >> 4;
} }
...@@ -100,7 +100,7 @@ add_stmt_to_eh_region_fn (struct function *ifun, tree t, int num) ...@@ -100,7 +100,7 @@ add_stmt_to_eh_region_fn (struct function *ifun, tree t, int num)
gcc_assert (num >= 0); gcc_assert (num >= 0);
gcc_assert (TREE_CODE (t) != RESX_EXPR); gcc_assert (TREE_CODE (t) != RESX_EXPR);
n = ggc_alloc (sizeof (*n)); n = GGC_NEW (struct throw_stmt_node);
n->stmt = t; n->stmt = t;
n->region_nr = num; n->region_nr = num;
...@@ -168,7 +168,8 @@ lookup_stmt_eh_region_fn (struct function *ifun, tree t) ...@@ -168,7 +168,8 @@ lookup_stmt_eh_region_fn (struct function *ifun, tree t)
return -2; return -2;
n.stmt = t; n.stmt = t;
p = htab_find (get_eh_throw_stmt_table (ifun), &n); p = (struct throw_stmt_node *) htab_find (get_eh_throw_stmt_table (ifun),
&n);
return (p ? p->region_nr : -1); return (p ? p->region_nr : -1);
} }
...@@ -202,7 +203,7 @@ record_in_finally_tree (tree child, tree parent) ...@@ -202,7 +203,7 @@ record_in_finally_tree (tree child, tree parent)
struct finally_tree_node *n; struct finally_tree_node *n;
void **slot; void **slot;
n = xmalloc (sizeof (*n)); n = XNEW (struct finally_tree_node);
n->child = child; n->child = child;
n->parent = parent; n->parent = parent;
...@@ -266,7 +267,7 @@ outside_finally_tree (tree start, tree target) ...@@ -266,7 +267,7 @@ outside_finally_tree (tree start, tree target)
do do
{ {
n.child = start; n.child = start;
p = htab_find (finally_tree, &n); p = (struct finally_tree_node *) htab_find (finally_tree, &n);
if (!p) if (!p)
return true; return true;
start = p->parent; start = p->parent;
...@@ -369,7 +370,8 @@ find_goto_replacement (struct leh_tf_state *tf, tree stmt) ...@@ -369,7 +370,8 @@ find_goto_replacement (struct leh_tf_state *tf, tree stmt)
{ {
struct goto_queue_node tmp, *ret; struct goto_queue_node tmp, *ret;
tmp.stmt = stmt; tmp.stmt = stmt;
ret = bsearch (&tmp, tf->goto_queue, tf->goto_queue_active, ret = (struct goto_queue_node *)
bsearch (&tmp, tf->goto_queue, tf->goto_queue_active,
sizeof (struct goto_queue_node), goto_queue_cmp); sizeof (struct goto_queue_node), goto_queue_cmp);
return (ret ? ret->repl_stmt : NULL); return (ret ? ret->repl_stmt : NULL);
} }
...@@ -537,7 +539,7 @@ maybe_record_in_goto_queue (struct leh_state *state, tree stmt) ...@@ -537,7 +539,7 @@ maybe_record_in_goto_queue (struct leh_state *state, tree stmt)
size = (size ? size * 2 : 32); size = (size ? size * 2 : 32);
tf->goto_queue_size = size; tf->goto_queue_size = size;
tf->goto_queue tf->goto_queue
= xrealloc (tf->goto_queue, size * sizeof (struct goto_queue_node)); = XRESIZEVEC (struct goto_queue_node, tf->goto_queue, size);
} }
q = &tf->goto_queue[active]; q = &tf->goto_queue[active];
...@@ -1058,14 +1060,14 @@ lower_try_finally_copy (struct leh_state *state, struct leh_tf_state *tf) ...@@ -1058,14 +1060,14 @@ lower_try_finally_copy (struct leh_state *state, struct leh_tf_state *tf)
struct goto_queue_node *q, *qe; struct goto_queue_node *q, *qe;
tree return_val = NULL; tree return_val = NULL;
int return_index, index; int return_index, index;
struct struct labels_s
{ {
struct goto_queue_node *q; struct goto_queue_node *q;
tree label; tree label;
} *labels; } *labels;
return_index = VEC_length (tree, tf->dest_array); return_index = VEC_length (tree, tf->dest_array);
labels = xcalloc (sizeof (*labels), return_index + 1); labels = XCNEWVEC (struct labels_s, return_index + 1);
q = tf->goto_queue; q = tf->goto_queue;
qe = q + tf->goto_queue_active; qe = q + tf->goto_queue_active;
...@@ -1713,7 +1715,7 @@ make_eh_edge (struct eh_region *region, void *data) ...@@ -1713,7 +1715,7 @@ make_eh_edge (struct eh_region *region, void *data)
tree stmt, lab; tree stmt, lab;
basic_block src, dst; basic_block src, dst;
stmt = data; stmt = (tree) data;
lab = get_eh_region_tree_label (region); lab = get_eh_region_tree_label (region);
src = bb_for_stmt (stmt); src = bb_for_stmt (stmt);
...@@ -1755,7 +1757,7 @@ mark_eh_edge (struct eh_region *region, void *data) ...@@ -1755,7 +1757,7 @@ mark_eh_edge (struct eh_region *region, void *data)
basic_block src, dst; basic_block src, dst;
edge e; edge e;
stmt = data; stmt = (tree) data;
lab = get_eh_region_tree_label (region); lab = get_eh_region_tree_label (region);
src = bb_for_stmt (stmt); src = bb_for_stmt (stmt);
......
...@@ -246,7 +246,7 @@ get_ssa_name_ann (tree name) ...@@ -246,7 +246,7 @@ get_ssa_name_ann (tree name)
if (!SSA_NAME_AUX (name)) if (!SSA_NAME_AUX (name))
SSA_NAME_AUX (name) = xcalloc (1, sizeof (struct ssa_name_info)); SSA_NAME_AUX (name) = xcalloc (1, sizeof (struct ssa_name_info));
return SSA_NAME_AUX (name); return (struct ssa_name_info *) SSA_NAME_AUX (name);
} }
...@@ -365,7 +365,7 @@ get_def_blocks_for (tree var) ...@@ -365,7 +365,7 @@ get_def_blocks_for (tree var)
slot = htab_find_slot (def_blocks, (void *) &db, INSERT); slot = htab_find_slot (def_blocks, (void *) &db, INSERT);
if (*slot == NULL) if (*slot == NULL)
{ {
db_p = xmalloc (sizeof (*db_p)); db_p = XNEW (struct def_blocks_d);
db_p->var = var; db_p->var = var;
db_p->def_blocks = BITMAP_ALLOC (NULL); db_p->def_blocks = BITMAP_ALLOC (NULL);
db_p->phi_blocks = BITMAP_ALLOC (NULL); db_p->phi_blocks = BITMAP_ALLOC (NULL);
...@@ -532,7 +532,7 @@ add_to_repl_tbl (tree new, tree old) ...@@ -532,7 +532,7 @@ add_to_repl_tbl (tree new, tree old)
slot = htab_find_slot (repl_tbl, (void *) &m, INSERT); slot = htab_find_slot (repl_tbl, (void *) &m, INSERT);
if (*slot == NULL) if (*slot == NULL)
{ {
mp = xmalloc (sizeof (*mp)); mp = XNEW (struct repl_map_d);
mp->name = new; mp->name = new;
mp->set = BITMAP_ALLOC (NULL); mp->set = BITMAP_ALLOC (NULL);
*slot = (void *) mp; *slot = (void *) mp;
...@@ -630,7 +630,8 @@ mark_def_sites (struct dom_walk_data *walk_data, ...@@ -630,7 +630,8 @@ mark_def_sites (struct dom_walk_data *walk_data,
basic_block bb, basic_block bb,
block_stmt_iterator bsi) block_stmt_iterator bsi)
{ {
struct mark_def_sites_global_data *gd = walk_data->global_data; struct mark_def_sites_global_data *gd =
(struct mark_def_sites_global_data *) walk_data->global_data;
bitmap kills = gd->kills; bitmap kills = gd->kills;
tree stmt, def; tree stmt, def;
use_operand_p use_p; use_operand_p use_p;
...@@ -1203,7 +1204,7 @@ def_blocks_eq (const void *p1, const void *p2) ...@@ -1203,7 +1204,7 @@ def_blocks_eq (const void *p1, const void *p2)
static void static void
def_blocks_free (void *p) def_blocks_free (void *p)
{ {
struct def_blocks_d *entry = p; struct def_blocks_d *entry = (struct def_blocks_d *) p;
BITMAP_FREE (entry->def_blocks); BITMAP_FREE (entry->def_blocks);
BITMAP_FREE (entry->phi_blocks); BITMAP_FREE (entry->phi_blocks);
BITMAP_FREE (entry->livein_blocks); BITMAP_FREE (entry->livein_blocks);
...@@ -1645,7 +1646,8 @@ static void ...@@ -1645,7 +1646,8 @@ static void
mark_def_sites_initialize_block (struct dom_walk_data *walk_data, mark_def_sites_initialize_block (struct dom_walk_data *walk_data,
basic_block bb ATTRIBUTE_UNUSED) basic_block bb ATTRIBUTE_UNUSED)
{ {
struct mark_def_sites_global_data *gd = walk_data->global_data; struct mark_def_sites_global_data *gd =
(struct mark_def_sites_global_data *) walk_data->global_data;
bitmap kills = gd->kills; bitmap kills = gd->kills;
bitmap_clear (kills); bitmap_clear (kills);
} }
...@@ -2744,7 +2746,7 @@ update_ssa (unsigned update_flags) ...@@ -2744,7 +2746,7 @@ update_ssa (unsigned update_flags)
/* If the caller requested PHI nodes to be added, compute /* If the caller requested PHI nodes to be added, compute
dominance frontiers. */ dominance frontiers. */
dfs = xmalloc (last_basic_block * sizeof (bitmap)); dfs = XNEWVEC (bitmap, last_basic_block);
FOR_EACH_BB (bb) FOR_EACH_BB (bb)
dfs[bb->index] = BITMAP_ALLOC (NULL); dfs[bb->index] = BITMAP_ALLOC (NULL);
compute_dominance_frontiers (dfs); compute_dominance_frontiers (dfs);
......
...@@ -1340,12 +1340,12 @@ new_temp_expr_table (var_map map) ...@@ -1340,12 +1340,12 @@ new_temp_expr_table (var_map map)
{ {
temp_expr_table_p t; temp_expr_table_p t;
t = (temp_expr_table_p) xmalloc (sizeof (struct temp_expr_table_d)); t = XNEW (struct temp_expr_table_d);
t->map = map; t->map = map;
t->version_info = xcalloc (num_ssa_names + 1, sizeof (void *)); t->version_info = XCNEWVEC (void *, num_ssa_names + 1);
t->partition_dep_list = xcalloc (num_var_partitions (map) + 1, t->partition_dep_list = XCNEWVEC (value_expr_p,
sizeof (value_expr_p)); num_var_partitions (map) + 1);
t->replaceable = BITMAP_ALLOC (NULL); t->replaceable = BITMAP_ALLOC (NULL);
t->partition_in_use = BITMAP_ALLOC (NULL); t->partition_in_use = BITMAP_ALLOC (NULL);
......
...@@ -1867,7 +1867,7 @@ get_instantiated_value (htab_t cache, tree version) ...@@ -1867,7 +1867,7 @@ get_instantiated_value (htab_t cache, tree version)
struct scev_info_str *info, pattern; struct scev_info_str *info, pattern;
pattern.var = version; pattern.var = version;
info = htab_find (cache, &pattern); info = (struct scev_info_str *) htab_find (cache, &pattern);
if (info) if (info)
return info->chrec; return info->chrec;
......
...@@ -538,7 +538,7 @@ ccp_initialize (void) ...@@ -538,7 +538,7 @@ ccp_initialize (void)
{ {
basic_block bb; basic_block bb;
const_val = xmalloc (num_ssa_names * sizeof (*const_val)); const_val = XNEWVEC (prop_value_t, num_ssa_names);
memset (const_val, 0, num_ssa_names * sizeof (*const_val)); memset (const_val, 0, num_ssa_names * sizeof (*const_val));
/* Initialize simulation flags for PHI nodes and statements. */ /* Initialize simulation flags for PHI nodes and statements. */
...@@ -935,7 +935,7 @@ ccp_fold (tree stmt) ...@@ -935,7 +935,7 @@ ccp_fold (tree stmt)
use_operand_p var_p; use_operand_p var_p;
/* Preserve the original values of every operand. */ /* Preserve the original values of every operand. */
orig = xmalloc (sizeof (tree) * NUM_SSA_OPERANDS (stmt, SSA_OP_USE)); orig = XNEWVEC (tree, NUM_SSA_OPERANDS (stmt, SSA_OP_USE));
FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_USE) FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_USE)
orig[i++] = var; orig[i++] = var;
...@@ -1937,7 +1937,7 @@ struct fold_stmt_r_data ...@@ -1937,7 +1937,7 @@ struct fold_stmt_r_data
static tree static tree
fold_stmt_r (tree *expr_p, int *walk_subtrees, void *data) fold_stmt_r (tree *expr_p, int *walk_subtrees, void *data)
{ {
struct fold_stmt_r_data *fold_stmt_r_data = data; struct fold_stmt_r_data *fold_stmt_r_data = (struct fold_stmt_r_data *) data;
bool *inside_addr_expr_p = fold_stmt_r_data->inside_addr_expr_p; bool *inside_addr_expr_p = fold_stmt_r_data->inside_addr_expr_p;
bool *changed_p = fold_stmt_r_data->changed_p; bool *changed_p = fold_stmt_r_data->changed_p;
tree expr = *expr_p, t; tree expr = *expr_p, t;
......
...@@ -634,7 +634,7 @@ verify_ssa (bool check_modified_stmt) ...@@ -634,7 +634,7 @@ verify_ssa (bool check_modified_stmt)
{ {
size_t i; size_t i;
basic_block bb; basic_block bb;
basic_block *definition_block = xcalloc (num_ssa_names, sizeof (basic_block)); basic_block *definition_block = XCNEWVEC (basic_block, num_ssa_names);
ssa_op_iter iter; ssa_op_iter iter;
tree op; tree op;
enum dom_state orig_dom_state = dom_computed[CDI_DOMINATORS]; enum dom_state orig_dom_state = dom_computed[CDI_DOMINATORS];
...@@ -781,7 +781,8 @@ err: ...@@ -781,7 +781,8 @@ err:
int int
int_tree_map_eq (const void *va, const void *vb) int_tree_map_eq (const void *va, const void *vb)
{ {
const struct int_tree_map *a = va, *b = vb; const struct int_tree_map *a = (const struct int_tree_map *) va;
const struct int_tree_map *b = (const struct int_tree_map *) vb;
return (a->uid == b->uid); return (a->uid == b->uid);
} }
......
...@@ -201,7 +201,7 @@ vn_add (tree expr, tree val, tree stmt) ...@@ -201,7 +201,7 @@ vn_add (tree expr, tree val, tree stmt)
void **slot; void **slot;
val_expr_pair_t new_pair; val_expr_pair_t new_pair;
new_pair = xmalloc (sizeof (struct val_expr_pair_d)); new_pair = XNEW (struct val_expr_pair_d);
new_pair->e = expr; new_pair->e = expr;
new_pair->v = val; new_pair->v = val;
new_pair->stmt = stmt; new_pair->stmt = stmt;
......
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