+2003-07-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * alias.c alloc-pool.c bitmap.c bitmap.h bt-load.c builtins.c
+ c-common.c c-decl.c c-incpath.c c-lex.c c-opts.c c-parse.in
+ c-pragma.c c-typeck.c calls.c cfg.c cfganal.c cfgloop.c cfgrtl.c
+ collect2.c combine.c conflict.c coverage.c cppexp.c cppfiles.c
+ cpphash.c cppinit.c cpplex.c cpplib.c cppmacro.c cppspec.c
+ cpptrad.c cse.c cselib.c dbxout.c defaults.h df.c dominance.c
+ dwarf2out.c dwarfout.c emit-rtl.c except.c expmed.c expr.c final.c
+ fix-header.c flow.c fold-const.c function.c gcc.c gccspec.c gcov.c
+ gcse.c genattr.c genattrtab.c genautomata.c genconditions.c
+ genemit.c genextract.c genoutput.c genrecog.c gensupport.c
+ ggc-page.c ggc-simple.c global.c graph.c haifa-sched.c hashtable.c
+ integrate.c jump.c langhooks.c lcm.c line-map.c local-alloc.c
+ loop.c mips-tdump.c mips-tfile.c mkdeps.c optabs.c params.c
+ postreload.c prefix.c print-tree.c protoize.c ra-build.c
+ ra-colorize.c ra-rewrite.c ra.c recog.c reg-stack.c regclass.c
+ regmove.c regrename.c reload.c reload1.c reorg.c resource.c
+ sbitmap.c sched-deps.c sched-rgn.c sched-vis.c sdbout.c
+ simplify-rtx.c ssa-ccp.c ssa.c stmt.c stor-layout.c timevar.c
+ tlink.c toplev.c tree-dump.c tree.c unroll.c unwind-dw2-fde.c
+ varasm.c varray.c vmsdbgout.c xcoffout.c: Remove unnecessary
+ casts.
+
2003-07-19 Gabriel Dos Reis <gdr@integrable-solutions.net>
* c-pragma.c (apply_pragma_weak): Don't use warning_with_decl.
{
/* Create an entry for the SUPERSET, so that we have a place to
attach the SUBSET. */
- superset_entry
- = (alias_set_entry) xmalloc (sizeof (struct alias_set_entry));
+ superset_entry = xmalloc (sizeof (struct alias_set_entry));
superset_entry->alias_set = superset;
superset_entry->children
= splay_tree_new (splay_tree_compare_ints, 0, 0);
optimization. Loop unrolling can create a large number of
registers. */
reg_base_value_size = maxreg * 2;
- reg_base_value = (rtx *) ggc_alloc_cleared (reg_base_value_size
- * sizeof (rtx));
+ reg_base_value = ggc_alloc_cleared (reg_base_value_size * sizeof (rtx));
- new_reg_base_value = (rtx *) xmalloc (reg_base_value_size * sizeof (rtx));
- reg_seen = (char *) xmalloc (reg_base_value_size);
+ new_reg_base_value = xmalloc (reg_base_value_size * sizeof (rtx));
+ reg_seen = xmalloc (reg_base_value_size);
if (! reload_completed && flag_old_unroll_loops)
{
/* ??? Why are we realloc'ing if we're just going to zero it? */
- alias_invariant = (rtx *)xrealloc (alias_invariant,
- reg_base_value_size * sizeof (rtx));
- memset ((char *)alias_invariant, 0, reg_base_value_size * sizeof (rtx));
+ alias_invariant = xrealloc (alias_invariant,
+ reg_base_value_size * sizeof (rtx));
+ memset (alias_invariant, 0, reg_base_value_size * sizeof (rtx));
}
/* The basic idea is that each pass through this loop will use the
copying_arguments = true;
/* Wipe the potential alias information clean for this pass. */
- memset ((char *) new_reg_base_value, 0, reg_base_value_size * sizeof (rtx));
+ memset (new_reg_base_value, 0, reg_base_value_size * sizeof (rtx));
/* Wipe the reg_seen array clean. */
- memset ((char *) reg_seen, 0, reg_base_value_size);
+ memset (reg_seen, 0, reg_base_value_size);
/* Mark all hard registers which may contain an address.
The stack, frame and argument pointers may contain an address.
pool_size = sizeof (struct alloc_pool_def);
/* and allocate that much memory. */
- pool = (alloc_pool) xmalloc (pool_size);
+ pool = xmalloc (pool_size);
/* Now init the various pieces of our pool structure. */
pool->name = xstrdup (name);
alloc_pool_list block_header;
/* Make the block. */
- block = (char *) xmalloc (pool->block_size);
+ block = xmalloc (pool->block_size);
block_header = (alloc_pool_list) block;
block += align_eight (sizeof (struct alloc_pool_list_def));
obstack_chunk_free);
}
- element = (bitmap_element *) obstack_alloc (&bitmap_obstack,
- sizeof (bitmap_element));
+ element = obstack_alloc (&bitmap_obstack, sizeof (bitmap_element));
}
}
else
/* Allocate a bitmap with oballoc. */
#define BITMAP_OBSTACK_ALLOC(OBSTACK) \
- bitmap_initialize ((bitmap) obstack_alloc (OBSTACK, sizeof (bitmap_head)), 1)
+ bitmap_initialize (obstack_alloc (OBSTACK, sizeof (bitmap_head)), 1)
/* Allocate a bitmap with ggc_alloc. */
#define BITMAP_GGC_ALLOC() \
/* Allocate a bitmap with xmalloc. */
#define BITMAP_XMALLOC() \
- bitmap_initialize ((bitmap) xmalloc (sizeof (bitmap_head)), 1)
+ bitmap_initialize (xmalloc (sizeof (bitmap_head)), 1)
/* Do any cleanup needed on a bitmap when it is no longer used. */
#define BITMAP_FREE(BITMAP) \
if (!this_group)
{
- this_group = (btr_def_group)
- obstack_alloc (&migrate_btrl_obstack,
- sizeof (struct btr_def_group_s));
+ this_group = obstack_alloc (&migrate_btrl_obstack,
+ sizeof (struct btr_def_group_s));
this_group->src = def_src;
this_group->members = NULL;
this_group->next = *all_btr_def_groups;
unsigned int dest_reg, int other_btr_uses_before_def,
btr_def_group *all_btr_def_groups)
{
- btr_def this = (btr_def)
- obstack_alloc (&migrate_btrl_obstack, sizeof (struct btr_def_s));
+ btr_def this
+ = obstack_alloc (&migrate_btrl_obstack, sizeof (struct btr_def_s));
this->bb = bb;
this->luid = insn_luid;
this->insn = insn;
usep = NULL;
}
use = usep ? *usep : NULL_RTX;
- user = (btr_user)
- obstack_alloc (&migrate_btrl_obstack, sizeof (struct btr_user_s));
+ user = obstack_alloc (&migrate_btrl_obstack, sizeof (struct btr_user_s));
user->bb = bb;
user->luid = insn_luid;
user->insn = insn;
sbitmap *btr_defset = sbitmap_vector_alloc (
(last_btr - first_btr) + 1, max_uid);
sbitmap *bb_gen = sbitmap_vector_alloc (n_basic_blocks, max_uid);
- HARD_REG_SET *btrs_written = (HARD_REG_SET *) xcalloc (
- n_basic_blocks, sizeof (HARD_REG_SET));
+ HARD_REG_SET *btrs_written = xcalloc (n_basic_blocks, sizeof (HARD_REG_SET));
sbitmap *bb_kill;
sbitmap *bb_out;
{
basic_block *worklist, *tos;
- tos = worklist =
- (basic_block *) xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
+ tos = worklist = xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
if (dominated_by_p (dom, new_bb, head_bb))
*tos++ = new_bb;
first_btr = reg;
}
- btrs_live =
- (HARD_REG_SET *) xcalloc (n_basic_blocks, sizeof (HARD_REG_SET));
+ btrs_live = xcalloc (n_basic_blocks, sizeof (HARD_REG_SET));
build_btr_def_use_webs (all_btr_defs);
int regno, size, align, nelts;
enum machine_mode mode;
rtx reg, mem;
- rtx *savevec = (rtx *) alloca (FIRST_PSEUDO_REGISTER * sizeof (rtx));
+ rtx *savevec = alloca (FIRST_PSEUDO_REGISTER * sizeof (rtx));
size = nelts = 0;
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
if (if_stack_space == 0)
{
if_stack_space = 10;
- if_stack = (if_elt *) xmalloc (10 * sizeof (if_elt));
+ if_stack = xmalloc (10 * sizeof (if_elt));
}
else if (if_stack_space == if_stack_pointer)
{
if_stack_space += 10;
- if_stack = (if_elt *) xrealloc (if_stack, if_stack_space * sizeof (if_elt));
+ if_stack = xrealloc (if_stack, if_stack_space * sizeof (if_elt));
}
IF_COND (if_stmt) = cond;
new_tlist (struct tlist *next, tree t, tree writer)
{
struct tlist *l;
- l = (struct tlist *) obstack_alloc (&tlist_obstack, sizeof *l);
+ l = obstack_alloc (&tlist_obstack, sizeof *l);
l->next = next;
l->expr = t;
l->writer = writer;
if (! t)
{
- t = (struct tlist_cache *) obstack_alloc (&tlist_obstack,
- sizeof *t);
+ t = obstack_alloc (&tlist_obstack, sizeof *t);
t->next = save_expr_cache;
t->expr = x;
save_expr_cache = t;
/* Create a NULL-terminated string that's one char shorter
than the original, stripping off the trailing '\n'. */
const int newlen = TREE_STRING_LENGTH (stripped_string) - 1;
- char *newstr = (char *) alloca (newlen);
+ char *newstr = alloca (newlen);
memcpy (newstr, TREE_STRING_POINTER (stripped_string), newlen - 1);
newstr[newlen - 1] = 0;
if (len > 4 && p[0] == '_' && p[1] == '_'
&& p[len - 1] == '_' && p[len - 2] == '_')
{
- char *newp = (char *) alloca (len - 1);
+ char *newp = alloca (len - 1);
strcpy (newp, &p[2]);
newp[len - 4] = '\0';
memset (result, 0, sizeof(struct binding_level));
}
else
- result = (struct binding_level *)
- ggc_alloc_cleared (sizeof (struct binding_level));
+ result = ggc_alloc_cleared (sizeof (struct binding_level));
return result;
}
/* Functions need the lang_decl data. */
if (TREE_CODE (x) == FUNCTION_DECL && ! DECL_LANG_SPECIFIC (x))
- DECL_LANG_SPECIFIC (x) = (struct lang_decl *)
- ggc_alloc_cleared (sizeof (struct lang_decl));
+ DECL_LANG_SPECIFIC (x) = ggc_alloc_cleared (sizeof (struct lang_decl));
/* A local extern declaration for a function doesn't constitute nesting.
A local auto declaration does, since it's a forward decl
decl = build_decl (FUNCTION_DECL, declarator, type);
decl = build_decl_attribute_variant (decl, decl_attr);
- DECL_LANG_SPECIFIC (decl) = (struct lang_decl *)
- ggc_alloc_cleared (sizeof (struct lang_decl));
+ DECL_LANG_SPECIFIC (decl)
+ = ggc_alloc_cleared (sizeof (struct lang_decl));
if (pedantic && type_quals && ! DECL_IN_SYSTEM_HEADER (decl))
pedwarn ("ISO C forbids qualified function types");
c_push_function_context (struct function *f)
{
struct language_function *p;
- p = ((struct language_function *)
- ggc_alloc (sizeof (struct language_function)));
+ p = ggc_alloc (sizeof (struct language_function));
f->language = p;
p->base.x_stmt_tree = c_stmt_tree;
if (!DECL_LANG_SPECIFIC (decl))
return;
- ld = (struct lang_decl *) ggc_alloc (sizeof (struct lang_decl));
- memcpy ((char *) ld, (char *) DECL_LANG_SPECIFIC (decl),
- sizeof (struct lang_decl));
+ ld = ggc_alloc (sizeof (struct lang_decl));
+ memcpy (ld, DECL_LANG_SPECIFIC (decl), sizeof (struct lang_decl));
DECL_LANG_SPECIFIC (decl) = ld;
}
if (TREE_PUBLIC (decl) && DECL_EXTERNAL (decl))
{
tree global_decl;
- global_decl = (tree) htab_find (link_hash_table, decl);
+ global_decl = htab_find (link_hash_table, decl);
if (! global_decl)
continue;
{
tree globals = BLOCK_VARS (DECL_INITIAL (link));
int len = list_length (globals);
- tree *vec = (tree *) xmalloc (sizeof (tree) * len);
+ tree *vec = xmalloc (sizeof (tree) * len);
int i;
tree decl;
{
struct cpp_path *p;
- p = (struct cpp_path *) xmalloc (sizeof (struct cpp_path));
+ p = xmalloc (sizeof (struct cpp_path));
p->next = NULL;
p->name = path;
if (chain == SYSTEM || chain == AFTER)
if (n)
return (struct c_fileinfo *) n->value;
- fi = (struct c_fileinfo *) xmalloc (sizeof (struct c_fileinfo));
+ fi = xmalloc (sizeof (struct c_fileinfo));
fi->time = 0;
fi->interface_only = 0;
fi->interface_unknown = 1;
flag_exceptions = c_dialect_cxx ();
warn_pointer_arith = c_dialect_cxx ();
- deferred_opts = (struct deferred_opt *)
- xmalloc (argc * sizeof (struct deferred_opt));
+ deferred_opts = xmalloc (argc * sizeof (struct deferred_opt));
result = lang_flags[c_language];
newsize = *(YYSSZ) *= 2; \
if (malloced_yyss) \
{ \
- newss = (short *) \
- really_call_realloc (*(SS), newsize * sizeof (short)); \
- newvs = (YYSTYPE *) \
- really_call_realloc (*(VS), newsize * sizeof (YYSTYPE)); \
+ newss = really_call_realloc (*(SS), newsize * sizeof (short)); \
+ newvs = really_call_realloc (*(VS), newsize * sizeof (YYSTYPE)); \
} \
else \
{ \
- newss = (short *) really_call_malloc (newsize * sizeof (short)); \
- newvs = (YYSTYPE *) really_call_malloc (newsize * sizeof (YYSTYPE)); \
+ newss = really_call_malloc (newsize * sizeof (short)); \
+ newvs = really_call_malloc (newsize * sizeof (YYSTYPE)); \
if (newss) \
memcpy (newss, *(SS), (SSSIZE)); \
if (newvs) \
if (!c_dialect_objc ())
mask |= D_OBJC;
- ridpointers = (tree *) ggc_calloc ((int) RID_MAX, sizeof (tree));
+ ridpointers = ggc_calloc ((int) RID_MAX, sizeof (tree));
for (i = 0; i < N_reswords; i++)
{
/* If a keyword is disabled, do not enter it into the table
{
align_stack * entry;
- entry = (align_stack *) ggc_alloc (sizeof (* entry));
+ entry = ggc_alloc (sizeof (* entry));
entry->alignment = alignment;
entry->num_pushes = 1;
{
/* Function name is known; supply it. */
const char *const argstring = _("passing arg of `%s'");
- new_opname = (char *) alloca (IDENTIFIER_LENGTH (function)
- + strlen (argstring) + 1
- + 1);
+ new_opname = alloca (IDENTIFIER_LENGTH (function)
+ + strlen (argstring) + 1 + 1);
sprintf (new_opname, argstring,
IDENTIFIER_POINTER (function));
}
{
/* Function name unknown (call through ptr). */
const char *const argnofun = _("passing arg of pointer to function");
- new_opname = (char *) alloca (strlen (argnofun) + 1 + 1);
+ new_opname = alloca (strlen (argnofun) + 1 + 1);
sprintf (new_opname, argnofun);
}
}
{
/* Function name is known; supply it. */
const char *const argstring = _("passing arg %d of `%s'");
- new_opname = (char *) alloca (IDENTIFIER_LENGTH (function)
- + strlen (argstring) + 1 + 25
- /*%d*/ + 1);
+ new_opname = alloca (IDENTIFIER_LENGTH (function)
+ + strlen (argstring) + 1 + 25 /*%d*/ + 1);
sprintf (new_opname, argstring, argnum,
IDENTIFIER_POINTER (function));
}
{
/* Function name unknown (call through ptr); just give arg number. */
const char *const argnofun = _("passing arg %d of pointer to function");
- new_opname = (char *) alloca (strlen (argnofun) + 1 + 25 /*%d*/ + 1);
+ new_opname = alloca (strlen (argnofun) + 1 + 25 /*%d*/ + 1);
sprintf (new_opname, argnofun, argnum);
}
opname = new_opname;
{ \
spelling_size += 10; \
if (spelling_base == 0) \
- spelling_base \
- = (struct spelling *) xmalloc (spelling_size * sizeof (struct spelling)); \
+ spelling_base = xmalloc (spelling_size * sizeof (struct spelling)); \
else \
- spelling_base \
- = (struct spelling *) xrealloc (spelling_base, \
- spelling_size * sizeof (struct spelling)); \
+ spelling_base = xrealloc (spelling_base, \
+ spelling_size * sizeof (struct spelling)); \
RESTORE_SPELLING_DEPTH (depth); \
} \
\
char *ofwhat;
error ("%s", _(msgid));
- ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
+ ofwhat = print_spelling (alloca (spelling_length () + 1));
if (*ofwhat)
error ("(near initialization for `%s')", ofwhat);
}
char *ofwhat;
pedwarn ("%s", _(msgid));
- ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
+ ofwhat = print_spelling (alloca (spelling_length () + 1));
if (*ofwhat)
pedwarn ("(near initialization for `%s')", ofwhat);
}
char *ofwhat;
warning ("%s", _(msgid));
- ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
+ ofwhat = print_spelling (alloca (spelling_length () + 1));
if (*ofwhat)
warning ("(near initialization for `%s')", ofwhat);
}
start_init (tree decl, tree asmspec_tree, int top_level)
{
const char *locus;
- struct initializer_stack *p
- = (struct initializer_stack *) xmalloc (sizeof (struct initializer_stack));
+ struct initializer_stack *p = xmalloc (sizeof (struct initializer_stack));
const char *asmspec = 0;
if (asmspec_tree)
void
really_start_incremental_init (tree type)
{
- struct constructor_stack *p
- = (struct constructor_stack *) xmalloc (sizeof (struct constructor_stack));
+ struct constructor_stack *p = xmalloc (sizeof (struct constructor_stack));
if (type == 0)
type = TREE_TYPE (constructor_decl);
value = find_init_member (constructor_index);
}
- p = (struct constructor_stack *) xmalloc (sizeof (struct constructor_stack));
+ p = xmalloc (sizeof (struct constructor_stack));
p->type = constructor_type;
p->fields = constructor_fields;
p->index = constructor_index;
{
struct constructor_range_stack *p;
- p = (struct constructor_range_stack *)
- ggc_alloc (sizeof (struct constructor_range_stack));
+ p = ggc_alloc (sizeof (struct constructor_range_stack));
p->prev = constructor_range_stack;
p->next = 0;
p->fields = constructor_fields;
}
}
- r = (struct init_node *) ggc_alloc (sizeof (struct init_node));
+ r = ggc_alloc (sizeof (struct init_node));
r->purpose = purpose;
r->value = value;
int noutputs = list_length (outputs);
int i;
/* o[I] is the place that output number I should be written. */
- tree *o = (tree *) alloca (noutputs * sizeof (tree));
+ tree *o = alloca (noutputs * sizeof (tree));
tree tail;
/* Record the contents of OUTPUTS before it is modified. */
}
/* Add this new SWITCH_STMT to the stack. */
- cs = (struct c_switch *) xmalloc (sizeof (*cs));
+ cs = xmalloc (sizeof (*cs));
cs->switch_stmt = build_stmt (SWITCH_STMT, exp, NULL_TREE, orig_type);
cs->cases = splay_tree_new (case_compare, NULL, NULL);
cs->next = switch_stack;
int endian_correction = 0;
args[i].n_aligned_regs = args[i].partial ? args[i].partial : nregs;
- args[i].aligned_regs = (rtx *) xmalloc (sizeof (rtx)
- * args[i].n_aligned_regs);
+ args[i].aligned_regs = xmalloc (sizeof (rtx) * args[i].n_aligned_regs);
/* Structures smaller than a word are normally aligned to the
least significant byte. On a BYTES_BIG_ENDIAN machine,
INIT_CUMULATIVE_ARGS (args_so_far, funtype, NULL_RTX, fndecl);
/* Make a vector to hold all the information about each arg. */
- args = (struct arg_data *) alloca (num_actuals * sizeof (struct arg_data));
- memset ((char *) args, 0, num_actuals * sizeof (struct arg_data));
+ args = alloca (num_actuals * sizeof (struct arg_data));
+ memset (args, 0, num_actuals * sizeof (struct arg_data));
/* Build up entries in the ARGS array, compute the size of the
arguments into ARGS_SIZE, etc. */
highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use,
needed);
#endif
- stack_usage_map
- = (char *) alloca (highest_outgoing_arg_in_use);
+ stack_usage_map = alloca (highest_outgoing_arg_in_use);
if (initial_highest_arg_in_use)
memcpy (stack_usage_map, initial_stack_usage_map,
= stack_arg_under_construction;
stack_arg_under_construction = 0;
/* Make a new map for the new argument list. */
- stack_usage_map = (char *)
- alloca (highest_outgoing_arg_in_use);
+ stack_usage_map = alloca (highest_outgoing_arg_in_use);
memset (stack_usage_map, 0, highest_outgoing_arg_in_use);
highest_outgoing_arg_in_use = 0;
}
of the full argument passing conventions to limit complexity here since
library functions shouldn't have many args. */
- argvec = (struct arg *) alloca ((nargs + 1) * sizeof (struct arg));
- memset ((char *) argvec, 0, (nargs + 1) * sizeof (struct arg));
+ argvec = alloca ((nargs + 1) * sizeof (struct arg));
+ memset (argvec, 0, (nargs + 1) * sizeof (struct arg));
#ifdef INIT_CUMULATIVE_LIBCALL_ARGS
INIT_CUMULATIVE_LIBCALL_ARGS (args_so_far, outmode, fun);
highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use,
needed);
#endif
- stack_usage_map = (char *) alloca (highest_outgoing_arg_in_use);
+ stack_usage_map = alloca (highest_outgoing_arg_in_use);
if (initial_highest_arg_in_use)
memcpy (stack_usage_map, initial_stack_usage_map,
if (!initialized)
{
gcc_obstack_init (&flow_obstack);
- flow_firstobj = (char *) obstack_alloc (&flow_obstack, 0);
+ flow_firstobj = obstack_alloc (&flow_obstack, 0);
initialized = 1;
}
else
free_alloc_pool (bb_pool);
free_alloc_pool (edge_pool);
obstack_free (&flow_obstack, flow_firstobj);
- flow_firstobj = (char *) obstack_alloc (&flow_obstack, 0);
+ flow_firstobj = obstack_alloc (&flow_obstack, 0);
}
bb_pool = create_alloc_pool ("Basic block pool",
sizeof (struct basic_block_def), 100);
/* Check whether AUX data are still allocated. */
else if (first_block_aux_obj)
abort ();
- first_block_aux_obj = (char *) obstack_alloc (&block_aux_obstack, 0);
+ first_block_aux_obj = obstack_alloc (&block_aux_obstack, 0);
if (size)
{
basic_block bb;
else if (first_edge_aux_obj)
abort ();
- first_edge_aux_obj = (char *) obstack_alloc (&edge_aux_obstack, 0);
+ first_edge_aux_obj = obstack_alloc (&edge_aux_obstack, 0);
if (size)
{
basic_block bb;
basic_block bb, last_bb_seen;
basic_block *last_visited;
- last_visited = (basic_block *) xcalloc (last_basic_block + 2,
- sizeof (basic_block));
- edge_checksum = (size_t *) xcalloc (last_basic_block + 2, sizeof (size_t));
+ last_visited = xcalloc (last_basic_block + 2, sizeof (basic_block));
+ edge_checksum = xcalloc (last_basic_block + 2, sizeof (size_t));
/* Check bb chain & numbers. */
last_bb_seen = ENTRY_BLOCK_PTR;
bool found = false;
/* Allocate the preorder and postorder number arrays. */
- pre = (int *) xcalloc (last_basic_block, sizeof (int));
- post = (int *) xcalloc (last_basic_block, sizeof (int));
+ pre = xcalloc (last_basic_block, sizeof (int));
+ post = xcalloc (last_basic_block, sizeof (int));
/* Allocate stack for back-tracking up CFG. */
- stack = (edge *) xmalloc ((n_basic_blocks + 1) * sizeof (edge));
+ stack = xmalloc ((n_basic_blocks + 1) * sizeof (edge));
sp = 0;
/* Allocate bitmap to track nodes that have been visited. */
edge e;
basic_block *tos, *worklist, bb;
- tos = worklist =
- (basic_block *) xmalloc (sizeof (basic_block) * n_basic_blocks);
+ tos = worklist = xmalloc (sizeof (basic_block) * n_basic_blocks);
/* Clear all the reachability flags. */
num_edges++;
}
- elist = (struct edge_list *) xmalloc (sizeof (struct edge_list));
+ elist = xmalloc (sizeof (struct edge_list));
elist->num_blocks = block_count;
elist->num_edges = num_edges;
- elist->index_to_edge = (edge *) xmalloc (sizeof (edge) * num_edges);
+ elist->index_to_edge = xmalloc (sizeof (edge) * num_edges);
num_edges = 0;
sbitmap visited;
/* Allocate stack for back-tracking up CFG. */
- stack = (edge *) xmalloc ((n_basic_blocks + 1) * sizeof (edge));
+ stack = xmalloc ((n_basic_blocks + 1) * sizeof (edge));
sp = 0;
/* Allocate bitmap to track nodes that have been visited. */
sbitmap visited;
/* Allocate stack for back-tracking up CFG. */
- stack = (edge *) xmalloc ((n_basic_blocks + 1) * sizeof (edge));
+ stack = xmalloc ((n_basic_blocks + 1) * sizeof (edge));
sp = 0;
/* Allocate bitmap to track nodes that have been visited. */
basic_block bb;
/* Allocate stack for back-tracking up CFG. */
- stack = (edge *) xmalloc ((n_basic_blocks + 1) * sizeof (edge));
+ stack = xmalloc ((n_basic_blocks + 1) * sizeof (edge));
sp = 0;
/* Allocate the tree. */
- dfst = (struct dfst_node *) xcalloc (last_basic_block,
- sizeof (struct dfst_node));
+ dfst = xcalloc (last_basic_block, sizeof (struct dfst_node));
FOR_EACH_BB (bb)
{
dfst[bb->index].node
= (max_successors
- ? (struct dfst_node **) xcalloc (max_successors,
- sizeof (struct dfst_node *))
- : NULL);
+ ? xcalloc (max_successors, sizeof (struct dfst_node *)) : NULL);
}
/* Allocate bitmap to track nodes that have been visited. */
flow_dfs_compute_reverse_init (depth_first_search_ds data)
{
/* Allocate stack for back-tracking up CFG. */
- data->stack = (basic_block *) xmalloc ((n_basic_blocks - (INVALID_BLOCK + 1))
- * sizeof (basic_block));
+ data->stack = xmalloc ((n_basic_blocks - (INVALID_BLOCK + 1))
+ * sizeof (basic_block));
data->sp = 0;
/* Allocate bitmap to track nodes that have been visited. */
if (! num_entries)
abort ();
- loop->entry_edges = (edge *) xmalloc (num_entries * sizeof (edge *));
+ loop->entry_edges = xmalloc (num_entries * sizeof (edge *));
num_entries = 0;
for (e = loop->header->pred; e; e = e->pred_next)
return;
}
- loop->exit_edges = (edge *) xmalloc (num_exits * sizeof (edge *));
+ loop->exit_edges = xmalloc (num_exits * sizeof (edge *));
/* Store all exiting edges into an array. */
num_exits = 0;
if (loop->latch->loop_father != loop)
{
- stack = (basic_block *) xmalloc (n_basic_blocks * sizeof (basic_block));
+ stack = xmalloc (n_basic_blocks * sizeof (basic_block));
sp = 0;
num_nodes++;
stack[sp++] = loop->latch;
num++)
ebb = ebb->pred->src;
- loop->pre_header_edges = (edge *) xmalloc (num * sizeof (edge));
+ loop->pre_header_edges = xmalloc (num * sizeof (edge));
loop->num_pre_header_edges = num;
/* Store edges in order that they are followed. The source of the first edge
}
/* Allocate loop structures. */
- loops->parray = (struct loop **) xcalloc (num_loops + 1, sizeof (struct loop *));
+ loops->parray = xcalloc (num_loops + 1, sizeof (struct loop *));
/* Dummy loop containing whole function. */
loops->parray[0] = xcalloc (1, sizeof (struct loop));
{
/* Compute depth first search order of the CFG so that outer
natural loops will be found before inner natural loops. */
- dfs_order = (int *) xmalloc (n_basic_blocks * sizeof (int));
- rc_order = (int *) xmalloc (n_basic_blocks * sizeof (int));
+ dfs_order = xmalloc (n_basic_blocks * sizeof (int));
+ rc_order = xmalloc (n_basic_blocks * sizeof (int));
flow_depth_first_order_compute (dfs_order, rc_order);
/* Save CFG derived information to avoid recomputing it. */
{
enum bb_state { NOT_IN_BB, IN_ONE_BB, IN_MULTIPLE_BB };
int max_uid = get_max_uid ();
- basic_block *start
- = (basic_block *) xcalloc (max_uid, sizeof (basic_block));
- basic_block *end
- = (basic_block *) xcalloc (max_uid, sizeof (basic_block));
- enum bb_state *in_bb_p
- = (enum bb_state *) xcalloc (max_uid, sizeof (enum bb_state));
+ basic_block *start = xcalloc (max_uid, sizeof (basic_block));
+ basic_block *end = xcalloc (max_uid, sizeof (basic_block));
+ enum bb_state *in_bb_p = xcalloc (max_uid, sizeof (enum bb_state));
basic_block bb;
int err = 0;
basic_block bb, last_bb_seen;
- bb_info = (basic_block *) xcalloc (max_uid, sizeof (basic_block));
+ bb_info = xcalloc (max_uid, sizeof (basic_block));
/* Check bb chain & numbers. */
last_bb_seen = ENTRY_BLOCK_PTR;
if (len > pprefix->max_len)
pprefix->max_len = len;
- pl = (struct prefix_list *) xmalloc (sizeof (struct prefix_list));
+ pl = xmalloc (sizeof (struct prefix_list));
pl->prefix = xstrdup (prefix);
if (*prev)
prefix_from_string (const char *p, struct path_prefix *pprefix)
{
const char *startp, *endp;
- char *nstore = (char *) xmalloc (strlen (p) + 3);
+ char *nstore = xmalloc (strlen (p) + 3);
if (debug)
fprintf (stderr, "Convert string '%s' into prefixes, separator = '%c'\n", p, PATH_SEPARATOR);
/* Do not invoke xcalloc before this point, since locale needs to be
set first, in case a diagnostic is issued. */
- ld1 = (const char **)(ld1_argv = (char **) xcalloc(sizeof (char *), argc+3));
- ld2 = (const char **)(ld2_argv = (char **) xcalloc(sizeof (char *), argc+10));
- object = (const char **)(object_lst = (char **) xcalloc(sizeof (char *), argc));
+ ld1 = (const char **)(ld1_argv = xcalloc(sizeof (char *), argc+3));
+ ld2 = (const char **)(ld2_argv = xcalloc(sizeof (char *), argc+10));
+ object = (const char **)(object_lst = xcalloc(sizeof (char *), argc));
#ifdef DEBUG
debug = 1;
#endif
obstack_begin (&temporary_obstack, 0);
- temporary_firstobj = (char *) obstack_alloc (&temporary_obstack, 0);
+ temporary_firstobj = obstack_alloc (&temporary_obstack, 0);
current_demangling_style = auto_demangling;
p = getenv ("COLLECT_GCC_OPTIONS");
/* -fno-exceptions -w */
num_c_args += 2;
- c_ptr = (const char **)
- (c_argv = (char **) xcalloc (sizeof (char *), num_c_args));
+ c_ptr = (const char **) (c_argv = xcalloc (sizeof (char *), num_c_args));
if (argc < 2)
fatal ("no arguments");
/* Strip now if it was requested on the command line. */
if (strip_flag)
{
- char **real_strip_argv = (char **) xcalloc (sizeof (char *), 3);
+ char **real_strip_argv = xcalloc (sizeof (char *), 3);
const char ** strip_argv = (const char **) real_strip_argv;
strip_argv[0] = strip_file_name;
static void
add_to_list (struct head *head_ptr, const char *name)
{
- struct id *newid
- = (struct id *) xcalloc (sizeof (struct id) + strlen (name), 1);
+ struct id *newid = xcalloc (sizeof (struct id) + strlen (name), 1);
struct id *p;
strcpy (newid->name, name);
cnt++;
q = xstrdup (p);
}
- l = (const char **) xmalloc ((cnt + 3) * sizeof (char *));
+ l = xmalloc ((cnt + 3) * sizeof (char *));
pp = l;
if (ldr)
{
if (undobuf.frees)
buf = undobuf.frees, undobuf.frees = buf->next;
else
- buf = (struct undo *) xmalloc (sizeof (struct undo));
+ buf = xmalloc (sizeof (struct undo));
buf->is_int = 0;
buf->where.r = into;
if (undobuf.frees)
buf = undobuf.frees, undobuf.frees = buf->next;
else
- buf = (struct undo *) xmalloc (sizeof (struct undo));
+ buf = xmalloc (sizeof (struct undo));
buf->is_int = 1;
buf->where.i = into;
combine_max_regno = nregs;
- reg_nonzero_bits = ((unsigned HOST_WIDE_INT *)
- xcalloc (nregs, sizeof (unsigned HOST_WIDE_INT)));
- reg_sign_bit_copies
- = (unsigned char *) xcalloc (nregs, sizeof (unsigned char));
-
- reg_last_death = (rtx *) xmalloc (nregs * sizeof (rtx));
- reg_last_set = (rtx *) xmalloc (nregs * sizeof (rtx));
- reg_last_set_value = (rtx *) xmalloc (nregs * sizeof (rtx));
- reg_last_set_table_tick = (int *) xmalloc (nregs * sizeof (int));
- reg_last_set_label = (int *) xmalloc (nregs * sizeof (int));
- reg_last_set_invalid = (char *) xmalloc (nregs * sizeof (char));
- reg_last_set_mode
- = (enum machine_mode *) xmalloc (nregs * sizeof (enum machine_mode));
- reg_last_set_nonzero_bits
- = (unsigned HOST_WIDE_INT *) xmalloc (nregs * sizeof (HOST_WIDE_INT));
- reg_last_set_sign_bit_copies
- = (char *) xmalloc (nregs * sizeof (char));
+ reg_nonzero_bits = xcalloc (nregs, sizeof (unsigned HOST_WIDE_INT));
+ reg_sign_bit_copies = xcalloc (nregs, sizeof (unsigned char));
+
+ reg_last_death = xmalloc (nregs * sizeof (rtx));
+ reg_last_set = xmalloc (nregs * sizeof (rtx));
+ reg_last_set_value = xmalloc (nregs * sizeof (rtx));
+ reg_last_set_table_tick = xmalloc (nregs * sizeof (int));
+ reg_last_set_label = xmalloc (nregs * sizeof (int));
+ reg_last_set_invalid = xmalloc (nregs * sizeof (char));
+ reg_last_set_mode = xmalloc (nregs * sizeof (enum machine_mode));
+ reg_last_set_nonzero_bits = xmalloc (nregs * sizeof (HOST_WIDE_INT));
+ reg_last_set_sign_bit_copies = xmalloc (nregs * sizeof (char));
init_reg_last_arrays ();
if (INSN_UID (insn) > i)
i = INSN_UID (insn);
- uid_cuid = (int *) xmalloc ((i + 1) * sizeof (int));
+ uid_cuid = xmalloc ((i + 1) * sizeof (int));
max_uid_cuid = i;
nonzero_bits_mode = mode_for_size (HOST_BITS_PER_WIDE_INT, MODE_INT, 0);
{
unsigned int nregs = combine_max_regno;
- memset ((char *) reg_last_death, 0, nregs * sizeof (rtx));
- memset ((char *) reg_last_set, 0, nregs * sizeof (rtx));
- memset ((char *) reg_last_set_value, 0, nregs * sizeof (rtx));
- memset ((char *) reg_last_set_table_tick, 0, nregs * sizeof (int));
- memset ((char *) reg_last_set_label, 0, nregs * sizeof (int));
+ memset (reg_last_death, 0, nregs * sizeof (rtx));
+ memset (reg_last_set, 0, nregs * sizeof (rtx));
+ memset (reg_last_set_value, 0, nregs * sizeof (rtx));
+ memset (reg_last_set_table_tick, 0, nregs * sizeof (int));
+ memset (reg_last_set_label, 0, nregs * sizeof (int));
memset (reg_last_set_invalid, 0, nregs * sizeof (char));
- memset ((char *) reg_last_set_mode, 0, nregs * sizeof (enum machine_mode));
- memset ((char *) reg_last_set_nonzero_bits, 0, nregs * sizeof (HOST_WIDE_INT));
+ memset (reg_last_set_mode, 0, nregs * sizeof (enum machine_mode));
+ memset (reg_last_set_nonzero_bits, 0, nregs * sizeof (HOST_WIDE_INT));
memset (reg_last_set_sign_bit_copies, 0, nregs * sizeof (char));
}
\f
conflict_graph
conflict_graph_new (int num_regs)
{
- conflict_graph graph
- = (conflict_graph) xmalloc (sizeof (struct conflict_graph_def));
+ conflict_graph graph = xmalloc (sizeof (struct conflict_graph_def));
graph->num_regs = num_regs;
/* Set up the hash table. No delete action is specified; memory
obstack_init (&graph->arc_obstack);
/* Create and zero the lookup table by register number. */
- graph->neighbor_heads
- = (conflict_graph_arc *) xmalloc (num_regs * sizeof (conflict_graph_arc));
+ graph->neighbor_heads = xmalloc (num_regs * sizeof (conflict_graph_arc));
memset (graph->neighbor_heads, 0, num_regs * sizeof (conflict_graph_arc));
return graph;
/* Allocate an arc. */
arc
- = (conflict_graph_arc)
- obstack_alloc (&graph->arc_obstack,
+ = obstack_alloc (&graph->arc_obstack,
sizeof (struct conflict_graph_arc_def));
/* Record the reg numbers. */
int len = strlen (filename);
/* Name of da file. */
- da_file_name = (char *) xmalloc (len + strlen (GCOV_DATA_SUFFIX) + 1);
+ da_file_name = xmalloc (len + strlen (GCOV_DATA_SUFFIX) + 1);
strcpy (da_file_name, filename);
strcat (da_file_name, GCOV_DATA_SUFFIX);
/* Name of bbg file. */
- bbg_file_name = (char *) xmalloc (len + strlen (GCOV_NOTE_SUFFIX) + 1);
+ bbg_file_name = xmalloc (len + strlen (GCOV_NOTE_SUFFIX) + 1);
strcpy (bbg_file_name, filename);
strcat (bbg_file_name, GCOV_NOTE_SUFFIX);
size_t old_size = (size_t) (pfile->op_limit - pfile->op_stack);
size_t new_size = old_size * 2 + 20;
- pfile->op_stack = (struct op *) xrealloc (pfile->op_stack,
- new_size * sizeof (struct op));
+ pfile->op_stack = xrealloc (pfile->op_stack, new_size * sizeof (struct op));
pfile->op_limit = pfile->op_stack + new_size;
return pfile->op_stack + old_size;
size = inc->st.st_size;
{
- buf = (uchar *) xmalloc (size + 1);
+ buf = xmalloc (size + 1);
offset = 0;
while (offset < size)
{
bigger than the majority of C source files. */
size = 8 * 1024;
- buf = (uchar *) xmalloc (size + 1);
+ buf = xmalloc (size + 1);
offset = 0;
while ((count = read (inc->fd, buf + offset, size - offset)) > 0)
{
}
/* Search directory path for the file. */
- name = (char *) alloca (strlen (fname) + pfile->max_include_len + 2);
+ name = alloca (strlen (fname) + pfile->max_include_len + 2);
for (path = pfile->quote_include; path; path = path->next)
{
memcpy (name, path->name, path->len);
}
/* Search directory path for the file. */
- name = (char *) alloca (strlen (fname) + pfile->max_include_len + 2);
+ name = alloca (strlen (fname) + pfile->max_include_len + 2);
for (; path; path = path->next)
{
int len = path->len;
if (! strcmp (map_list_ptr->map_list_name, dirname))
return map_list_ptr->map_list_map;
- map_list_ptr = ((struct file_name_map_list *)
- xmalloc (sizeof (struct file_name_map_list)));
+ map_list_ptr = xmalloc (sizeof (struct file_name_map_list));
map_list_ptr->map_list_name = xstrdup (dirname);
/* The end of the list ends in NULL. */
map_list_ptr->map_list_map = NULL;
- name = (char *) alloca (strlen (dirname) + strlen (FILE_NAME_MAP_FILE) + 2);
+ name = alloca (strlen (dirname) + strlen (FILE_NAME_MAP_FILE) + 2);
strcpy (name, dirname);
if (*dirname)
strcat (name, "/");
;
to = read_filename_string (ch, f);
- ptr = ((struct file_name_map *)
- xmalloc (sizeof (struct file_name_map)));
+ ptr = xmalloc (sizeof (struct file_name_map));
ptr->map_from = from;
/* Make the real filename absolute. */
if (p == name)
cpp_error (pfile, DL_ICE, "absolute file name in remap_filename");
- dir = (char *) alloca (p - name + 1);
+ dir = alloca (p - name + 1);
memcpy (dir, name, p - name);
dir[p - name] = '\0';
from = p + 1;
{
cpp_hashnode *node;
- node = (cpp_hashnode *) obstack_alloc (&table->pfile->hash_ob,
- sizeof (cpp_hashnode));
+ node = obstack_alloc (&table->pfile->hash_ob, sizeof (cpp_hashnode));
memset (node, 0, sizeof (cpp_hashnode));
return node;
}
/* Initialize this instance of the library if it hasn't been already. */
init_library ();
- pfile = (cpp_reader *) xcalloc (1, sizeof (cpp_reader));
+ pfile = xcalloc (1, sizeof (cpp_reader));
cpp_set_lang (pfile, lang);
CPP_OPTION (pfile, warn_import) = 1;
if (buffer->notes_used == buffer->notes_cap)
{
buffer->notes_cap = buffer->notes_cap * 2 + 200;
- buffer->notes = (_cpp_line_note *)
- xrealloc (buffer->notes, buffer->notes_cap * sizeof (_cpp_line_note));
+ buffer->notes = xrealloc (buffer->notes,
+ buffer->notes_cap * sizeof (_cpp_line_note));
}
buffer->notes[buffer->notes_used].pos = pos;
tack " 1" on the end. */
count = strlen (str);
- buf = (char *) alloca (count + 3);
+ buf = alloca (count + 3);
memcpy (buf, str, count);
p = strchr (str, '=');
/* Copy the entire option so we can modify it. Change the first
"=" in the string to a '(', and tack a ')' on the end. */
- char *buf = (char *) alloca (count + 2);
+ char *buf = alloca (count + 2);
memcpy (buf, str, count);
if (p)
lhs = *plhs;
len = cpp_token_len (lhs) + cpp_token_len (rhs) + 1;
- buf = (unsigned char *) alloca (len);
+ buf = alloca (len);
end = cpp_spell_token (pfile, lhs, buf);
/* Avoid comment headers, since they are still processed in stage 3.
/* Loop, reading in the arguments. */
capacity = 256;
- arg->expanded = (const cpp_token **)
- xmalloc (capacity * sizeof (cpp_token *));
+ arg->expanded = xmalloc (capacity * sizeof (cpp_token *));
push_ptoken_context (pfile, NULL, NULL, arg->first, arg->count + 1);
for (;;)
if (arg->expanded_count + 1 >= capacity)
{
capacity *= 2;
- arg->expanded = (const cpp_token **)
- xrealloc (arg->expanded, capacity * sizeof (cpp_token *));
+ arg->expanded = xrealloc (arg->expanded,
+ capacity * sizeof (cpp_token *));
}
token = cpp_get_token (pfile);
len = macro->paramc * sizeof (union _cpp_hashnode_value);
if (len > pfile->macro_buffer_len)
{
- pfile->macro_buffer = (uchar *) xrealloc (pfile->macro_buffer, len);
+ pfile->macro_buffer = xrealloc (pfile->macro_buffer, len);
pfile->macro_buffer_len = len;
}
((union _cpp_hashnode_value *) pfile->macro_buffer)[macro->paramc - 1]
if (len > pfile->macro_buffer_len)
{
- pfile->macro_buffer = (uchar *) xrealloc (pfile->macro_buffer, len);
+ pfile->macro_buffer = xrealloc (pfile->macro_buffer, len);
pfile->macro_buffer_len = len;
}
return;
/* One more slot for a terminating null. */
- new_argv = (const char **) xmalloc ((new_argc + 1) * sizeof(char *));
+ new_argv = xmalloc ((new_argc + 1) * sizeof(char *));
new_argv[0] = argv[0];
j = 1;
size_t size = pfile->out.cur - pfile->out.base;
size_t new_size = (size + n) * 3 / 2;
- pfile->out.base
- = (uchar *) xrealloc (pfile->out.base, new_size);
+ pfile->out.base = xrealloc (pfile->out.base, new_size);
pfile->out.limit = pfile->out.base + new_size;
pfile->out.cur = pfile->out.base + size;
}
cse_reg_info_free_list = p->next;
}
else
- p = (struct cse_reg_info *) xmalloc (sizeof (struct cse_reg_info));
+ p = xmalloc (sizeof (struct cse_reg_info));
/* Insert into hash table. */
p->hash_next = *hash_head;
/* Clear out hash table state for this pass. */
- memset ((char *) reg_hash, 0, sizeof reg_hash);
+ memset (reg_hash, 0, sizeof reg_hash);
if (cse_reg_info_used_list)
{
else
{
n_elements_made++;
- elt = (struct table_elt *) xmalloc (sizeof (struct table_elt));
+ elt = xmalloc (sizeof (struct table_elt));
}
elt->exp = x;
if (GET_CODE (x) == SET)
{
- sets = (struct set *) alloca (sizeof (struct set));
+ sets = alloca (sizeof (struct set));
sets[0].rtl = x;
/* Ignore SETs that are unconditional jumps.
{
int lim = XVECLEN (x, 0);
- sets = (struct set *) alloca (lim * sizeof (struct set));
+ sets = alloca (lim * sizeof (struct set));
/* Find all regs explicitly clobbered in this insn,
and ensure they are not replaced with any other regs
max_insn_uid = get_max_uid ();
- reg_eqv_table = (struct reg_eqv_elem *)
- xmalloc (nregs * sizeof (struct reg_eqv_elem));
+ reg_eqv_table = xmalloc (nregs * sizeof (struct reg_eqv_elem));
#ifdef LOAD_EXTEND_OP
/* Find the largest uid. */
max_uid = get_max_uid ();
- uid_cuid = (int *) xcalloc (max_uid + 1, sizeof (int));
+ uid_cuid = xcalloc (max_uid + 1, sizeof (int));
/* Compute the mapping from uids to cuids.
CUIDs are numbers assigned to insns, like uids,
/* This array is undefined before max_reg, so only allocate
the space actually needed and adjust the start. */
- qty_table
- = (struct qty_table_elem *) xmalloc ((max_qty - max_reg)
- * sizeof (struct qty_table_elem));
+ qty_table = xmalloc ((max_qty - max_reg) * sizeof (struct qty_table_elem));
qty_table -= max_reg;
new_basic_block ();
timevar_push (TV_DELETE_TRIVIALLY_DEAD);
/* First count the number of times each register is used. */
- counts = (int *) xcalloc (nreg, sizeof (int));
+ counts = xcalloc (nreg, sizeof (int));
for (insn = next_real_insn (insns); insn; insn = next_real_insn (insn))
count_reg_usage (insn, counts, NULL_RTX, 1);
if (el)
empty_elt_lists = el->next;
else
- el = (struct elt_list *) ggc_alloc (sizeof (struct elt_list));
+ el = ggc_alloc (sizeof (struct elt_list));
el->next = next;
el->elt = elt;
return el;
if (el)
empty_elt_loc_lists = el->next;
else
- el = (struct elt_loc_list *) ggc_alloc (sizeof (struct elt_loc_list));
+ el = ggc_alloc (sizeof (struct elt_loc_list));
el->next = next;
el->loc = loc;
el->setting_insn = cselib_current_insn;
if (e)
empty_vals = e->u.next_free;
else
- e = (cselib_val *) ggc_alloc (sizeof (cselib_val));
+ e = ggc_alloc (sizeof (cselib_val));
if (value == 0)
abort ();
asmfile = asm_out_file;
typevec_len = 100;
- typevec = (struct typeinfo *) ggc_calloc (typevec_len, sizeof typevec[0]);
+ typevec = ggc_calloc (typevec_len, sizeof typevec[0]);
/* Convert Ltext into the appropriate format for local labels in case
the system doesn't insert underscores in front of user generated
next_type_number = 1;
#ifdef DBX_USE_BINCL
- current_file = (struct dbx_file *) ggc_alloc (sizeof *current_file);
+ current_file = ggc_alloc (sizeof *current_file);
current_file->next = NULL;
current_file->file_number = 0;
current_file->next_type_number = 1;
const char *filename ATTRIBUTE_UNUSED)
{
#ifdef DBX_USE_BINCL
- struct dbx_file *n = (struct dbx_file *) ggc_alloc (sizeof *n);
+ struct dbx_file *n = ggc_alloc (sizeof *n);
n->next = current_file;
n->next_type_number = 1;
if (next_type_number == typevec_len)
{
typevec
- = (struct typeinfo *) ggc_realloc (typevec,
- (typevec_len * 2
- * sizeof typevec[0]));
- memset ((char *) (typevec + typevec_len), 0,
- typevec_len * sizeof typevec[0]);
+ = ggc_realloc (typevec, (typevec_len * 2 * sizeof typevec[0]));
+ memset (typevec + typevec_len, 0, typevec_len * sizeof typevec[0]);
typevec_len *= 2;
}
#ifndef ASM_FORMAT_PRIVATE_NAME
# define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
do { const char *const name_ = (NAME); \
- char *const output_ = (OUTPUT) = (char *) alloca (strlen (name_) + 32);\
+ char *const output_ = (OUTPUT) = alloca (strlen (name_) + 32);\
sprintf (output_, ASM_PN_FORMAT, name_, (unsigned long)(LABELNO)); \
} while (0)
#endif
to enlarge it so often. */
size += df->insn_size / 4;
- df->insns = (struct insn_info *)
- xrealloc (df->insns, size * sizeof (struct insn_info));
+ df->insns = xrealloc (df->insns, size * sizeof (struct insn_info));
memset (df->insns + df->insn_size, 0,
(size - df->insn_size) * sizeof (struct insn_info));
if (size < max_reg_num ())
size = max_reg_num ();
- df->regs = (struct reg_info *)
- xrealloc (df->regs, size * sizeof (struct reg_info));
+ df->regs = xrealloc (df->regs, size * sizeof (struct reg_info));
/* Zero the new entries. */
memset (df->regs + df->reg_size, 0,
{ \
unsigned int i = 1; /* Catch content == i. */ \
if (! (content)) \
- (var) = (type *) xcalloc ((num), sizeof (type)); \
+ (var) = xcalloc ((num), sizeof (type)); \
else \
{ \
- (var) = (type *) xmalloc ((num) * sizeof (type)); \
+ (var) = xmalloc ((num) * sizeof (type)); \
for (i = 0; i < num; i++) \
(var)[i] = (content); \
} \
/* Ending block. */
basic_block ex_block;
- stack = (edge *) xmalloc ((n_basic_blocks + 3) * sizeof (edge));
+ stack = xmalloc ((n_basic_blocks + 3) * sizeof (edge));
sp = 0;
/* Initialize our border blocks, and the first edge. */
static inline dw_cfi_ref
new_cfi (void)
{
- dw_cfi_ref cfi = (dw_cfi_ref) ggc_alloc (sizeof (dw_cfi_node));
+ dw_cfi_ref cfi = ggc_alloc (sizeof (dw_cfi_node));
cfi->dw_cfi_next = NULL;
cfi->dw_cfi_oprnd1.dw_cfi_reg_num = 0;
dwarf2out_frame_init (void)
{
/* Allocate the initial hunk of the fde_table. */
- fde_table = (dw_fde_ref) ggc_alloc_cleared (FDE_TABLE_INCREMENT
- * sizeof (dw_fde_node));
+ fde_table = ggc_alloc_cleared (FDE_TABLE_INCREMENT * sizeof (dw_fde_node));
fde_table_allocated = FDE_TABLE_INCREMENT;
fde_table_in_use = 0;
new_loc_descr (enum dwarf_location_atom op, long unsigned int oprnd1,
long unsigned int oprnd2)
{
- dw_loc_descr_ref descr
- = (dw_loc_descr_ref) ggc_alloc_cleared (sizeof (dw_loc_descr_node));
+ dw_loc_descr_ref descr = ggc_alloc_cleared (sizeof (dw_loc_descr_node));
descr->dw_loc_opc = op;
descr->dw_loc_oprnd1.val_class = dw_val_class_unsigned_const;
static inline void
add_AT_flag (dw_die_ref die, enum dwarf_attribute attr_kind, unsigned int flag)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
static inline void
add_AT_int (dw_die_ref die, enum dwarf_attribute attr_kind, long int int_val)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
add_AT_unsigned (dw_die_ref die, enum dwarf_attribute attr_kind,
long unsigned int unsigned_val)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
add_AT_long_long (dw_die_ref die, enum dwarf_attribute attr_kind,
long unsigned int val_hi, long unsigned int val_low)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
add_AT_float (dw_die_ref die, enum dwarf_attribute attr_kind,
unsigned int length, long int *array)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
static inline void
add_AT_string (dw_die_ref die, enum dwarf_attribute attr_kind, const char *str)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
struct indirect_string_node *node;
void **slot;
static inline void
add_AT_die_ref (dw_die_ref die, enum dwarf_attribute attr_kind, dw_die_ref targ_die)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
static inline void
add_AT_fde_ref (dw_die_ref die, enum dwarf_attribute attr_kind, unsigned int targ_fde)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
static inline void
add_AT_loc (dw_die_ref die, enum dwarf_attribute attr_kind, dw_loc_descr_ref loc)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
static inline void
add_AT_loc_list (dw_die_ref die, enum dwarf_attribute attr_kind, dw_loc_list_ref loc_list)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
static inline void
add_AT_addr (dw_die_ref die, enum dwarf_attribute attr_kind, rtx addr)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
static inline void
add_AT_lbl_id (dw_die_ref die, enum dwarf_attribute attr_kind, const char *lbl_id)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
static inline void
add_AT_lbl_offset (dw_die_ref die, enum dwarf_attribute attr_kind, const char *label)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
static inline void
add_AT_offset (dw_die_ref die, enum dwarf_attribute attr_kind, long unsigned int offset)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
add_AT_range_list (dw_die_ref die, enum dwarf_attribute attr_kind,
long unsigned int offset)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
static inline dw_die_ref
new_die (enum dwarf_tag tag_value, dw_die_ref parent_die, tree t)
{
- dw_die_ref die = (dw_die_ref) ggc_alloc_cleared (sizeof (die_node));
+ dw_die_ref die = ggc_alloc_cleared (sizeof (die_node));
die->die_tag = tag_value;
decl_die_table = ggc_realloc (decl_die_table,
sizeof (dw_die_ref) * num_allocated);
- memset ((char *) &decl_die_table[decl_die_table_allocated], 0,
+ memset (&decl_die_table[decl_die_table_allocated], 0,
(num_allocated - decl_die_table_allocated) * sizeof (dw_die_ref));
decl_die_table_allocated = num_allocated;
}
{
const char *die_name = get_AT_string (unit_die, DW_AT_name);
const char *base = die_name ? lbasename (die_name) : "anonymous";
- char *name = (char *) alloca (strlen (base) + 64);
+ char *name = alloca (strlen (base) + 64);
char *p;
int i, mark;
unsigned char checksum[16];
abbrev_die_table = ggc_realloc (abbrev_die_table,
sizeof (dw_die_ref) * n_alloc);
- memset ((char *) &abbrev_die_table[abbrev_die_table_allocated], 0,
+ memset (&abbrev_die_table[abbrev_die_table_allocated], 0,
(n_alloc - abbrev_die_table_allocated) * sizeof (dw_die_ref));
abbrev_die_table_allocated = n_alloc;
}
oldsym = die->die_symbol;
if (oldsym)
{
- tmp = (char *) alloca (strlen (oldsym) + 24);
+ tmp = alloca (strlen (oldsym) + 24);
sprintf (tmp, ".gnu.linkonce.wi.%s", oldsym);
secname = tmp;
{
pubname_table_allocated += PUBNAME_TABLE_INCREMENT;
pubname_table
- = (pubname_ref) ggc_realloc (pubname_table,
- (pubname_table_allocated
- * sizeof (pubname_entry)));
+ = ggc_realloc (pubname_table,
+ (pubname_table_allocated * sizeof (pubname_entry)));
memset (pubname_table + pubname_table_in_use, 0,
PUBNAME_TABLE_INCREMENT * sizeof (pubname_entry));
}
if (in_use == ranges_table_allocated)
{
ranges_table_allocated += RANGES_TABLE_INCREMENT;
- ranges_table = (dw_ranges_ref)
- ggc_realloc (ranges_table, (ranges_table_allocated
- * sizeof (struct dw_ranges_struct)));
+ ranges_table
+ = ggc_realloc (ranges_table, (ranges_table_allocated
+ * sizeof (struct dw_ranges_struct)));
memset (ranges_table + ranges_table_in_use, 0,
RANGES_TABLE_INCREMENT * sizeof (struct dw_ranges_struct));
}
}
/* Allocate the various arrays we need. */
- files = (struct file_info *) alloca (VARRAY_ACTIVE_SIZE (file_table)
- * sizeof (struct file_info));
- dirs = (struct dir_info *) alloca (VARRAY_ACTIVE_SIZE (file_table)
- * sizeof (struct dir_info));
+ files = alloca (VARRAY_ACTIVE_SIZE (file_table) * sizeof (struct file_info));
+ dirs = alloca (VARRAY_ACTIVE_SIZE (file_table) * sizeof (struct dir_info));
/* Sort the file names. */
for (i = 1; i < VARRAY_ACTIVE_SIZE (file_table); i++)
where we would have to check out every combination of every single
possible prefix. Instead we use a heuristic which provides nearly optimal
results in most cases and never is much off. */
- saved = (int *) alloca (ndirs * sizeof (int));
- savehere = (int *) alloca (ndirs * sizeof (int));
+ saved = alloca (ndirs * sizeof (int));
+ savehere = alloca (ndirs * sizeof (int));
memset (saved, '\0', ndirs * sizeof (saved[0]));
for (i = 0; i < ndirs; i++)
/* We have to emit them in the order they appear in the file_table array
since the index is used in the debug info generation. To do this
efficiently we generate a back-mapping of the indices first. */
- backmap = (int *) alloca (VARRAY_ACTIVE_SIZE (file_table) * sizeof (int));
+ backmap = alloca (VARRAY_ACTIVE_SIZE (file_table) * sizeof (int));
for (i = 1; i < VARRAY_ACTIVE_SIZE (file_table); i++)
{
backmap[files[i].file_idx] = i;
if (GET_MODE_CLASS (mode) == MODE_FLOAT)
{
unsigned length = GET_MODE_SIZE (mode) / 4;
- long *array = (long *) ggc_alloc (sizeof (long) * length);
+ long *array = ggc_alloc (sizeof (long) * length);
REAL_VALUE_TYPE rv;
REAL_VALUE_FROM_CONST_DOUBLE (rv, rtl);
{
separate_line_info_table_allocated += LINE_INFO_TABLE_INCREMENT;
separate_line_info_table
- = (dw_separate_line_info_ref)
- ggc_realloc (separate_line_info_table,
+ = ggc_realloc (separate_line_info_table,
separate_line_info_table_allocated
* sizeof (dw_separate_line_info_entry));
- memset ((separate_line_info_table
- + separate_line_info_table_in_use),
+ memset (separate_line_info_table
+ + separate_line_info_table_in_use,
0,
(LINE_INFO_TABLE_INCREMENT
* sizeof (dw_separate_line_info_entry)));
{
pending_siblings_allocated += PENDING_SIBLINGS_INCREMENT;
pending_sibling_stack
- = (unsigned *) xrealloc (pending_sibling_stack,
- pending_siblings_allocated * sizeof(unsigned));
+ = xrealloc (pending_sibling_stack,
+ pending_siblings_allocated * sizeof(unsigned));
}
pending_siblings++;
{
pending_types_allocated += PENDING_TYPES_INCREMENT;
pending_types_list
- = (tree *) xrealloc (pending_types_list,
- sizeof (tree) * pending_types_allocated);
+ = xrealloc (pending_types_list,
+ sizeof (tree) * pending_types_allocated);
}
pending_types_list[pending_types++] = type;
{
incomplete_types_allocated += INCOMPLETE_TYPES_INCREMENT;
incomplete_types_list
- = (tree *) xrealloc (incomplete_types_list,
- sizeof (tree) * incomplete_types_allocated);
+ = xrealloc (incomplete_types_list,
+ sizeof (tree) * incomplete_types_allocated);
}
incomplete_types_list[incomplete_types++] = type;
{
ft_entries_allocated += FT_ENTRIES_INCREMENT;
filename_table
- = (filename_entry *)
- xrealloc (filename_table,
+ = xrealloc (filename_table,
ft_entries_allocated * sizeof (filename_entry));
}
/* Allocate the initial hunk of the pending_sibling_stack. */
pending_sibling_stack
- = (unsigned *)
- xmalloc (PENDING_SIBLINGS_INCREMENT * sizeof (unsigned));
+ = xmalloc (PENDING_SIBLINGS_INCREMENT * sizeof (unsigned));
pending_siblings_allocated = PENDING_SIBLINGS_INCREMENT;
pending_siblings = 1;
/* Allocate the initial hunk of the filename_table. */
- filename_table
- = (filename_entry *)
- xmalloc (FT_ENTRIES_INCREMENT * sizeof (filename_entry));
+ filename_table = xmalloc (FT_ENTRIES_INCREMENT * sizeof (filename_entry));
ft_entries_allocated = FT_ENTRIES_INCREMENT;
ft_entries = 0;
/* Allocate the initial hunk of the pending_types_list. */
- pending_types_list
- = (tree *) xmalloc (PENDING_TYPES_INCREMENT * sizeof (tree));
+ pending_types_list = xmalloc (PENDING_TYPES_INCREMENT * sizeof (tree));
pending_types_allocated = PENDING_TYPES_INCREMENT;
pending_types = 0;
if (n == 0)
return NULL_RTVEC; /* Don't allocate an empty rtvec... */
- vector = (rtx *) alloca (n * sizeof (rtx));
+ vector = alloca (n * sizeof (rtx));
for (i = 0; i < n; i++)
vector[i] = va_arg (p, rtx);
memset (new + old_size, 0, old_size);
f->emit->regno_pointer_align = (unsigned char *) new;
- new1 = (rtx *) ggc_realloc (f->emit->x_regno_reg_rtx,
- old_size * 2 * sizeof (rtx));
+ new1 = ggc_realloc (f->emit->x_regno_reg_rtx,
+ old_size * 2 * sizeof (rtx));
memset (new1 + old_size, 0, old_size * sizeof (rtx));
regno_reg_rtx = new1;
free_sequence_stack = tem->next;
}
else
- tem = (struct sequence_stack *) ggc_alloc (sizeof (struct sequence_stack));
+ tem = ggc_alloc (sizeof (struct sequence_stack));
tem->next = seq_stack;
tem->first = first_insn;
{
struct function *f = cfun;
- f->emit = (struct emit_status *) ggc_alloc (sizeof (struct emit_status));
+ f->emit = ggc_alloc (sizeof (struct emit_status));
first_insn = NULL;
last_insn = NULL;
seq_rtl_expr = NULL;
f->emit->regno_pointer_align_length = LAST_VIRTUAL_REGISTER + 101;
f->emit->regno_pointer_align
- = (unsigned char *) ggc_alloc_cleared (f->emit->regno_pointer_align_length
- * sizeof (unsigned char));
+ = ggc_alloc_cleared (f->emit->regno_pointer_align_length
+ * sizeof (unsigned char));
regno_reg_rtx
- = (rtx *) ggc_alloc (f->emit->regno_pointer_align_length * sizeof (rtx));
+ = ggc_alloc (f->emit->regno_pointer_align_length * sizeof (rtx));
/* Put copies of all the hard registers into regno_reg_rtx. */
memcpy (regno_reg_rtx,
void
init_eh_for_function (void)
{
- cfun->eh = (struct eh_status *)
- ggc_alloc_cleared (sizeof (struct eh_status));
+ cfun->eh = ggc_alloc_cleared (sizeof (struct eh_status));
}
\f
/* Start an exception handling region. All instructions emitted
return;
/* Insert a new blank region as a leaf in the tree. */
- new_region = (struct eh_region *) ggc_alloc_cleared (sizeof (*new_region));
+ new_region = ggc_alloc_cleared (sizeof (*new_region));
cur_region = cfun->eh->cur_region;
new_region->outer = cur_region;
if (cur_region)
LABEL_PRESERVE_P (label) = 1;
- entry = (struct ehl_map_entry *) ggc_alloc (sizeof (*entry));
+ entry = ggc_alloc (sizeof (*entry));
entry->label = label;
entry->region = region;
static struct eh_region *
duplicate_eh_region_1 (struct eh_region *o, struct inline_remap *map)
{
- struct eh_region *n
- = (struct eh_region *) ggc_alloc_cleared (sizeof (struct eh_region));
+ struct eh_region *n = ggc_alloc_cleared (sizeof (struct eh_region));
n->region_number = o->region_number + cfun->eh->last_region_number;
n->type = o->type;
{
/* Filter value is a 1 based table index. */
- n = (struct ttypes_filter *) xmalloc (sizeof (*n));
+ n = xmalloc (sizeof (*n));
n->t = type;
n->filter = VARRAY_ACTIVE_SIZE (cfun->eh->ttype_data) + 1;
*slot = n;
{
/* Filter value is a -1 based byte index into a uleb128 buffer. */
- n = (struct ttypes_filter *) xmalloc (sizeof (*n));
+ n = xmalloc (sizeof (*n));
n->t = list;
n->filter = -(VARRAY_ACTIVE_SIZE (cfun->eh->ehspec_data) + 1);
*slot = n;
{
struct sjlj_lp_info *lp_info;
- lp_info = (struct sjlj_lp_info *) xcalloc (cfun->eh->last_region_number + 1,
- sizeof (struct sjlj_lp_info));
+ lp_info = xcalloc (cfun->eh->last_region_number + 1,
+ sizeof (struct sjlj_lp_info));
if (sjlj_find_directly_reachable_regions (lp_info))
{
if ((new = *slot) == NULL)
{
- new = (struct action_record *) xmalloc (sizeof (*new));
+ new = xmalloc (sizeof (*new));
new->offset = VARRAY_ACTIVE_SIZE (cfun->eh->action_record_data) + 1;
new->filter = filter;
new->next = next;
if (used >= size)
{
size = (size ? size * 2 : 64);
- data = (struct call_site_record *)
- ggc_realloc (data, sizeof (*data) * size);
+ data = ggc_realloc (data, sizeof (*data) * size);
cfun->eh->call_site_data = data;
cfun->eh->call_site_data_size = size;
}
/* We'll be needing a couple extra algorithm structures now. */
- alg_in = (struct algorithm *)alloca (sizeof (struct algorithm));
- best_alg = (struct algorithm *)alloca (sizeof (struct algorithm));
+ alg_in = alloca (sizeof (struct algorithm));
+ best_alg = alloca (sizeof (struct algorithm));
/* If we have a group of zero bits at the low-order part of T, try
multiplying by the remaining bits and then doing a shift. */
void
init_expr (void)
{
- cfun->expr = (struct expr_status *) ggc_alloc (sizeof (struct expr_status));
+ cfun->expr = ggc_alloc (sizeof (struct expr_status));
pending_chain = 0;
pending_stack_adjust = 0;
abort ();
length = XVECLEN (orig, 0);
- tmps = (rtx *) alloca (sizeof (rtx) * length);
+ tmps = alloca (sizeof (rtx) * length);
/* Skip a NULL entry in first slot. */
i = XEXP (XVECEXP (orig, 0, 0), 0) ? 0 : 1;
else
start = 1;
- tmps = (rtx *) alloca (sizeof (rtx) * XVECLEN (dst, 0));
+ tmps = alloca (sizeof (rtx) * XVECLEN (dst, 0));
/* Process the pieces. */
for (i = start; i < XVECLEN (dst, 0); i++)
else
start = 1;
- tmps = (rtx *) alloca (sizeof (rtx) * XVECLEN (src, 0));
+ tmps = alloca (sizeof (rtx) * XVECLEN (src, 0));
/* Copy the (probable) hard regs into pseudos. */
for (i = start; i < XVECLEN (src, 0); i++)
{
unsigned int set_word_size = TYPE_ALIGN (TREE_TYPE (exp));
enum machine_mode mode = mode_for_size (set_word_size, MODE_INT, 1);
- char *bit_buffer = (char *) alloca (nbits);
+ char *bit_buffer = alloca (nbits);
HOST_WIDE_INT word = 0;
unsigned int bit_pos = 0;
unsigned int ibit = 0;
max_labelno = max_label_num ();
min_labelno = get_first_label_num ();
- label_align = (struct label_alignment *)
- xcalloc (max_labelno - min_labelno + 1, sizeof (struct label_alignment));
+ label_align = xcalloc (max_labelno - min_labelno + 1,
+ sizeof (struct label_alignment));
/* If not optimizing or optimizing for size, don't assign any alignments. */
if (! optimize || optimize_size)
/* Compute maximum UID and allocate label_align / uid_shuid. */
max_uid = get_max_uid ();
- uid_shuid = (int *) xmalloc (max_uid * sizeof *uid_shuid);
+ uid_shuid = xmalloc (max_uid * sizeof *uid_shuid);
if (max_labelno != max_label_num ())
{
n_labels = max_labelno - min_labelno + 1;
n_old_labels = old - min_labelno + 1;
- label_align = (struct label_alignment *) xrealloc
- (label_align, n_labels * sizeof (struct label_alignment));
+ label_align = xrealloc (label_align,
+ n_labels * sizeof (struct label_alignment));
/* Range of labels grows monotonically in the function. Abort here
means that the initialization of array got lost. */
#ifdef HAVE_ATTR_length
/* Allocate the rest of the arrays. */
- insn_lengths = (int *) xmalloc (max_uid * sizeof (*insn_lengths));
+ insn_lengths = xmalloc (max_uid * sizeof (*insn_lengths));
insn_lengths_max_uid = max_uid;
/* Syntax errors can lead to labels being outside of the main insn stream.
Initialize insn_addresses, so that we get reproducible results. */
INSN_ADDRESSES_ALLOC (max_uid);
- varying_length = (char *) xcalloc (max_uid, sizeof (char));
+ varying_length = xcalloc (max_uid, sizeof (char));
/* Initialize uid_align. We scan instructions
from end to start, and keep in align_tab[n] the last seen insn
that does an alignment of at least n+1, i.e. the successor
in the alignment chain for an insn that does / has a known
alignment of n. */
- uid_align = (rtx *) xcalloc (max_uid, sizeof *uid_align);
+ uid_align = xcalloc (max_uid, sizeof *uid_align);
for (i = MAX_CODE_ALIGN; --i >= 0;)
align_tab[i] = NULL_RTX;
max_line = NOTE_LINE_NUMBER (insn);
}
- line_note_exists = (char *) xcalloc (max_line + 1, sizeof (char));
+ line_note_exists = xcalloc (max_line + 1, sizeof (char));
for (insn = first; insn; insn = NEXT_INSN (insn))
{
if (asm_noperands (body) >= 0)
{
unsigned int noperands = asm_noperands (body);
- rtx *ops = (rtx *) alloca (noperands * sizeof (rtx));
+ rtx *ops = alloca (noperands * sizeof (rtx));
const char *string;
/* There's no telling what that did to the condition codes. */
if (symbol_queue_index >= symbol_queue_size)
{
symbol_queue_size += 10;
- symbol_queue = (tree *) xrealloc (symbol_queue,
- symbol_queue_size * sizeof (tree));
+ symbol_queue = xrealloc (symbol_queue,
+ symbol_queue_size * sizeof (tree));
}
symbol_queue[symbol_queue_index++] = decl;
/* We only have a partial function declaration,
so remember that we have to add a complete prototype. */
partial_count++;
- partial = (struct partial_proto *)
- obstack_alloc (&scan_file_obstack, sizeof (struct partial_proto));
+ partial = obstack_alloc (&scan_file_obstack, sizeof (struct partial_proto));
partial->line_seen = line;
partial->fn = fn;
fn->partial = partial;
exit (FATAL_EXIT_CODE);
}
inf_size = sbuf.st_size;
- inf_buffer = (char *) xmalloc (inf_size + 2);
+ inf_buffer = xmalloc (inf_size + 2);
inf_ptr = inf_buffer;
to_read = inf_size;
/* Create a worklist. Allocate an extra slot for ENTRY_BLOCK, and one
because the `head == tail' style test for an empty queue doesn't
work with a full queue. */
- queue = (basic_block *) xmalloc ((n_basic_blocks + 2) * sizeof (*queue));
+ queue = xmalloc ((n_basic_blocks + 2) * sizeof (*queue));
qtail = queue;
qhead = qend = queue + n_basic_blocks + 2;
pbi->flags = flags;
if (flags & (PROP_LOG_LINKS | PROP_AUTOINC))
- pbi->reg_next_use = (rtx *) xcalloc (max_reg_num (), sizeof (rtx));
+ pbi->reg_next_use = xcalloc (max_reg_num (), sizeof (rtx));
else
pbi->reg_next_use = NULL;
struct reg_cond_life_info *rcli;
rtx cond;
- rcli = (struct reg_cond_life_info *) xmalloc (sizeof (*rcli));
+ rcli = xmalloc (sizeof (*rcli));
if (REGNO_REG_SET_P (bb_true->global_live_at_start, i))
cond = cond_false;
/* The register was unconditionally live previously.
Record the current condition as the condition under
which it is dead. */
- rcli = (struct reg_cond_life_info *) xmalloc (sizeof (*rcli));
+ rcli = xmalloc (sizeof (*rcli));
rcli->condition = cond;
rcli->stores = cond;
rcli->orig_condition = const0_rtx;
{
/* The register was not previously live at all. Record
the condition under which it is still dead. */
- rcli = (struct reg_cond_life_info *) xmalloc (sizeof (*rcli));
+ rcli = xmalloc (sizeof (*rcli));
rcli->condition = not_reg_cond (cond);
rcli->stores = const0_rtx;
rcli->orig_condition = const0_rtx;
encode (arg1, l1, h1);
encode (arg2, l2, h2);
- memset ((char *) prod, 0, sizeof prod);
+ memset (prod, 0, sizeof prod);
for (i = 0; i < 4; i++)
{
goto finish_up;
}
- memset ((char *) quo, 0, sizeof quo);
+ memset (quo, 0, sizeof quo);
- memset ((char *) num, 0, sizeof num); /* to zero 9th element */
- memset ((char *) den, 0, sizeof den);
+ memset (num, 0, sizeof num); /* to zero 9th element */
+ memset (den, 0, sizeof den);
encode (num, lnum, hnum);
encode (den, lden, hden);
if (best_p->size - rounded_size >= alignment)
{
- p = (struct temp_slot *) ggc_alloc (sizeof (struct temp_slot));
+ p = ggc_alloc (sizeof (struct temp_slot));
p->in_use = p->addr_taken = 0;
p->size = best_p->size - rounded_size;
p->base_offset = best_p->base_offset + rounded_size;
{
HOST_WIDE_INT frame_offset_old = frame_offset;
- p = (struct temp_slot *) ggc_alloc (sizeof (struct temp_slot));
+ p = ggc_alloc (sizeof (struct temp_slot));
/* We are passing an explicit alignment request to assign_stack_local.
One side effect of that is assign_stack_local will not round SIZE
{
struct var_refs_queue *temp;
- temp
- = (struct var_refs_queue *) ggc_alloc (sizeof (struct var_refs_queue));
+ temp = ggc_alloc (sizeof (struct var_refs_queue));
temp->modified = reg;
temp->promoted_mode = promoted_mode;
temp->unsignedp = unsigned_p;
if (p == 0)
{
- p = (struct fixup_replacement *) xmalloc (sizeof (struct fixup_replacement));
+ p = xmalloc (sizeof (struct fixup_replacement));
p->old = x;
p->new = 0;
p->next = *replacements;
rtx insn_list;
tmp.key = var;
- ime = (struct insns_for_mem_entry *) htab_find (ht, &tmp);
+ ime = htab_find (ht, &tmp);
for (insn_list = ime->insns; insn_list != 0; insn_list = XEXP (insn_list, 1))
if (INSN_P (XEXP (insn_list, 0)))
fixup_var_refs_insn (XEXP (insn_list, 0), var, promoted_mode,
{
struct insns_for_mem_entry *ifme;
tmp.key = *r;
- ifme = (struct insns_for_mem_entry *) htab_find (ifmwi->ht, &tmp);
+ ifme = htab_find (ifmwi->ht, &tmp);
/* If we have not already recorded this INSN, do so now. Since
we process the INSNs in order, we know that if we have
orig_fnargs = fnargs;
max_parm_reg = LAST_VIRTUAL_REGISTER + 1;
- parm_reg_stack_loc = (rtx *) ggc_alloc_cleared (max_parm_reg * sizeof (rtx));
+ parm_reg_stack_loc = ggc_alloc_cleared (max_parm_reg * sizeof (rtx));
if (SPLIT_COMPLEX_ARGS)
fnargs = split_complex_args (fnargs);
but it's also rare and we need max_parm_reg to be
precisely correct. */
max_parm_reg = regno + 1;
- new = (rtx *) ggc_realloc (parm_reg_stack_loc,
- max_parm_reg * sizeof (rtx));
- memset ((char *) (new + old_max_parm_reg), 0,
- (max_parm_reg - old_max_parm_reg) * sizeof (rtx));
+ new = ggc_realloc (parm_reg_stack_loc,
+ max_parm_reg * sizeof (rtx));
+ memset (new + old_max_parm_reg, 0,
+ (max_parm_reg - old_max_parm_reg) * sizeof (rtx));
parm_reg_stack_loc = new;
}
/* Fill the BLOCK_VECTOR with all of the BLOCKs in this function, in
depth-first order. */
block_vector = get_block_vector (block, &n_blocks);
- block_stack = (tree *) xmalloc (n_blocks * sizeof (tree));
+ block_stack = xmalloc (n_blocks * sizeof (tree));
last_block_vector = identify_blocks_1 (get_insns (),
block_vector + 1,
tree *block_vector;
*n_blocks_p = all_blocks (block, NULL);
- block_vector = (tree *) xmalloc (*n_blocks_p * sizeof (tree));
+ block_vector = xmalloc (*n_blocks_p * sizeof (tree));
all_blocks (block, block_vector);
return block_vector;
static void
prepare_function_start (void)
{
- cfun = (struct function *) ggc_alloc_cleared (sizeof (struct function));
+ cfun = ggc_alloc_cleared (sizeof (struct function));
init_stmt_for_function ();
init_eh_for_function ();
int argc = *argcp;
const char *const *argv = *argvp;
int newvsize = (argc + 2) * 2 * sizeof (const char *);
- const char **newv =
- (const char **) xmalloc (newvsize);
+ const char **newv = xmalloc (newvsize);
int newindex = 0;
i = 0;
}
newvsize += spaces * sizeof (const char *);
- newv = (const char **) xrealloc (newv, newvsize);
+ newv = xrealloc (newv, newvsize);
sp = target_option_translations[tott_idx].replacements;
np = xstrdup (sp);
notice ("Using built-in specs.\n");
#ifdef EXTRA_SPECS
- extra_specs = (struct spec_list *)
- xcalloc (sizeof (struct spec_list), ARRAY_SIZE (extra_specs_1));
+ extra_specs = xcalloc (sizeof (struct spec_list),
+ ARRAY_SIZE (extra_specs_1));
for (i = ARRAY_SIZE (extra_specs_1) - 1; i >= 0; i--)
{
if (!sl)
{
/* Not found - make it. */
- sl = (struct spec_list *) xmalloc (sizeof (struct spec_list));
+ sl = xmalloc (sizeof (struct spec_list));
sl->name = xstrdup (name);
sl->name_len = name_len;
sl->ptr_spec = &sl->ptr;
alloc_args (void)
{
argbuf_length = 10;
- argbuf = (const char **) xmalloc (argbuf_length * sizeof (const char *));
+ argbuf = xmalloc (argbuf_length * sizeof (const char *));
}
/* Clear out the vector of arguments (after a command is executed). */
store_arg (const char *arg, int delete_always, int delete_failure)
{
if (argbuf_index + 1 == argbuf_length)
- argbuf
- = (const char **) xrealloc (argbuf,
- (argbuf_length *= 2) * sizeof (const char *));
+ argbuf = xrealloc (argbuf, (argbuf_length *= 2) * sizeof (const char *));
argbuf[argbuf_index++] = arg;
argbuf[argbuf_index] = 0;
{
/* Add this pair to the vector. */
compilers
- = ((struct compiler *)
- xrealloc (compilers,
- (n_compilers + 2) * sizeof (struct compiler)));
+ = xrealloc (compilers,
+ (n_compilers + 2) * sizeof (struct compiler));
compilers[n_compilers].suffix = suffix;
compilers[n_compilers].spec = spec;
if (! strcmp (name, temp->name))
goto already1;
- temp = (struct temp_file *) xmalloc (sizeof (struct temp_file));
+ temp = xmalloc (sizeof (struct temp_file));
temp->next = always_delete_queue;
temp->name = name;
always_delete_queue = temp;
if (! strcmp (name, temp->name))
goto already2;
- temp = (struct temp_file *) xmalloc (sizeof (struct temp_file));
+ temp = xmalloc (sizeof (struct temp_file));
temp->next = failure_delete_queue;
temp->name = name;
failure_delete_queue = temp;
if (len > pprefix->max_len)
pprefix->max_len = len;
- pl = (struct prefix_list *) xmalloc (sizeof (struct prefix_list));
+ pl = xmalloc (sizeof (struct prefix_list));
pl->prefix = prefix;
pl->require_machine_suffix = require_machine_suffix;
pl->used_flag_ptr = warn;
n_commands++;
/* Get storage for each command. */
- commands = (struct command *) alloca (n_commands * sizeof (struct command));
+ commands = alloca (n_commands * sizeof (struct command));
/* Split argbuf into its separate piped processes,
and record info about each one.
n_preprocessor_options++;
if (! preprocessor_options)
- preprocessor_options
- = (char **) xmalloc (n_preprocessor_options * sizeof (char *));
+ preprocessor_options = xmalloc (n_preprocessor_options * sizeof (char *));
else
- preprocessor_options
- = (char **) xrealloc (preprocessor_options,
- n_preprocessor_options * sizeof (char *));
+ preprocessor_options = xrealloc (preprocessor_options,
+ n_preprocessor_options * sizeof (char *));
preprocessor_options [n_preprocessor_options - 1] =
save_string (option, len);
n_assembler_options++;
if (! assembler_options)
- assembler_options
- = (char **) xmalloc (n_assembler_options * sizeof (char *));
+ assembler_options = xmalloc (n_assembler_options * sizeof (char *));
else
- assembler_options
- = (char **) xrealloc (assembler_options,
- n_assembler_options * sizeof (char *));
+ assembler_options = xrealloc (assembler_options,
+ n_assembler_options * sizeof (char *));
assembler_options [n_assembler_options - 1] = save_string (option, len);
}
n_linker_options++;
if (! linker_options)
- linker_options
- = (char **) xmalloc (n_linker_options * sizeof (char *));
+ linker_options = xmalloc (n_linker_options * sizeof (char *));
else
- linker_options
- = (char **) xrealloc (linker_options,
- n_linker_options * sizeof (char *));
+ linker_options = xrealloc (linker_options,
+ n_linker_options * sizeof (char *));
linker_options [n_linker_options - 1] = save_string (option, len);
}
if (temp)
{
const char *startp, *endp;
- char *nstore = (char *) alloca (strlen (temp) + 3);
+ char *nstore = alloca (strlen (temp) + 3);
startp = endp = temp;
while (1)
if (temp && *cross_compile == '0')
{
const char *startp, *endp;
- char *nstore = (char *) alloca (strlen (temp) + 3);
+ char *nstore = alloca (strlen (temp) + 3);
startp = endp = temp;
while (1)
if (temp && *cross_compile == '0')
{
const char *startp, *endp;
- char *nstore = (char *) alloca (strlen (temp) + 3);
+ char *nstore = alloca (strlen (temp) + 3);
startp = endp = temp;
while (1)
}
else if (strcmp (argv[i], "-specs") == 0)
{
- struct user_specs *user = (struct user_specs *)
- xmalloc (sizeof (struct user_specs));
+ struct user_specs *user = xmalloc (sizeof (struct user_specs));
if (++i >= argc)
fatal ("argument to `-specs' is missing");
}
else if (strncmp (argv[i], "-specs=", 7) == 0)
{
- struct user_specs *user = (struct user_specs *)
- xmalloc (sizeof (struct user_specs));
+ struct user_specs *user = xmalloc (sizeof (struct user_specs));
if (strlen (argv[i]) == 7)
fatal ("argument to `-specs=' is missing");
for (j = 0; j < ARRAY_SIZE (modify_target); j++)
if (! strcmp (argv[i], modify_target[j].sw))
{
- char *new_name
- = (char *) xmalloc (strlen (modify_target[j].str)
- + strlen (spec_machine));
+ char *new_name = xmalloc (strlen (modify_target[j].str)
+ + strlen (spec_machine));
const char *p, *r;
char *q;
int made_addition = 0;
/* Then create the space for the vectors and scan again. */
- switches = ((struct switchstr *)
- xmalloc ((n_switches + 1) * sizeof (struct switchstr)));
- infiles = (struct infile *) xmalloc ((n_infiles + 1) * sizeof (struct infile));
+ switches = xmalloc ((n_switches + 1) * sizeof (struct switchstr));
+ infiles = xmalloc ((n_infiles + 1) * sizeof (struct infile));
n_switches = 0;
n_infiles = 0;
last_language_n_infiles = -1;
if (i + n_args >= argc)
fatal ("argument to `-%s' is missing", p);
switches[n_switches].args
- = (const char **) xmalloc ((n_args + 1) * sizeof(const char *));
+ = xmalloc ((n_args + 1) * sizeof(const char *));
while (j < n_args)
switches[n_switches].args[j++] = argv[++i];
/* Null-terminate the vector. */
{
/* On some systems, ld cannot handle some options without
a space. So split the option from its argument. */
- char *part1 = (char *) xmalloc (2);
+ char *part1 = xmalloc (2);
part1[0] = c;
part1[1] = '\0';
switches[n_switches].part1 = part1;
- switches[n_switches].args
- = (const char **) xmalloc (2 * sizeof (const char *));
+ switches[n_switches].args = xmalloc (2 * sizeof (const char *));
switches[n_switches].args[0] = xstrdup (p+1);
switches[n_switches].args[1] = 0;
}
{
struct prefix_list *pl = startfile_prefixes.plist;
size_t bufsize = 100;
- char *buffer = (char *) xmalloc (bufsize);
+ char *buffer = xmalloc (bufsize);
int idx;
for (; pl; pl = pl->next)
>= bufsize)
bufsize = (strlen (pl->prefix)
+ strlen (machine_suffix)) * 2 + 1;
- buffer = (char *) xrealloc (buffer, bufsize);
+ buffer = xrealloc (buffer, bufsize);
strcpy (buffer, pl->prefix);
strcat (buffer, machine_suffix);
if (is_directory (buffer, multilib_dir, 1))
/* Remove slash from machine_suffix. */
if (strlen (machine_suffix) >= bufsize)
bufsize = strlen (machine_suffix) * 2 + 1;
- buffer = (char *) xrealloc (buffer, bufsize);
+ buffer = xrealloc (buffer, bufsize);
strcpy (buffer, machine_suffix);
idx = strlen (buffer);
if (IS_DIR_SEPARATOR (buffer[idx - 1]))
/* Remove slash from pl->prefix. */
if (strlen (pl->prefix) >= bufsize)
bufsize = strlen (pl->prefix) * 2 + 1;
- buffer = (char *) xrealloc (buffer, bufsize);
+ buffer = xrealloc (buffer, bufsize);
strcpy (buffer, pl->prefix);
idx = strlen (buffer);
if (IS_DIR_SEPARATOR (buffer[idx - 1]))
char *buf;
while (*p != 0 && *p != '\n')
p++;
- buf = (char *) alloca (p - q + 1);
+ buf = alloca (p - q + 1);
strncpy (buf, q, p - q);
buf[p - q] = 0;
error ("%s", buf);
char *buf;
while (*p != 0 && *p != '\n')
p++;
- buf = (char *) alloca (p - q + 1);
+ buf = alloca (p - q + 1);
strncpy (buf, q, p - q);
buf[p - q] = 0;
notice ("%s\n", buf);
else
{
saved_suffix
- = (char *) xmalloc (suffix_length
- + strlen (TARGET_OBJECT_SUFFIX));
+ = xmalloc (suffix_length
+ + strlen (TARGET_OBJECT_SUFFIX));
strncpy (saved_suffix, suffix, suffix_length);
strcpy (saved_suffix + suffix_length,
TARGET_OBJECT_SUFFIX);
{
if (t == 0)
{
- t = (struct temp_name *) xmalloc (sizeof (struct temp_name));
+ t = xmalloc (sizeof (struct temp_name));
t->next = temp_names;
temp_names = t;
}
}
else
{
- char *x = (char *) alloca (strlen (name) * 2 + 1);
+ char *x = alloca (strlen (name) * 2 + 1);
char *buf = x;
const char *y = name;
int flag = 0;
{
int len1 = strlen (path1);
int len2 = strlen (path2);
- char *path = (char *) alloca (3 + len1 + len2);
+ char *path = alloca (3 + len1 + len2);
char *cp;
struct stat st;
/* Initialize the vector of specs to just the default.
This means one element containing 0s, as a terminator. */
- compilers = (struct compiler *) xmalloc (sizeof default_compilers);
- memcpy ((char *) compilers, (char *) default_compilers,
- sizeof default_compilers);
+ compilers = xmalloc (sizeof default_compilers);
+ memcpy (compilers, default_compilers, sizeof default_compilers);
n_compilers = n_default_compilers;
/* Read specs from a file if there is one. */
/* We need to check standard_exec_prefix/just_machine_suffix/specs
for any override of as, ld and libraries. */
- specs_file = (char *) alloca (strlen (standard_exec_prefix)
- + strlen (just_machine_suffix)
- + sizeof ("specs"));
+ specs_file = alloca (strlen (standard_exec_prefix)
+ + strlen (just_machine_suffix) + sizeof ("specs"));
strcpy (specs_file, standard_exec_prefix);
strcat (specs_file, just_machine_suffix);
i = n_infiles;
i += lang_specific_extra_outfiles;
- outfiles = (const char **) xcalloc (i, sizeof (char *));
+ outfiles = xcalloc (i, sizeof (char *));
/* Record which files were specified explicitly as link input. */
if (*q == ';')
cnt++;
- matches =
- (struct mswitchstr *) alloca ((sizeof (struct mswitchstr)) * cnt);
+ matches = alloca ((sizeof (struct mswitchstr)) * cnt);
i = 0;
q = multilib_matches;
while (*q != '\0')
xmalloc from calling fatal, and prevents us from re-executing this
block of code. */
mswitches
- = (struct mswitchstr *)
- xmalloc (sizeof (struct mswitchstr)
+ = xmalloc (sizeof (struct mswitchstr)
* (n_mdswitches + (n_switches ? n_switches : 1)));
for (i = 0; i < n_switches; i++)
{
{
int i = 0;
- mdswitches
- = (struct mdswitchstr *) xmalloc (sizeof (struct mdswitchstr)
- * n_mdswitches);
+ mdswitches = xmalloc (sizeof (struct mdswitchstr) * n_mdswitches);
for (start = multilib_defaults; *start != '\0'; start = end + 1)
{
while (*start == ' ' || *start == '\t')
if (shared_libgcc)
{
/* Make sure to have room for the trailing NULL argument. */
- arglist = (const char **) xmalloc ((argc+2) * sizeof (char *));
+ arglist = xmalloc ((argc+2) * sizeof (char *));
i = 0;
do
for (fn = functions; fn; fn = fn->next)
solve_flow_graph (fn);
for (src = sources; src; src = src->next)
- src->lines = (line_t *) xcalloc (src->num_lines, sizeof (line_t));
+ src->lines = xcalloc (src->num_lines, sizeof (line_t));
for (fn = functions; fn; fn = fn->next)
{
coverage_t coverage;
if (!strcmp (file_name, src->name))
return src;
- src = (source_t *)xcalloc (1, sizeof (source_t));
+ src = xcalloc (1, sizeof (source_t));
src->name = xstrdup (file_name);
src->coverage.name = src->name;
src->index = sources ? sources->index + 1 : 1;
src = find_source (gcov_read_string ());
lineno = gcov_read_unsigned ();
- fn = (function_t *)xcalloc (1, sizeof (function_t));
+ fn = xcalloc (1, sizeof (function_t));
fn->name = function_name;
fn->ident = ident;
fn->checksum = checksum;
unsigned ix, num_blocks = GCOV_TAG_BLOCKS_NUM (length);
fn->num_blocks = num_blocks;
- fn->blocks
- = (block_t *)xcalloc (fn->num_blocks, sizeof (block_t));
+ fn->blocks = xcalloc (fn->num_blocks, sizeof (block_t));
for (ix = 0; ix != num_blocks; ix++)
fn->blocks[ix].flags = gcov_read_unsigned ();
}
if (dest >= fn->num_blocks)
goto corrupt;
- arc = (arc_t *) xcalloc (1, sizeof (arc_t));
+ arc = xcalloc (1, sizeof (arc_t));
arc->dst = &fn->blocks[dest];
arc->src = &fn->blocks[src];
else if (fn && tag == GCOV_TAG_LINES)
{
unsigned blockno = gcov_read_unsigned ();
- unsigned *line_nos
- = (unsigned *)xcalloc (length - 1, sizeof (unsigned));
+ unsigned *line_nos = xcalloc (length - 1, sizeof (unsigned));
if (blockno >= fn->num_blocks || fn->blocks[blockno].u.line.encoding)
goto corrupt;
goto mismatch;
if (!fn->counts)
- fn->counts
- = (gcov_type *)xcalloc (fn->num_counts, sizeof (gcov_type));
+ fn->counts = xcalloc (fn->num_counts, sizeof (gcov_type));
for (ix = 0; ix != fn->num_counts; ix++)
fn->counts[ix] += gcov_read_counter ();
};
\f
static void compute_can_copy (void);
-static char *gmalloc (unsigned int);
-static char *grealloc (char *, unsigned int);
-static char *gcse_alloc (unsigned long);
+static void *gmalloc (unsigned int);
+static void *grealloc (void *, unsigned int);
+static void *gcse_alloc (unsigned long);
static void alloc_gcse_mem (rtx);
static void free_gcse_mem (void);
static void alloc_reg_set_mem (int);
if (changed)
{
free_modify_mem_tables ();
- modify_mem_list
- = (rtx *) gmalloc (last_basic_block * sizeof (rtx));
+ modify_mem_list = gmalloc (last_basic_block * sizeof (rtx));
canon_modify_mem_list
- = (rtx *) gmalloc (last_basic_block * sizeof (rtx));
- memset ((char *) modify_mem_list, 0, last_basic_block * sizeof (rtx));
- memset ((char *) canon_modify_mem_list, 0, last_basic_block * sizeof (rtx));
+ = gmalloc (last_basic_block * sizeof (rtx));
+ memset (modify_mem_list, 0, last_basic_block * sizeof (rtx));
+ memset (canon_modify_mem_list, 0, last_basic_block * sizeof (rtx));
}
free_reg_set_mem ();
alloc_reg_set_mem (max_reg_num ());
\f
/* Cover function to xmalloc to record bytes allocated. */
-static char *
+static void *
gmalloc (unsigned int size)
{
bytes_used += size;
We don't record the additional size since we don't know it.
It won't affect memory usage stats much anyway. */
-static char *
-grealloc (char *ptr, unsigned int size)
+static void *
+grealloc (void *ptr, unsigned int size)
{
return xrealloc (ptr, size);
}
/* Cover function to obstack_alloc. */
-static char *
+static void *
gcse_alloc (unsigned long size)
{
bytes_used += size;
- return (char *) obstack_alloc (&gcse_obstack, size);
+ return obstack_alloc (&gcse_obstack, size);
}
/* Allocate memory for the cuid mapping array,
max_uid = get_max_uid ();
n = (max_uid + 1) * sizeof (int);
- uid_cuid = (int *) gmalloc (n);
- memset ((char *) uid_cuid, 0, n);
+ uid_cuid = gmalloc (n);
+ memset (uid_cuid, 0, n);
for (insn = f, i = 0; insn; insn = NEXT_INSN (insn))
{
if (INSN_P (insn))
max_cuid = i;
n = (max_cuid + 1) * sizeof (rtx);
- cuid_insn = (rtx *) gmalloc (n);
- memset ((char *) cuid_insn, 0, n);
+ cuid_insn = gmalloc (n);
+ memset (cuid_insn, 0, n);
for (insn = f, i = 0; insn; insn = NEXT_INSN (insn))
if (INSN_P (insn))
CUID_INSN (i++) = insn;
reg_set_bitmap = BITMAP_XMALLOC ();
/* Allocate vars to track sets of regs, memory per block. */
- reg_set_in_block = (sbitmap *) sbitmap_vector_alloc (last_basic_block,
- max_gcse_regno);
+ reg_set_in_block = sbitmap_vector_alloc (last_basic_block, max_gcse_regno);
/* Allocate array to keep a list of insns which modify memory in each
basic block. */
- modify_mem_list = (rtx *) gmalloc (last_basic_block * sizeof (rtx));
- canon_modify_mem_list = (rtx *) gmalloc (last_basic_block * sizeof (rtx));
- memset ((char *) modify_mem_list, 0, last_basic_block * sizeof (rtx));
- memset ((char *) canon_modify_mem_list, 0, last_basic_block * sizeof (rtx));
+ modify_mem_list = gmalloc (last_basic_block * sizeof (rtx));
+ canon_modify_mem_list = gmalloc (last_basic_block * sizeof (rtx));
+ memset (modify_mem_list, 0, last_basic_block * sizeof (rtx));
+ memset (canon_modify_mem_list, 0, last_basic_block * sizeof (rtx));
modify_mem_list_set = BITMAP_XMALLOC ();
canon_modify_mem_list_set = BITMAP_XMALLOC ();
}
reg_set_table_size = n_regs + REG_SET_TABLE_SLOP;
n = reg_set_table_size * sizeof (struct reg_set *);
- reg_set_table = (struct reg_set **) gmalloc (n);
- memset ((char *) reg_set_table, 0, n);
+ reg_set_table = gmalloc (n);
+ memset (reg_set_table, 0, n);
gcc_obstack_init (®_set_obstack);
}
{
int new_size = regno + REG_SET_TABLE_SLOP;
- reg_set_table
- = (struct reg_set **) grealloc ((char *) reg_set_table,
- new_size * sizeof (struct reg_set *));
- memset ((char *) (reg_set_table + reg_set_table_size), 0,
+ reg_set_table = grealloc (reg_set_table,
+ new_size * sizeof (struct reg_set *));
+ memset (reg_set_table + reg_set_table_size, 0,
(new_size - reg_set_table_size) * sizeof (struct reg_set *));
reg_set_table_size = new_size;
}
- new_reg_info = (struct reg_set *) obstack_alloc (®_set_obstack,
- sizeof (struct reg_set));
+ new_reg_info = obstack_alloc (®_set_obstack, sizeof (struct reg_set));
bytes_used += sizeof (struct reg_set);
new_reg_info->insn = insn;
new_reg_info->next = reg_set_table[regno];
if (! found)
{
- cur_expr = (struct expr *) gcse_alloc (sizeof (struct expr));
+ cur_expr = gcse_alloc (sizeof (struct expr));
bytes_used += sizeof (struct expr);
if (table->table[hash] == NULL)
/* This is the first pattern that hashed to this index. */
else
{
/* First occurrence of this expression in this basic block. */
- antic_occr = (struct occr *) gcse_alloc (sizeof (struct occr));
+ antic_occr = gcse_alloc (sizeof (struct occr));
bytes_used += sizeof (struct occr);
/* First occurrence of this expression in any block? */
if (cur_expr->antic_occr == NULL)
else
{
/* First occurrence of this expression in this basic block. */
- avail_occr = (struct occr *) gcse_alloc (sizeof (struct occr));
+ avail_occr = gcse_alloc (sizeof (struct occr));
bytes_used += sizeof (struct occr);
/* First occurrence of this expression in any block? */
if (! found)
{
- cur_expr = (struct expr *) gcse_alloc (sizeof (struct expr));
+ cur_expr = gcse_alloc (sizeof (struct expr));
bytes_used += sizeof (struct expr);
if (table->table[hash] == NULL)
/* This is the first pattern that hashed to this index. */
else
{
/* First occurrence of this expression in this basic block. */
- cur_occr = (struct occr *) gcse_alloc (sizeof (struct occr));
+ cur_occr = gcse_alloc (sizeof (struct occr));
bytes_used += sizeof (struct occr);
/* First occurrence of this expression in any block? */
unsigned int *hash_val;
struct expr *expr;
- flat_table
- = (struct expr **) xcalloc (table->n_elems, sizeof (struct expr *));
- hash_val = (unsigned int *) xmalloc (table->n_elems * sizeof (unsigned int));
+ flat_table = xcalloc (table->n_elems, sizeof (struct expr *));
+ hash_val = xmalloc (table->n_elems * sizeof (unsigned int));
for (i = 0; i < (int) table->size; i++)
for (expr = table->table[i]; expr != NULL; expr = expr->next_same_hash)
/* re-Cache any INSN_LIST nodes we have allocated. */
clear_modify_mem_tables ();
/* Some working arrays used to track first and last set in each block. */
- reg_avail_info = (struct reg_avail_info*)
- gmalloc (max_gcse_regno * sizeof (struct reg_avail_info));
+ reg_avail_info = gmalloc (max_gcse_regno * sizeof (struct reg_avail_info));
for (i = 0; i < max_gcse_regno; ++i)
reg_avail_info[i].last_bb = NULL;
??? Later take some measurements. */
table->size |= 1;
n = table->size * sizeof (struct expr *);
- table->table = (struct expr **) gmalloc (n);
+ table->table = gmalloc (n);
table->set_p = set_p;
}
{
/* Initialize count of number of entries in hash table. */
table->n_elems = 0;
- memset ((char *) table->table, 0,
- table->size * sizeof (struct expr *));
+ memset (table->table, 0, table->size * sizeof (struct expr *));
compute_hash_table_work (table);
}
static void
alloc_rd_mem (int n_blocks, int n_insns)
{
- rd_kill = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_insns);
+ rd_kill = sbitmap_vector_alloc (n_blocks, n_insns);
sbitmap_vector_zero (rd_kill, n_blocks);
- rd_gen = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_insns);
+ rd_gen = sbitmap_vector_alloc (n_blocks, n_insns);
sbitmap_vector_zero (rd_gen, n_blocks);
- reaching_defs = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_insns);
+ reaching_defs = sbitmap_vector_alloc (n_blocks, n_insns);
sbitmap_vector_zero (reaching_defs, n_blocks);
- rd_out = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_insns);
+ rd_out = sbitmap_vector_alloc (n_blocks, n_insns);
sbitmap_vector_zero (rd_out, n_blocks);
}
static void
alloc_avail_expr_mem (int n_blocks, int n_exprs)
{
- ae_kill = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_exprs);
+ ae_kill = sbitmap_vector_alloc (n_blocks, n_exprs);
sbitmap_vector_zero (ae_kill, n_blocks);
- ae_gen = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_exprs);
+ ae_gen = sbitmap_vector_alloc (n_blocks, n_exprs);
sbitmap_vector_zero (ae_gen, n_blocks);
- ae_in = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_exprs);
+ ae_in = sbitmap_vector_alloc (n_blocks, n_exprs);
sbitmap_vector_zero (ae_in, n_blocks);
- ae_out = (sbitmap *) sbitmap_vector_alloc (n_blocks, n_exprs);
+ ae_out = sbitmap_vector_alloc (n_blocks, n_exprs);
sbitmap_vector_zero (ae_out, n_blocks);
}
int check_self_loop)
{
int rval;
- char *visited = (char *) xcalloc (last_basic_block, 1);
+ char *visited = xcalloc (last_basic_block, 1);
rval = expr_reaches_here_p_work (occr, expr, bb, check_self_loop, visited);
local_cprop_pass (cprop_jumps);
/* Determine implicit sets. */
- implicit_sets = (rtx *) xcalloc (last_basic_block, sizeof (rtx));
+ implicit_sets = xcalloc (last_basic_block, sizeof (rtx));
find_implicit_sets ();
alloc_hash_table (max_cuid, &set_hash_table, 1);
pre_expr_reaches_here_p (basic_block occr_bb, struct expr *expr, basic_block bb)
{
int rval;
- char *visited = (char *) xcalloc (last_basic_block, 1);
+ char *visited = xcalloc (last_basic_block, 1);
rval = pre_expr_reaches_here_p_work (occr_bb, expr, bb, visited);
/* Compute a mapping from expression number (`bitmap_index') to
hash table entry. */
- index_map = (struct expr **) xcalloc (expr_hash_table.n_elems, sizeof (struct expr *));
+ index_map = xcalloc (expr_hash_table.n_elems, sizeof (struct expr *));
for (i = 0; i < expr_hash_table.size; i++)
for (expr = expr_hash_table.table[i]; expr != NULL; expr = expr->next_same_hash)
index_map[expr->bitmap_index] = expr;
/* Go through the basic blocks, seeing whether or not each block
ends with a conditional branch whose condition is a comparison
against zero. Record the register compared in BLOCK_REG. */
- block_reg = (unsigned int *) xcalloc (last_basic_block, sizeof (int));
+ block_reg = xcalloc (last_basic_block, sizeof (int));
FOR_EACH_BB (bb)
{
rtx last_insn = bb->end;
/* Compute a mapping from expression number (`bitmap_index') to
hash table entry. */
- index_map = (struct expr **) xcalloc (expr_hash_table.n_elems, sizeof (struct expr *));
+ index_map = xcalloc (expr_hash_table.n_elems, sizeof (struct expr *));
for (i = 0; i < expr_hash_table.size; i++)
for (expr = expr_hash_table.table[i]; expr != NULL; expr = expr->next_same_hash)
index_map[expr->bitmap_index] = expr;
if (!ptr)
{
- ptr = (struct ls_expr *) xmalloc (sizeof (struct ls_expr));
+ ptr = xmalloc (sizeof (struct ls_expr));
ptr->next = pre_ldst_mems;
ptr->expr = NULL;
max_gcse_regno = max_reg_num ();
- reg_set_in_block = (sbitmap *) sbitmap_vector_alloc (last_basic_block,
+ reg_set_in_block = sbitmap_vector_alloc (last_basic_block,
max_gcse_regno);
sbitmap_vector_zero (reg_set_in_block, last_basic_block);
pre_ldst_mems = 0;
/* Build the gen_vector. This is any store in the table which is not killed
by aliasing later in its block. */
- ae_gen = (sbitmap *) sbitmap_vector_alloc (last_basic_block, num_stores);
+ ae_gen = sbitmap_vector_alloc (last_basic_block, num_stores);
sbitmap_vector_zero (ae_gen, last_basic_block);
- st_antloc = (sbitmap *) sbitmap_vector_alloc (last_basic_block, num_stores);
+ st_antloc = sbitmap_vector_alloc (last_basic_block, num_stores);
sbitmap_vector_zero (st_antloc, last_basic_block);
for (ptr = first_ls_expr (); ptr != NULL; ptr = next_ls_expr (ptr))
}
}
- ae_kill = (sbitmap *) sbitmap_vector_alloc (last_basic_block, num_stores);
+ ae_kill = sbitmap_vector_alloc (last_basic_block, num_stores);
sbitmap_vector_zero (ae_kill, last_basic_block);
- transp = (sbitmap *) sbitmap_vector_alloc (last_basic_block, num_stores);
+ transp = sbitmap_vector_alloc (last_basic_block, num_stores);
sbitmap_vector_zero (transp, last_basic_block);
regs_set_in_block = xmalloc (sizeof (int) * max_gcse_regno);
if (unit == 0)
{
- unit = (struct function_unit *)
- xmalloc (sizeof (struct function_unit));
+ unit = xmalloc (sizeof (struct function_unit));
unit->name = xstrdup (name);
unit->multiplicity = multiplicity;
unit->simultaneity = simultaneity;
{
struct attr_hash *h;
- h = (struct attr_hash *) obstack_alloc (hash_obstack,
- sizeof (struct attr_hash));
+ h = obstack_alloc (hash_obstack, sizeof (struct attr_hash));
h->hashcode = hashcode;
h->u.rtl = rtl;
h->next = attr_hash_table[hashcode % RTL_HASH_SIZE];
{
struct attr_hash *h;
- h = (struct attr_hash *) obstack_alloc (hash_obstack,
- sizeof (struct attr_hash));
+ h = obstack_alloc (hash_obstack, sizeof (struct attr_hash));
h->hashcode = -hashcode;
h->u.str = str;
h->next = attr_hash_table[hashcode % RTL_HASH_SIZE];
return h->u.str; /* <-- return if found. */
/* Not found; create a permanent copy and add it to the hash table. */
- new_str = (char *) obstack_alloc (hash_obstack, len + 1);
+ new_str = obstack_alloc (hash_obstack, len + 1);
memcpy (new_str, str, len);
new_str[len] = '\0';
attr_hash_add_string (hashcode, new_str);
|| insn_alternatives[av->first_insn->insn_code]))
return av;
- av = (struct attr_value *) oballoc (sizeof (struct attr_value));
+ av = oballoc (sizeof (struct attr_value));
av->value = value;
av->next = attr->first_value;
attr->first_value = av;
/* Create an array of ops for each unit. Add an extra unit for the
result_ready_cost function that has the ops of all other units. */
- unit_ops = (struct function_unit_op ***)
- xmalloc ((num_units + 1) * sizeof (struct function_unit_op **));
- unit_num = (struct function_unit **)
- xmalloc ((num_units + 1) * sizeof (struct function_unit *));
+ unit_ops = xmalloc ((num_units + 1) * sizeof (struct function_unit_op **));
+ unit_num = xmalloc ((num_units + 1) * sizeof (struct function_unit *));
- unit_num[num_units] = unit = (struct function_unit *)
- xmalloc (sizeof (struct function_unit));
+ unit_num[num_units] = unit = xmalloc (sizeof (struct function_unit));
unit->num = num_units;
unit->num_opclasses = 0;
{
unit_num[num_units]->num_opclasses += unit->num_opclasses;
unit_num[unit->num] = unit;
- unit_ops[unit->num] = op_array = (struct function_unit_op **)
+ unit_ops[unit->num] = op_array =
xmalloc (unit->num_opclasses * sizeof (struct function_unit_op *));
for (op = unit->ops; op; op = op->next)
}
/* Compose the array of ops for the extra unit. */
- unit_ops[num_units] = op_array = (struct function_unit_op **)
+ unit_ops[num_units] = op_array =
xmalloc (unit_num[num_units]->num_opclasses
* sizeof (struct function_unit_op *));
else
av = get_attr_value (value, attr, id->insn_code);
- ie = (struct insn_ent *) oballoc (sizeof (struct insn_ent));
+ ie = oballoc (sizeof (struct insn_ent));
ie->insn_code = id->insn_code;
ie->insn_index = id->insn_code;
insert_insn_ent (av, ie);
no_address_fn[i],
address_fn[i]),
new_attr, ie->insn_code);
- new_ie = (struct insn_ent *) oballoc (sizeof (struct insn_ent));
+ new_ie = oballoc (sizeof (struct insn_ent));
new_ie->insn_code = ie->insn_code;
new_ie->insn_index = ie->insn_index;
insert_insn_ent (new_av, new_ie);
rtx defval = XEXP (exp, 1);
rtx new_defval = XEXP (exp, 1);
int len = XVECLEN (exp, 0);
- rtx *tests = (rtx *) xmalloc (len * sizeof (rtx));
+ rtx *tests = xmalloc (len * sizeof (rtx));
int allsame = 1;
rtx ret;
return;
/* Make 2 extra elements, for "code" values -2 and -1. */
- insn_code_values
- = (struct attr_value_list **) xmalloc ((insn_code_number + 2)
- * sizeof (struct attr_value_list *));
- memset ((char *) insn_code_values, 0,
- (insn_code_number + 2) * sizeof (struct attr_value_list *));
+ insn_code_values = xmalloc ((insn_code_number + 2)
+ * sizeof (struct attr_value_list *));
+ memset (insn_code_values, 0,
+ (insn_code_number + 2) * sizeof (struct attr_value_list *));
/* Offset the table address so we can index by -2 or -1. */
insn_code_values += 2;
- iv = ivbuf = ((struct attr_value_list *)
- xmalloc (num_insn_ents * sizeof (struct attr_value_list)));
+ iv = ivbuf = xmalloc (num_insn_ents * sizeof (struct attr_value_list));
for (i = 0; i < MAX_ATTRS_INDEX; i++)
for (attr = attrs[i]; attr; attr = attr->next)
cover the domain of the attribute. This makes the expanded COND form
order independent. */
- space = (struct dimension *) xmalloc (ndim * sizeof (struct dimension));
+ space = xmalloc (ndim * sizeof (struct dimension));
total = 1;
for (ndim = 0; list; ndim++)
for (i = 0; i < ndim; i++)
space[i].current_value = space[i].values;
- condtest = (rtx *) xmalloc (total * sizeof (rtx));
- condval = (rtx *) xmalloc (total * sizeof (rtx));
+ condtest = xmalloc (total * sizeof (rtx));
+ condval = xmalloc (total * sizeof (rtx));
/* Expand the tests and values by iterating over all values in the
attribute space. */
name_ptr = XSTR (exp, 1);
while ((p = next_comma_elt (&name_ptr)) != NULL)
{
- av = (struct attr_value *) oballoc (sizeof (struct attr_value));
+ av = oballoc (sizeof (struct attr_value));
av->value = attr_rtx (CONST_STRING, p);
av->next = attr->first_value;
attr->first_value = av;
{
struct insn_def *id;
- id = (struct insn_def *) oballoc (sizeof (struct insn_def));
+ id = oballoc (sizeof (struct insn_def));
id->next = defs;
defs = id;
id->def = exp;
have_annul_false = 1;
}
- delay = (struct delay_desc *) oballoc (sizeof (struct delay_desc));
+ delay = oballoc (sizeof (struct delay_desc));
delay->def = def;
delay->num = ++num_delays;
delay->next = delays;
if (unit == 0)
{
- unit = (struct function_unit *) oballoc (sizeof (struct function_unit));
+ unit = oballoc (sizeof (struct function_unit));
unit->name = name;
unit->multiplicity = multiplicity;
unit->simultaneity = simultaneity;
}
/* Make a new operation class structure entry and initialize it. */
- op = (struct function_unit_op *) oballoc (sizeof (struct function_unit_op));
+ op = oballoc (sizeof (struct function_unit_op));
op->condexp = condexp;
op->num = unit->num_opclasses++;
op->ready = ready_cost;
if (! create)
return NULL;
- attr = (struct attr_desc *) oballoc (sizeof (struct attr_desc));
+ attr = oballoc (sizeof (struct attr_desc));
attr->name = attr_string (name, strlen (name));
attr->first_value = attr->default_val = NULL;
attr->is_numeric = attr->negative_ok = attr->is_const = attr->is_special = 0;
printf ("#define operands recog_data.operand\n\n");
/* Make `insn_alternatives'. */
- insn_alternatives = (int *) oballoc (insn_code_number * sizeof (int));
+ insn_alternatives = oballoc (insn_code_number * sizeof (int));
for (id = defs; id; id = id->next)
if (id->insn_code >= 0)
insn_alternatives[id->insn_code] = (1 << id->num_alternatives) - 1;
/* Make `insn_n_alternatives'. */
- insn_n_alternatives = (int *) oballoc (insn_code_number * sizeof (int));
+ insn_n_alternatives = oballoc (insn_code_number * sizeof (int));
for (id = defs; id; id = id->next)
if (id->insn_code >= 0)
insn_n_alternatives[id->insn_code] = id->num_alternatives;
void
gen_automata_option (rtx def)
{
- if (strcmp ((char *) XSTR (def, 0), NO_MINIMIZATION_OPTION + 1) == 0)
+ if (strcmp (XSTR (def, 0), NO_MINIMIZATION_OPTION + 1) == 0)
no_minimization_flag = 1;
- else if (strcmp ((char *) XSTR (def, 0), TIME_OPTION + 1) == 0)
+ else if (strcmp (XSTR (def, 0), TIME_OPTION + 1) == 0)
time_flag = 1;
- else if (strcmp ((char *) XSTR (def, 0), V_OPTION + 1) == 0)
+ else if (strcmp (XSTR (def, 0), V_OPTION + 1) == 0)
v_flag = 1;
- else if (strcmp ((char *) XSTR (def, 0), W_OPTION + 1) == 0)
+ else if (strcmp (XSTR (def, 0), W_OPTION + 1) == 0)
w_flag = 1;
- else if (strcmp ((char *) XSTR (def, 0), NDFA_OPTION + 1) == 0)
+ else if (strcmp (XSTR (def, 0), NDFA_OPTION + 1) == 0)
ndfa_flag = 1;
else
fatal ("invalid option `%s' in automata_option", XSTR (def, 0));
LOW_VARIABLE_NAME, MIDDLE_VARIABLE_NAME, HIGH_VARIABLE_NAME);
fprintf (output_file, " static struct %s %s [] =\n {\n",
NAME_CODE_STRUCT_NAME, NAME_CODE_TABLE_NAME);
- units = (unit_decl_t *) xmalloc (sizeof (unit_decl_t)
- * description->units_num);
+ units = xmalloc (sizeof (unit_decl_t) * description->units_num);
memcpy (units, units_array, sizeof (unit_decl_t) * description->units_num);
qsort (units, description->units_num, sizeof (unit_decl_t), units_cmp);
for (i = 0; i < description->units_num; i++)
fprintf (output_file,
"void\n%s (void)\n{\n %s = get_max_uid ();\n",
DFA_START_FUNC_NAME, DFA_INSN_CODES_LENGTH_VARIABLE_NAME);
- fprintf (output_file, " %s = (int *) xmalloc (%s * sizeof (int));\n",
+ fprintf (output_file, " %s = xmalloc (%s * sizeof (int));\n",
DFA_INSN_CODES_VARIABLE_NAME, DFA_INSN_CODES_LENGTH_VARIABLE_NAME);
fprintf (output_file, " %s ();\n}\n\n", DFA_CLEAN_INSN_CACHE_FUNC_NAME);
}
if (expr[0] == 0)
return;
- test = (struct c_test *) xmalloc (sizeof (struct c_test));
+ test = xmalloc (sizeof (struct c_test));
test->expr = expr;
*(htab_find_slot (condition_table, test, INSERT)) = test;
if (i != XVECLEN (insn, 1) - 1)
{
struct clobber_pat *p;
- struct clobber_ent *link
- = (struct clobber_ent *) xmalloc (sizeof (struct clobber_ent));
+ struct clobber_ent *link = xmalloc (sizeof (struct clobber_ent));
int j;
link->code_number = insn_code_number;
if (p == 0)
{
- p = (struct clobber_pat *) xmalloc (sizeof (struct clobber_pat));
+ p = xmalloc (sizeof (struct clobber_pat));
p->insns = 0;
p->pattern = insn;
walk_rtx (XVECEXP (insn, 1, i), path);
}
- link = (struct code_ptr *) xmalloc (sizeof (struct code_ptr));
+ link = xmalloc (sizeof (struct code_ptr));
link->insn_code = insn_code_number;
/* See if we find something that already had this extraction method. */
/* Otherwise, make a new extraction method. */
- p = (struct extraction *) xmalloc (sizeof (struct extraction));
+ p = xmalloc (sizeof (struct extraction));
p->op_count = op_count;
p->dup_count = dup_count;
p->next = extractions;
dupnums[dup_count] = XINT (x, 0);
dup_count++;
- newpath = (char *) xmalloc (depth + 2);
+ newpath = xmalloc (depth + 2);
strcpy (newpath, path);
newpath[depth + 1] = 0;
oplocs[XINT (x, 0)] = xstrdup (path);
op_count = MAX (op_count, XINT (x, 0) + 1);
- newpath = (char *) xmalloc (depth + 2);
+ newpath = xmalloc (depth + 2);
strcpy (newpath, path);
newpath[depth + 1] = 0;
oplocs[XINT (x, 0)] = xstrdup (path);
op_count = MAX (op_count, XINT (x, 0) + 1);
- newpath = (char *) xmalloc (depth + 2);
+ newpath = xmalloc (depth + 2);
strcpy (newpath, path);
newpath[depth + 1] = 0;
break;
}
- newpath = (char *) xmalloc (depth + 2);
+ newpath = xmalloc (depth + 2);
strcpy (newpath, path);
newpath[depth + 1] = 0;
else if (GET_CODE (desc) == DEFINE_PEEPHOLE)
{
- struct code_ptr *link
- = (struct code_ptr *) xmalloc (sizeof (struct code_ptr));
+ struct code_ptr *link = xmalloc (sizeof (struct code_ptr));
link->insn_code = insn_code_number;
link->next = peepholes;
{
int new_size;
new_size = (insn_name_ptr_size ? insn_name_ptr_size * 2 : 512);
- insn_name_ptr =
- (char **) xrealloc (insn_name_ptr, sizeof(char *) * new_size);
+ insn_name_ptr = xrealloc (insn_name_ptr, sizeof(char *) * new_size);
memset (insn_name_ptr + insn_name_ptr_size, 0,
sizeof(char *) * (new_size - insn_name_ptr_size));
insn_name_ptr_size = new_size;
static void
gen_insn (rtx insn, int lineno)
{
- struct data *d = (struct data *) xmalloc (sizeof (struct data));
+ struct data *d = xmalloc (sizeof (struct data));
int i;
d->code_number = next_code_number;
static void
gen_peephole (rtx peep, int lineno)
{
- struct data *d = (struct data *) xmalloc (sizeof (struct data));
+ struct data *d = xmalloc (sizeof (struct data));
int i;
d->code_number = next_code_number;
static void
gen_expand (rtx insn, int lineno)
{
- struct data *d = (struct data *) xmalloc (sizeof (struct data));
+ struct data *d = xmalloc (sizeof (struct data));
int i;
d->code_number = next_code_number;
static void
gen_split (rtx split, int lineno)
{
- struct data *d = (struct data *) xmalloc (sizeof (struct data));
+ struct data *d = xmalloc (sizeof (struct data));
int i;
d->code_number = next_code_number;
static struct decision *
new_decision (const char *position, struct decision_head *last)
{
- struct decision *new
- = (struct decision *) xmalloc (sizeof (struct decision));
+ struct decision *new = xmalloc (sizeof (struct decision));
memset (new, 0, sizeof (*new));
new->success = *last;
struct decision_test **place = *pplace;
struct decision_test *test;
- test = (struct decision_test *) xmalloc (sizeof (*test));
+ test = xmalloc (sizeof (*test));
test->next = *place;
test->type = type;
*place = test;
if (depth > max_depth)
max_depth = depth;
- subpos = (char *) xmalloc (depth + 2);
+ subpos = xmalloc (depth + 2);
strcpy (subpos, position);
subpos[depth + 1] = 0;
{
int new_size;
new_size = (insn_name_ptr_size ? insn_name_ptr_size * 2 : 512);
- insn_name_ptr =
- (char **) xrealloc (insn_name_ptr, sizeof(char *) * new_size);
+ insn_name_ptr = xrealloc (insn_name_ptr, sizeof(char *) * new_size);
memset (insn_name_ptr + insn_name_ptr_size, 0,
sizeof(char *) * (new_size - insn_name_ptr_size));
insn_name_ptr_size = new_size;
queue_pattern (rtx pattern, struct queue_elem ***list_tail,
const char *filename, int lineno)
{
- struct queue_elem *e = (struct queue_elem *) xmalloc (sizeof (*e));
+ struct queue_elem *e = xmalloc (sizeof (*e));
e->data = pattern;
e->filename = filename;
e->lineno = lineno;
{
size_t c_len = strlen (c);
size_t len = alt * (c_len + 1);
- char *new_c = (char *) xmalloc (len);
+ char *new_c = xmalloc (len);
memcpy (new_c, c, c_len);
for (i = 1; i < alt; ++i)
{
struct file_name_list *dirtmp;
- dirtmp = (struct file_name_list *)
- xmalloc (sizeof (struct file_name_list));
+ dirtmp = xmalloc (sizeof (struct file_name_list));
dirtmp->next = 0; /* New one goes on the end */
if (first_dir_md_include == 0)
first_dir_md_include = dirtmp;
return -1;
dummy.expr = expr;
- test = (const struct c_test *) htab_find (condition_table, &dummy);
+ test = htab_find (condition_table, &dummy);
if (!test)
abort ();
if (G.depth_in_use >= G.depth_max)
{
G.depth_max *= 2;
- G.depth = (unsigned int *) xrealloc ((char *) G.depth,
- G.depth_max * sizeof (unsigned int));
+ G.depth = xrealloc (G.depth, G.depth_max * sizeof (unsigned int));
}
G.depth[G.depth_in_use++] = i;
}
if (G.by_depth_in_use >= G.by_depth_max)
{
G.by_depth_max *= 2;
- G.by_depth = (page_entry **) xrealloc ((char *) G.by_depth,
- G.by_depth_max * sizeof (page_entry *));
- G.save_in_use = (unsigned long **) xrealloc ((char *) G.save_in_use,
- G.by_depth_max * sizeof (unsigned long *));
+ G.by_depth = xrealloc (G.by_depth,
+ G.by_depth_max * sizeof (page_entry *));
+ G.save_in_use = xrealloc (G.save_in_use,
+ G.by_depth_max * sizeof (unsigned long *));
}
G.by_depth[G.by_depth_in_use] = p;
G.save_in_use[G.by_depth_in_use++] = s;
goto found;
/* Not found -- allocate a new table. */
- table = (page_table) xcalloc (1, sizeof(*table));
+ table = xcalloc (1, sizeof(*table));
table->next = G.lookup;
table->high_bits = high_bits;
G.lookup = table;
L2 = LOOKUP_L2 (p);
if (base[L1] == NULL)
- base[L1] = (page_entry **) xcalloc (PAGE_L2_SIZE, sizeof (page_entry *));
+ base[L1] = xcalloc (PAGE_L2_SIZE, sizeof (page_entry *));
base[L1][L2] = entry;
}
memory order. */
for (i = GGC_QUIRE_SIZE - 1; i >= 1; i--)
{
- e = (struct page_entry *) xcalloc (1, page_entry_size);
+ e = xcalloc (1, page_entry_size);
e->order = order;
e->bytes = G.pagesize;
e->page = page + (i << G.lg_pagesize);
struct page_entry *e, *f = G.free_pages;
for (a = enda - G.pagesize; a != page; a -= G.pagesize)
{
- e = (struct page_entry *) xcalloc (1, page_entry_size);
+ e = xcalloc (1, page_entry_size);
e->order = order;
e->bytes = G.pagesize;
e->page = a;
#endif
if (entry == NULL)
- entry = (struct page_entry *) xcalloc (1, page_entry_size);
+ entry = xcalloc (1, page_entry_size);
entry->bytes = entry_size;
entry->page = page;
}
/* We have a good page, might as well hold onto it... */
- e = (struct page_entry *) xcalloc (1, sizeof (struct page_entry));
+ e = xcalloc (1, sizeof (struct page_entry));
e->bytes = G.pagesize;
e->page = p;
e->next = G.free_pages;
G.depth_in_use = 0;
G.depth_max = 10;
- G.depth = (unsigned int *) xmalloc (G.depth_max * sizeof (unsigned int));
+ G.depth = xmalloc (G.depth_max * sizeof (unsigned int));
G.by_depth_in_use = 0;
G.by_depth_max = INITIAL_PTE_COUNT;
- G.by_depth = (page_entry **) xmalloc (G.by_depth_max * sizeof (page_entry *));
- G.save_in_use = (unsigned long **) xmalloc (G.by_depth_max * sizeof (unsigned long *));
+ G.by_depth = xmalloc (G.by_depth_max * sizeof (page_entry *));
+ G.save_in_use = xmalloc (G.by_depth_max * sizeof (unsigned long *));
}
/* Increment the `GC context'. Objects allocated in an outer context
page_entry **new_by_depth;
unsigned long **new_save_in_use;
- new_by_depth = (page_entry **) xmalloc (G.by_depth_max * sizeof (page_entry *));
- new_save_in_use = (unsigned long **) xmalloc (G.by_depth_max * sizeof (unsigned long *));
+ new_by_depth = xmalloc (G.by_depth_max * sizeof (page_entry *));
+ new_save_in_use = xmalloc (G.by_depth_max * sizeof (unsigned long *));
memcpy (&new_by_depth[0],
&G.by_depth[count_old_page_tables],
{
struct ggc_mem *x;
- x = (struct ggc_mem *) xmalloc (offsetof (struct ggc_mem, u) + size);
+ x = xmalloc (offsetof (struct ggc_mem, u) + size);
x->sub[0] = NULL;
x->sub[1] = NULL;
x->mark = 0;
/* Establish mappings from register number to allocation number
and vice versa. In the process, count the allocnos. */
- reg_allocno = (int *) xmalloc (max_regno * sizeof (int));
+ reg_allocno = xmalloc (max_regno * sizeof (int));
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
reg_allocno[i] = -1;
/* Initialize the shared-hard-reg mapping
from the list of pairs that may share. */
- reg_may_share = (int *) xcalloc (max_regno, sizeof (int));
+ reg_may_share = xcalloc (max_regno, sizeof (int));
for (x = regs_may_share; x; x = XEXP (XEXP (x, 1), 1))
{
int r1 = REGNO (XEXP (x, 0));
else
reg_allocno[i] = -1;
- allocno = (struct allocno *) xcalloc (max_allocno, sizeof (struct allocno));
+ allocno = xcalloc (max_allocno, sizeof (struct allocno));
for (i = FIRST_PSEUDO_REGISTER; i < (size_t) max_regno; i++)
if (reg_allocno[i] >= 0)
/* Calculate amount of usage of each hard reg by pseudos
allocated by local-alloc. This is to see if we want to
override it. */
- memset ((char *) local_reg_live_length, 0, sizeof local_reg_live_length);
- memset ((char *) local_reg_n_refs, 0, sizeof local_reg_n_refs);
- memset ((char *) local_reg_freq, 0, sizeof local_reg_freq);
+ memset (local_reg_live_length, 0, sizeof local_reg_live_length);
+ memset (local_reg_n_refs, 0, sizeof local_reg_n_refs);
+ memset (local_reg_freq, 0, sizeof local_reg_freq);
for (i = FIRST_PSEUDO_REGISTER; i < (size_t) max_regno; i++)
if (reg_renumber[i] >= 0)
{
/* We used to use alloca here, but the size of what it would try to
allocate would occasionally cause it to exceed the stack limit and
cause unpredictable core dumps. Some examples were > 2Mb in size. */
- conflicts = (INT_TYPE *) xcalloc (max_allocno * allocno_row_words,
- sizeof (INT_TYPE));
+ conflicts = xcalloc (max_allocno * allocno_row_words, sizeof (INT_TYPE));
- allocnos_live = (INT_TYPE *) xmalloc (allocno_row_words * sizeof (INT_TYPE));
+ allocnos_live = xmalloc (allocno_row_words * sizeof (INT_TYPE));
/* If there is work to be done (at least one reg to allocate),
perform global conflict analysis and allocate the regs. */
/* Determine the order to allocate the remaining pseudo registers. */
- allocno_order = (int *) xmalloc (max_allocno * sizeof (int));
+ allocno_order = xmalloc (max_allocno * sizeof (int));
for (i = 0; i < (size_t) max_allocno; i++)
allocno_order[i] = i;
int *block_start_allocnos;
/* Make a vector that mark_reg_{store,clobber} will store in. */
- regs_set = (rtx *) xmalloc (max_parallel * sizeof (rtx) * 2);
+ regs_set = xmalloc (max_parallel * sizeof (rtx) * 2);
- block_start_allocnos = (int *) xmalloc (max_allocno * sizeof (int));
+ block_start_allocnos = xmalloc (max_allocno * sizeof (int));
FOR_EACH_BB (b)
{
- memset ((char *) allocnos_live, 0, allocno_row_words * sizeof (INT_TYPE));
+ memset (allocnos_live, 0, allocno_row_words * sizeof (INT_TYPE));
/* Initialize table of registers currently live
to the state at the beginning of this basic block.
{
int i;
int num;
- int *allocno_to_order = (int *) xmalloc (max_allocno * sizeof (int));
+ int *allocno_to_order = xmalloc (max_allocno * sizeof (int));
/* Scan least most important to most important.
For each allocno, remove from preferences registers that cannot be used,
size_t namelen = strlen (base);
size_t suffixlen = strlen (suffix);
size_t extlen = strlen (graph_ext[graph_dump_format]) + 1;
- char *buf = (char *) alloca (namelen + suffixlen + extlen);
+ char *buf = alloca (namelen + suffixlen + extlen);
FILE *fp;
if (basic_block_info == NULL)
{
enum bb_state { NOT_IN_BB, IN_ONE_BB, IN_MULTIPLE_BB };
int max_uid = get_max_uid ();
- int *start = (int *) xmalloc (max_uid * sizeof (int));
- int *end = (int *) xmalloc (max_uid * sizeof (int));
- enum bb_state *in_bb_p = (enum bb_state *)
- xmalloc (max_uid * sizeof (enum bb_state));
+ int *start = xmalloc (max_uid * sizeof (int));
+ int *end = xmalloc (max_uid * sizeof (int));
+ enum bb_state *in_bb_p = xmalloc (max_uid * sizeof (enum bb_state));
basic_block bb;
int i;
size_t namelen = strlen (base);
size_t suffixlen = strlen (suffix);
size_t extlen = strlen (graph_ext[graph_dump_format]) + 1;
- char *buf = (char *) alloca (namelen + extlen + suffixlen);
+ char *buf = alloca (namelen + extlen + suffixlen);
FILE *fp;
memcpy (buf, base, namelen);
size_t namelen = strlen (base);
size_t suffixlen = strlen (suffix);
size_t extlen = strlen (graph_ext[graph_dump_format]) + 1;
- char *buf = (char *) alloca (namelen + suffixlen + extlen);
+ char *buf = alloca (namelen + suffixlen + extlen);
FILE *fp;
memcpy (buf, base, namelen);
static void
clear_units (void)
{
- memset ((char *) unit_last_insn, 0, sizeof (unit_last_insn));
- memset ((char *) unit_tick, 0, sizeof (unit_tick));
- memset ((char *) unit_n_insns, 0, sizeof (unit_n_insns));
+ memset (unit_last_insn, 0, sizeof (unit_last_insn));
+ memset (unit_tick, 0, sizeof (unit_tick));
+ memset (unit_n_insns, 0, sizeof (unit_n_insns));
}
/* Return the issue-delay of an insn. The scheduler using only DFA
/* Allocate the ready list. */
ready.veclen = rgn_n_insns + 1 + issue_rate;
ready.first = ready.veclen - 1;
- ready.vec = (rtx *) xmalloc (ready.veclen * sizeof (rtx));
+ ready.vec = xmalloc (ready.veclen * sizeof (rtx));
ready.n_ready = 0;
if (targetm.sched.use_dfa_pipeline_interface
{
/* It is used for first cycle multipass scheduling. */
temp_state = alloca (dfa_state_size);
- ready_try = (char *) xmalloc ((rgn_n_insns + 1) * sizeof (char));
+ ready_try = xmalloc ((rgn_n_insns + 1) * sizeof (char));
memset (ready_try, 0, (rgn_n_insns + 1) * sizeof (char));
- choice_stack
- = (struct choice_entry *) xmalloc ((rgn_n_insns + 1)
- * sizeof (struct choice_entry));
+ choice_stack = xmalloc ((rgn_n_insns + 1)
+ * sizeof (struct choice_entry));
for (i = 0; i <= rgn_n_insns; i++)
- choice_stack[i].state = (state_t) xmalloc (dfa_state_size);
+ choice_stack[i].state = xmalloc (dfa_state_size);
}
(*current_sched_info->init_ready_list) (&ready);
else
max_insn_queue_index_macro_value = max_insn_queue_index;
- insn_queue = (rtx *) alloca ((MAX_INSN_QUEUE_INDEX + 1) * sizeof (rtx));
- memset ((char *) insn_queue, 0, (MAX_INSN_QUEUE_INDEX + 1) * sizeof (rtx));
+ insn_queue = alloca ((MAX_INSN_QUEUE_INDEX + 1) * sizeof (rtx));
+ memset (insn_queue, 0, (MAX_INSN_QUEUE_INDEX + 1) * sizeof (rtx));
last_clock_var = -1;
/* Start just before the beginning of time. */
pseudos which do not cross calls. */
old_max_uid = get_max_uid () + 1;
- h_i_d = (struct haifa_insn_data *) xcalloc (old_max_uid, sizeof (*h_i_d));
+ h_i_d = xcalloc (old_max_uid, sizeof (*h_i_d));
for (i = 0; i < old_max_uid; i++)
h_i_d [i].cost = -1;
{
rtx line;
- line_note_head = (rtx *) xcalloc (last_basic_block, sizeof (rtx));
+ line_note_head = xcalloc (last_basic_block, sizeof (rtx));
/* Save-line-note-head:
Determine the line-number at the start of each basic block.
unsigned int nslots = 1 << order;
hash_table *table;
- table = (hash_table *) xmalloc (sizeof (hash_table));
+ table = xmalloc (sizeof (hash_table));
memset (table, 0, sizeof (hash_table));
/* Strings need no alignment. */
obstack_alignment_mask (&table->stack) = 0;
- table->entries = (hashnode *) xcalloc (nslots, sizeof (hashnode));
+ table->entries = xcalloc (nslots, sizeof (hashnode));
table->nslots = nslots;
return table;
}
unsigned int size, sizemask;
size = table->nslots * 2;
- nentries = (hashnode *) xcalloc (size, sizeof (hashnode));
+ nentries = xcalloc (size, sizeof (hashnode));
sizemask = size - 1;
p = table->entries;
tree parms;
/* Clear out PARMDECL_MAP. It was allocated in the caller's frame. */
- memset ((char *) parmdecl_map, 0, max_parm_reg * sizeof (tree));
+ memset (parmdecl_map, 0, max_parm_reg * sizeof (tree));
arg_vector = rtvec_alloc (list_length (DECL_ARGUMENTS (fndecl)));
for (parms = DECL_ARGUMENTS (fndecl), i = 0;
for the parms, prior to elimination of virtual registers.
These values are needed for substituting parms properly. */
if (! flag_no_inline)
- parmdecl_map = (tree *) xmalloc (max_parm_reg * sizeof (tree));
+ parmdecl_map = xmalloc (max_parm_reg * sizeof (tree));
/* Make and emit a return-label if we have not already done so. */
/* Expand the function arguments. Do this first so that any
new registers get created before we allocate the maps. */
- arg_vals = (rtx *) xmalloc (nargs * sizeof (rtx));
- arg_trees = (tree *) xmalloc (nargs * sizeof (tree));
+ arg_vals = xmalloc (nargs * sizeof (rtx));
+ arg_trees = xmalloc (nargs * sizeof (tree));
for (formal = DECL_ARGUMENTS (fndecl), actual = parms, i = 0;
formal;
/* Allocate the structures we use to remap things. */
- map = (struct inline_remap *) xcalloc (1, sizeof (struct inline_remap));
+ map = xcalloc (1, sizeof (struct inline_remap));
map->fndecl = fndecl;
VARRAY_TREE_INIT (map->block_map, 10, "block_map");
- map->reg_map = (rtx *) xcalloc (max_regno, sizeof (rtx));
+ map->reg_map = xcalloc (max_regno, sizeof (rtx));
/* We used to use alloca here, but the size of what it would try to
allocate would occasionally cause it to exceed the stack limit and
cause unpredictable core dumps. */
- real_label_map
- = (rtx *) xmalloc ((max_labelno) * sizeof (rtx));
+ real_label_map = xmalloc ((max_labelno) * sizeof (rtx));
map->label_map = real_label_map;
map->local_return_label = NULL_RTX;
inl_max_uid = (inl_f->emit->x_cur_insn_uid + 1);
- map->insn_map = (rtx *) xcalloc (inl_max_uid, sizeof (rtx));
+ map->insn_map = xcalloc (inl_max_uid, sizeof (rtx));
map->min_insnno = 0;
map->max_insnno = inl_max_uid;
/* Initialize label_map. get_label_from_map will actually make
the labels. */
- memset ((char *) &map->label_map[min_labelno], 0,
- (max_labelno - min_labelno) * sizeof (rtx));
+ memset (&map->label_map[min_labelno], 0,
+ (max_labelno - min_labelno) * sizeof (rtx));
/* Make copies of the decls of the symbols in the inline function, so that
the copies of the variables get declared in the current function. Set
if (ivs == 0)
{
- fun->hard_reg_initial_vals = (void *) ggc_alloc (sizeof (initial_value_struct));
+ fun->hard_reg_initial_vals = ggc_alloc (sizeof (initial_value_struct));
ivs = fun->hard_reg_initial_vals;
ivs->num_entries = 0;
ivs->max_entries = 5;
- ivs->entries = (initial_value_pair *) ggc_alloc (5 * sizeof (initial_value_pair));
+ ivs->entries = ggc_alloc (5 * sizeof (initial_value_pair));
}
if (ivs->num_entries >= ivs->max_entries)
{
ivs->max_entries += 5;
- ivs->entries =
- (initial_value_pair *) ggc_realloc (ivs->entries,
- ivs->max_entries
- * sizeof (initial_value_pair));
+ ivs->entries = ggc_realloc (ivs->entries,
+ ivs->max_entries
+ * sizeof (initial_value_pair));
}
ivs->entries[ivs->num_entries].hard_reg = reg;
/* We can do the replacement. Allocate reg_map if this is the
first replacement we found. */
if (reg_map == 0)
- reg_map = (rtx *) xcalloc (max_reg, sizeof (rtx));
+ reg_map = xcalloc (max_reg, sizeof (rtx));
REG_LOOP_TEST_P (reg) = 1;
tree globals = (*lang_hooks.decls.getdecls) ();
int len = list_length (globals);
- tree *vec = (tree *) xmalloc (sizeof (tree) * len);
+ tree *vec = xmalloc (sizeof (tree) * len);
int i;
tree decl;
/* Allocate a worklist array/queue. Entries are only added to the
list if they were not already on the list. So the size is
bounded by the number of basic blocks. */
- qin = qout = worklist
- = (basic_block *) xmalloc (sizeof (basic_block) * n_basic_blocks);
+ qin = qout = worklist = xmalloc (sizeof (basic_block) * n_basic_blocks);
/* We want a maximal solution, so make an optimistic initialization of
ANTIN. */
list if they were not already on the list. So the size is
bounded by the number of basic blocks. */
qin = qout = worklist
- = (basic_block *) xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
+ = xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
/* Initialize a mapping from each edge to its index. */
for (i = 0; i < num_edges; i++)
/* Allocate a worklist array/queue. Entries are only added to the
list if they were not already on the list. So the size is
bounded by the number of basic blocks. */
- qin = qout = worklist
- = (basic_block *) xmalloc (sizeof (basic_block) * n_basic_blocks);
+ qin = qout = worklist = xmalloc (sizeof (basic_block) * n_basic_blocks);
/* We want a maximal solution. */
sbitmap_vector_ones (avout, last_basic_block);
/* Allocate a worklist array/queue. Entries are only added to the
list if they were not already on the list. So the size is
bounded by the number of basic blocks. */
- tos = worklist
- = (basic_block *) xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
+ tos = worklist = xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
/* Initialize NEARER for each edge and build a mapping from an edge to
its index. */
edge_list = create_edge_list ();
num_edges = NUM_EDGES (edge_list);
- st_antin = (sbitmap *) sbitmap_vector_alloc (last_basic_block, n_exprs);
- st_antout = (sbitmap *) sbitmap_vector_alloc (last_basic_block, n_exprs);
+ st_antin = sbitmap_vector_alloc (last_basic_block, n_exprs);
+ st_antout = sbitmap_vector_alloc (last_basic_block, n_exprs);
sbitmap_vector_zero (st_antin, last_basic_block);
sbitmap_vector_zero (st_antout, last_basic_block);
compute_antinout_edge (st_antloc, transp, st_antin, st_antout);
entry_exit_extra = 2;
#endif
bb_info[n_entities]
- = (struct bb_info *) xcalloc (last_basic_block + entry_exit_extra,
- sizeof **bb_info);
+ = xcalloc (last_basic_block + entry_exit_extra, sizeof **bb_info);
entity_map[n_entities++] = e;
if (num_modes[e] > max_num_modes)
max_num_modes = num_modes[e];
if (set->used == set->allocated)
{
set->allocated = 2 * set->allocated + 256;
- set->maps = (struct line_map *)
- xrealloc (set->maps, set->allocated * sizeof (struct line_map));
+ set->maps = xrealloc (set->maps, set->allocated * sizeof (struct line_map));
}
map = &set->maps[set->used++];
See the declarations of these variables, above,
for what they mean. */
- qty = (struct qty *) xmalloc (max_qty * sizeof (struct qty));
- qty_phys_copy_sugg
- = (HARD_REG_SET *) xmalloc (max_qty * sizeof (HARD_REG_SET));
- qty_phys_num_copy_sugg = (short *) xmalloc (max_qty * sizeof (short));
- qty_phys_sugg = (HARD_REG_SET *) xmalloc (max_qty * sizeof (HARD_REG_SET));
- qty_phys_num_sugg = (short *) xmalloc (max_qty * sizeof (short));
+ qty = xmalloc (max_qty * sizeof (struct qty));
+ qty_phys_copy_sugg = xmalloc (max_qty * sizeof (HARD_REG_SET));
+ qty_phys_num_copy_sugg = xmalloc (max_qty * sizeof (short));
+ qty_phys_sugg = xmalloc (max_qty * sizeof (HARD_REG_SET));
+ qty_phys_num_sugg = xmalloc (max_qty * sizeof (short));
- reg_qty = (int *) xmalloc (max_regno * sizeof (int));
- reg_offset = (char *) xmalloc (max_regno * sizeof (char));
- reg_next_in_qty = (int *) xmalloc (max_regno * sizeof (int));
+ reg_qty = xmalloc (max_regno * sizeof (int));
+ reg_offset = xmalloc (max_regno * sizeof (char));
+ reg_next_in_qty = xmalloc (max_regno * sizeof (int));
/* Determine which pseudo-registers can be allocated by local-alloc.
In general, these are the registers used only in a single block and
else
{
#define CLEAR(vector) \
- memset ((char *) (vector), 0, (sizeof (*(vector))) * next_qty);
+ memset ((vector), 0, (sizeof (*(vector))) * next_qty);
CLEAR (qty_phys_copy_sugg);
CLEAR (qty_phys_num_copy_sugg);
regset_head cleared_regs;
int clear_regnos = 0;
- reg_equiv = (struct equivalence *) xcalloc (max_regno, sizeof *reg_equiv);
+ reg_equiv = xcalloc (max_regno, sizeof *reg_equiv);
INIT_REG_SET (&cleared_regs);
init_alias_analysis ();
/* +2 to leave room for a post_mark_life at the last insn and for
the birth of a CLOBBER in the first insn. */
- regs_live_at = (HARD_REG_SET *) xcalloc ((2 * insn_count + 2),
- sizeof (HARD_REG_SET));
+ regs_live_at = xcalloc ((2 * insn_count + 2), sizeof (HARD_REG_SET));
/* Initialize table of hardware registers currently live. */
number of suggested registers they need so we allocate those with
the most restrictive needs first. */
- qty_order = (int *) xmalloc (next_qty * sizeof (int));
+ qty_order = xmalloc (next_qty * sizeof (int));
for (i = 0; i < next_qty; i++)
qty_order[i] = i;
Leave some space for labels allocated by find_and_verify_loops. */
max_uid_for_loop = get_max_uid () + 1 + max_loop_num * 32;
- uid_luid = (int *) xcalloc (max_uid_for_loop, sizeof (int));
- uid_loop = (struct loop **) xcalloc (max_uid_for_loop,
- sizeof (struct loop *));
+ uid_luid = xcalloc (max_uid_for_loop, sizeof (int));
+ uid_loop = xcalloc (max_uid_for_loop, sizeof (struct loop *));
/* Allocate storage for array of loops. */
- loops->array = (struct loop *)
- xcalloc (loops->num, sizeof (struct loop));
+ loops->array = xcalloc (loops->num, sizeof (struct loop));
/* Find and process each loop.
First, find them, and record them in order of their beginnings. */
continue;
}
- m = (struct movable *) xmalloc (sizeof (struct movable));
+ m = xmalloc (sizeof (struct movable));
m->next = 0;
m->insn = p;
m->set_src = src;
if (regs->array[regno].set_in_loop == 2)
{
struct movable *m;
- m = (struct movable *) xmalloc (sizeof (struct movable));
+ m = xmalloc (sizeof (struct movable));
m->next = 0;
m->insn = p;
m->set_dest = SET_DEST (set);
combine_movables (struct loop_movables *movables, struct loop_regs *regs)
{
struct movable *m;
- char *matched_regs = (char *) xmalloc (regs->num);
+ char *matched_regs = xmalloc (regs->num);
enum machine_mode mode;
/* Regs that are set more than once are not allowed to match
/* Map of pseudo-register replacements to handle combining
when we move several insns that load the same value
into different pseudo-registers. */
- rtx *reg_map = (rtx *) xcalloc (nregs, sizeof (rtx));
- char *already_moved = (char *) xcalloc (nregs, sizeof (char));
+ rtx *reg_map = xcalloc (nregs, sizeof (rtx));
+ char *already_moved = xcalloc (nregs, sizeof (char));
for (m = movables->head; m; m = m->next)
{
}
else if (m->insert_temp)
{
- rtx *reg_map2 = (rtx *) xcalloc (REGNO (newreg),
- sizeof(rtx));
+ rtx *reg_map2 = xcalloc (REGNO (newreg),
+ sizeof(rtx));
reg_map2 [m->regno] = newreg;
i1 = loop_insn_hoist (loop, copy_rtx (PATTERN (p)));
addr_placeholder = gen_reg_rtx (Pmode);
ivs->n_regs = max_reg_before_loop;
- ivs->regs = (struct iv *) xcalloc (ivs->n_regs, sizeof (struct iv));
+ ivs->regs = xcalloc (ivs->n_regs, sizeof (struct iv));
/* Find all BIVs in loop. */
loop_bivs_find (loop);
Some givs might have been made from biv increments, so look at
ivs->reg_iv_type for a suitable size. */
reg_map_size = ivs->n_regs;
- reg_map = (rtx *) xcalloc (reg_map_size, sizeof (rtx));
+ reg_map = xcalloc (reg_map_size, sizeof (rtx));
/* Examine each iv class for feasibility of strength reduction/induction
variable elimination. */
/* It is a possible basic induction variable.
Create and initialize an induction structure for it. */
- struct induction *v
- = (struct induction *) xmalloc (sizeof (struct induction));
+ struct induction *v = xmalloc (sizeof (struct induction));
record_biv (loop, v, p, dest_reg, inc_val, mult_val, location,
not_every_iteration, maybe_multiple);
&add_val, &mult_val, &ext_val,
&last_consec_insn))))
{
- struct induction *v
- = (struct induction *) xmalloc (sizeof (struct induction));
+ struct induction *v = xmalloc (sizeof (struct induction));
/* If this is a library call, increase benefit. */
if (find_reg_note (p, REG_RETVAL, NULL_RTX))
GET_MODE (x)))
{
/* Found one; record it. */
- struct induction *v
- = (struct induction *) xmalloc (sizeof (struct induction));
+ struct induction *v = xmalloc (sizeof (struct induction));
record_giv (loop, v, insn, src_reg, addr_placeholder, mult_val,
add_val, ext_val, benefit, DEST_ADDR,
{
/* Create and initialize new iv_class. */
- bl = (struct iv_class *) xmalloc (sizeof (struct iv_class));
+ bl = xmalloc (sizeof (struct iv_class));
bl->regno = REGNO (dest_reg);
bl->biv = 0;
if (REG_IV_TYPE (ivs, REGNO (dest_reg)) != UNKNOWN_INDUCT)
return 0;
- v = (struct induction *) alloca (sizeof (struct induction));
+ v = alloca (sizeof (struct induction));
v->src_reg = src_reg;
v->mult_val = *mult_val;
v->add_val = *add_val;
if (!g1->ignore)
giv_count++;
- giv_array
- = (struct induction **) alloca (giv_count * sizeof (struct induction *));
+ giv_array = alloca (giv_count * sizeof (struct induction *));
i = 0;
for (g1 = bl->giv; g1; g1 = g1->next_iv)
if (!g1->ignore)
giv_array[i++] = g1;
- stats = (struct combine_givs_stats *) xcalloc (giv_count, sizeof (*stats));
- can_combine = (rtx *) xcalloc (giv_count, giv_count * sizeof (rtx));
+ stats = xcalloc (giv_count, sizeof (*stats));
+ can_combine = xcalloc (giv_count, giv_count * sizeof (rtx));
for (i = 0; i < giv_count; i++)
{
else
loop_info->mems_allocated = 32;
- loop_info->mems = (loop_mem_info *)
- xrealloc (loop_info->mems,
- loop_info->mems_allocated * sizeof (loop_mem_info));
+ loop_info->mems = xrealloc (loop_info->mems,
+ loop_info->mems_allocated * sizeof (loop_mem_info));
}
/* Actually insert the MEM. */
{
regs->size = regs->num + extra_size;
- regs->array = (struct loop_reg *)
- xrealloc (regs->array, regs->size * sizeof (*regs->array));
+ regs->array = xrealloc (regs->array, regs->size * sizeof (*regs->array));
/* Zero the new elements. */
memset (regs->array + old_nregs, 0,
regs->array[i].single_usage = NULL_RTX;
}
- last_set = (rtx *) xcalloc (regs->num, sizeof (rtx));
+ last_set = xcalloc (regs->num, sizeof (rtx));
/* Scan the loop, recording register usage. */
for (insn = loop->top ? loop->top : loop->start; insn != loop->end;
if (want_scope)
{
if (free_scope == (scope_t *) 0)
- scope_ptr = (scope_t *) xmalloc (sizeof (scope_t));
+ scope_ptr = xmalloc (sizeof (scope_t));
else
{
scope_ptr = free_scope;
if (want_scope)
{
if (free_scope == (scope_t *) 0)
- scope_ptr = (scope_t *) xmalloc (sizeof (scope_t));
+ scope_ptr = xmalloc (sizeof (scope_t));
else
{
scope_ptr = free_scope;
short magic;
off_t sym_hdr_offset = 0;
- (void) read_seek (&magic, sizeof (magic), (off_t) 0, "Magic number");
+ read_seek (&magic, sizeof (magic), 0, "Magic number");
if (!tfile)
{
/* Print out the global header, since this is not a T-file. */
- (void) read_seek (&global_hdr, sizeof (global_hdr), (off_t) 0,
- "Global file header");
+ read_seek (&global_hdr, sizeof (global_hdr), 0, "Global file header");
print_global_hdr (&global_hdr);
sym_hdr_offset = global_hdr.f_symptr;
}
- (void) read_seek (&sym_hdr,
- sizeof (sym_hdr),
- sym_hdr_offset,
- "Symbolic header");
+ read_seek (&sym_hdr, sizeof (sym_hdr), sym_hdr_offset, "Symbolic header");
print_sym_hdr (&sym_hdr);
- lines = (LINER *) read_seek (NULL,
- sym_hdr.cbLine,
- sym_hdr.cbLineOffset,
- "Line numbers");
+ lines = read_seek (NULL, sym_hdr.cbLine, sym_hdr.cbLineOffset,
+ "Line numbers");
- dense_nums = (DNR *) read_seek (NULL,
- sym_hdr.idnMax * sizeof (DNR),
- sym_hdr.cbDnOffset,
- "Dense numbers");
+ dense_nums = read_seek (NULL, sym_hdr.idnMax * sizeof (DNR),
+ sym_hdr.cbDnOffset, "Dense numbers");
- proc_desc = (PDR *) read_seek (NULL,
- sym_hdr.ipdMax * sizeof (PDR),
- sym_hdr.cbPdOffset,
- "Procedure tables");
+ proc_desc = read_seek (NULL, sym_hdr.ipdMax * sizeof (PDR),
+ sym_hdr.cbPdOffset, "Procedure tables");
- l_symbols = (SYMR *) read_seek (NULL,
- sym_hdr.isymMax * sizeof (SYMR),
- sym_hdr.cbSymOffset,
- "Local symbols");
+ l_symbols = read_seek (NULL, sym_hdr.isymMax * sizeof (SYMR),
+ sym_hdr.cbSymOffset, "Local symbols");
- opt_symbols = (OPTR *) read_seek (NULL,
- sym_hdr.ioptMax * sizeof (OPTR),
- sym_hdr.cbOptOffset,
- "Optimization symbols");
+ opt_symbols = read_seek (NULL, sym_hdr.ioptMax * sizeof (OPTR),
+ sym_hdr.cbOptOffset, "Optimization symbols");
- aux_symbols = (AUXU *) read_seek (NULL,
- sym_hdr.iauxMax * sizeof (AUXU),
- sym_hdr.cbAuxOffset,
- "Auxiliary symbols");
+ aux_symbols = read_seek (NULL, sym_hdr.iauxMax * sizeof (AUXU),
+ sym_hdr.cbAuxOffset, "Auxiliary symbols");
if (sym_hdr.iauxMax > 0)
aux_used = xcalloc (sym_hdr.iauxMax, 1);
- l_strings = (char *) read_seek (NULL,
- sym_hdr.issMax,
- sym_hdr.cbSsOffset,
- "Local string table");
-
- e_strings = (char *) read_seek (NULL,
- sym_hdr.issExtMax,
- sym_hdr.cbSsExtOffset,
- "External string table");
-
- file_desc = (FDR *) read_seek (NULL,
- sym_hdr.ifdMax * sizeof (FDR),
- sym_hdr.cbFdOffset,
- "File tables");
-
- rfile_desc = (ulong *) read_seek (NULL,
- sym_hdr.crfd * sizeof (ulong),
- sym_hdr.cbRfdOffset,
- "Relative file tables");
-
- e_symbols = (EXTR *) read_seek (NULL,
- sym_hdr.iextMax * sizeof (EXTR),
- sym_hdr.cbExtOffset,
- "External symbols");
+ l_strings = read_seek (NULL, sym_hdr.issMax,
+ sym_hdr.cbSsOffset, "Local string table");
+
+ e_strings = read_seek (NULL, sym_hdr.issExtMax,
+ sym_hdr.cbSsExtOffset, "External string table");
+
+ file_desc = read_seek (NULL, sym_hdr.ifdMax * sizeof (FDR),
+ sym_hdr.cbFdOffset, "File tables");
+
+ rfile_desc = read_seek (NULL, sym_hdr.crfd * sizeof (ulong),
+ sym_hdr.cbRfdOffset, "Relative file tables");
+
+ e_symbols = read_seek (NULL, sym_hdr.iextMax * sizeof (EXTR),
+ sym_hdr.cbExtOffset, "External symbols");
}
\f
#ifdef MALLOC_CHECK
if (vp->object_size > 1)
- new_links->datum = (page_t *) xcalloc (1, vp->object_size);
+ new_links->datum = xcalloc (1, vp->object_size);
else
#endif
new_links->datum = allocate_page ();
STATIC void
initialize_init_file (void)
{
- memset ((void*) &init_file, 0, sizeof (init_file));
+ memset (&init_file, 0, sizeof (init_file));
init_file.fdr.lang = langC;
init_file.fdr.fMerge = 1;
#ifndef MALLOC_CHECK
ptr = allocate_multiple_pages ((size + PAGE_USIZE - 1) / PAGE_USIZE);
#else
- ptr = (page_t *) xcalloc (1, size);
+ ptr = xcalloc (1, size);
#endif
/* If we need to seek, and the distance is nearby, just do some reads,
file_offset = orig_file_header.f_symptr + sizeof (struct filehdr);
if (orig_sym_hdr.cbLine > 0) /* line numbers */
- orig_linenum = (char *) read_seek ((Size_t) orig_sym_hdr.cbLine,
+ orig_linenum = (char *) read_seek (orig_sym_hdr.cbLine,
orig_sym_hdr.cbLineOffset,
"Line numbers");
if (orig_sym_hdr.ipdMax > 0) /* procedure tables */
- orig_procs = (PDR *) read_seek ((Size_t) orig_sym_hdr.ipdMax * sizeof (PDR),
+ orig_procs = (PDR *) read_seek (orig_sym_hdr.ipdMax * sizeof (PDR),
orig_sym_hdr.cbPdOffset,
"Procedure tables");
if (orig_sym_hdr.isymMax > 0) /* local symbols */
- orig_local_syms = (SYMR *) read_seek ((Size_t) orig_sym_hdr.isymMax * sizeof (SYMR),
+ orig_local_syms = (SYMR *) read_seek (orig_sym_hdr.isymMax * sizeof (SYMR),
orig_sym_hdr.cbSymOffset,
"Local symbols");
if (orig_sym_hdr.iauxMax > 0) /* aux symbols */
- orig_aux_syms = (AUXU *) read_seek ((Size_t) orig_sym_hdr.iauxMax * sizeof (AUXU),
+ orig_aux_syms = (AUXU *) read_seek (orig_sym_hdr.iauxMax * sizeof (AUXU),
orig_sym_hdr.cbAuxOffset,
"Aux. symbols");
if (orig_sym_hdr.issMax > 0) /* local strings */
- orig_local_strs = (char *) read_seek ((Size_t) orig_sym_hdr.issMax,
+ orig_local_strs = (char *) read_seek (orig_sym_hdr.issMax,
orig_sym_hdr.cbSsOffset,
"Local strings");
if (orig_sym_hdr.issExtMax > 0) /* external strings */
- orig_ext_strs = (char *) read_seek ((Size_t) orig_sym_hdr.issExtMax,
+ orig_ext_strs = (char *) read_seek (orig_sym_hdr.issExtMax,
orig_sym_hdr.cbSsExtOffset,
"External strings");
if (orig_sym_hdr.ifdMax > 0) /* file tables */
- orig_files = (FDR *) read_seek ((Size_t) orig_sym_hdr.ifdMax * sizeof (FDR),
+ orig_files = (FDR *) read_seek (orig_sym_hdr.ifdMax * sizeof (FDR),
orig_sym_hdr.cbFdOffset,
"File tables");
if (orig_sym_hdr.crfd > 0) /* relative file descriptors */
- orig_rfds = (symint_t *) read_seek ((Size_t) orig_sym_hdr.crfd * sizeof (symint_t),
+ orig_rfds = (symint_t *) read_seek (orig_sym_hdr.crfd * sizeof (symint_t),
orig_sym_hdr.cbRfdOffset,
"Relative file descriptors");
if (orig_sym_hdr.issExtMax > 0) /* external symbols */
- orig_ext_syms = (EXTR *) read_seek ((Size_t) orig_sym_hdr.iextMax * sizeof (EXTR),
+ orig_ext_syms = (EXTR *) read_seek (orig_sym_hdr.iextMax * sizeof (EXTR),
orig_sym_hdr.cbExtOffset,
"External symbols");
if (orig_sym_hdr.idnMax > 0) /* dense numbers */
{
- orig_dense = (DNR *) read_seek ((Size_t) orig_sym_hdr.idnMax * sizeof (DNR),
+ orig_dense = (DNR *) read_seek (orig_sym_hdr.idnMax * sizeof (DNR),
orig_sym_hdr.cbDnOffset,
"Dense numbers");
- add_bytes (&dense_num, (char *) orig_dense, (Size_t) orig_sym_hdr.idnMax);
+ add_bytes (&dense_num, (char *) orig_dense, orig_sym_hdr.idnMax);
}
if (orig_sym_hdr.ioptMax > 0) /* opt symbols */
- orig_opt_syms = (OPTR *) read_seek ((Size_t) orig_sym_hdr.ioptMax * sizeof (OPTR),
+ orig_opt_syms = (OPTR *) read_seek (orig_sym_hdr.ioptMax * sizeof (OPTR),
orig_sym_hdr.cbOptOffset,
"Optimizer symbols");
(in case there are duplicate filenames, we collapse them into one
file section, the MIPS assembler may or may not collapse them). */
- remap_file_number = (int *) alloca (sizeof (int) * orig_sym_hdr.ifdMax);
+ remap_file_number = alloca (sizeof (int) * orig_sym_hdr.ifdMax);
for (fd = delete_ifd; fd < orig_sym_hdr.ifdMax; fd++)
{
STATIC page_t *
allocate_cluster (Size_t npages)
{
- page_t *value = (page_t *) xcalloc (npages, PAGE_USIZE);
+ page_t *value = xcalloc (npages, PAGE_USIZE);
if (debug > 3)
fprintf (stderr, "\talloc\tnpages = %d, value = 0x%.8x\n", npages, value);
return allocate_cluster (npages);
#else /* MALLOC_CHECK */
- return (page_t *) xcalloc (npages, PAGE_SIZE);
+ return xcalloc (npages, PAGE_SIZE);
#endif /* MALLOC_CHECK */
}
return cluster_ptr++;
#else /* MALLOC_CHECK */
- return (page_t *) xcalloc (1, PAGE_SIZE);
+ return xcalloc (1, PAGE_SIZE);
#endif /* MALLOC_CHECK */
}
}
#else
- ptr = (scope_t *) xmalloc (sizeof (scope_t));
+ ptr = xmalloc (sizeof (scope_t));
#endif
alloc_counts[ (int) alloc_type_vlinks ].unallocated = unallocated;
#else
- ptr = (vlinks_t *) xmalloc (sizeof (vlinks_t));
+ ptr = xmalloc (sizeof (vlinks_t));
#endif
alloc_counts[ (int) alloc_type_shash ].unallocated = unallocated;
#else
- ptr = (shash_t *) xmalloc (sizeof (shash_t));
+ ptr = xmalloc (sizeof (shash_t));
#endif
alloc_counts[ (int) alloc_type_thash ].unallocated = unallocated;
#else
- ptr = (thash_t *) xmalloc (sizeof (thash_t));
+ ptr = xmalloc (sizeof (thash_t));
#endif
}
#else
- ptr = (tag_t *) xmalloc (sizeof (tag_t));
+ ptr = xmalloc (sizeof (tag_t));
#endif
}
#else
- ptr = (forward_t *) xmalloc (sizeof (forward_t));
+ ptr = xmalloc (sizeof (forward_t));
#endif
}
#else
- ptr = (thead_t *) xmalloc (sizeof (thead_t));
+ ptr = xmalloc (sizeof (thead_t));
#endif
struct deps *
deps_init (void)
{
- struct deps *d = (struct deps *) xmalloc (sizeof (struct deps));
+ struct deps *d = xmalloc (sizeof (struct deps));
/* Allocate space for the vectors only if we need it. */
if (d->ntargets == d->targets_size)
{
d->targets_size = d->targets_size * 2 + 4;
- d->targetv = (const char **) xrealloc (d->targetv,
+ d->targetv = xrealloc (d->targetv,
d->targets_size * sizeof (const char *));
}
# define TARGET_OBJECT_SUFFIX ".o"
#endif
const char *start = lbasename (tgt);
- char *o = (char *) alloca (strlen (start) + strlen (TARGET_OBJECT_SUFFIX) + 1);
+ char *o = alloca (strlen (start) + strlen (TARGET_OBJECT_SUFFIX) + 1);
char *suffix;
strcpy (o, start);
if (d->ndeps == d->deps_size)
{
d->deps_size = d->deps_size * 2 + 8;
- d->depv = (const char **)
- xrealloc (d->depv, d->deps_size * sizeof (const char *));
+ d->depv = xrealloc (d->depv, d->deps_size * sizeof (const char *));
}
d->depv[d->ndeps++] = t;
}
unsigned int i, count;
size_t num_to_read;
size_t buf_size = 512;
- char *buf = (char *) xmalloc (buf_size);
+ char *buf = xmalloc (buf_size);
/* Number of dependences. */
if (fread (&count, 1, sizeof (count), fd) != sizeof (count))
new_optab (void)
{
int i;
- optab op = (optab) ggc_alloc (sizeof (struct optab));
+ optab op = ggc_alloc (sizeof (struct optab));
for (i = 0; i < NUM_MACHINE_MODES; i++)
{
op->handlers[i].insn_code = CODE_FOR_nothing;
add_params (const param_info params[], size_t n)
{
/* Allocate enough space for the new parameters. */
- compiler_params =
- ((param_info *)
- xrealloc (compiler_params,
- (num_compiler_params + n) * sizeof (param_info)));
+ compiler_params = xrealloc (compiler_params,
+ (num_compiler_params + n) * sizeof (param_info));
/* Copy them into the table. */
memcpy (compiler_params + num_compiler_params,
params,
if (! constrain_operands (1))
fatal_insn_not_found (insn);
- alternative_reject = (int *) alloca (recog_data.n_alternatives * sizeof (int));
- alternative_nregs = (int *) alloca (recog_data.n_alternatives * sizeof (int));
- alternative_order = (int *) alloca (recog_data.n_alternatives * sizeof (int));
- memset ((char *) alternative_reject, 0, recog_data.n_alternatives * sizeof (int));
- memset ((char *) alternative_nregs, 0, recog_data.n_alternatives * sizeof (int));
+ alternative_reject = alloca (recog_data.n_alternatives * sizeof (int));
+ alternative_nregs = alloca (recog_data.n_alternatives * sizeof (int));
+ alternative_order = alloca (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));
/* For each operand, find out which regs are equivalent. */
for (i = 0; i < recog_data.n_operands; i++)
int regno;
const char *p;
- op_alt_regno[i] = (int *) alloca (recog_data.n_alternatives * sizeof (int));
+ op_alt_regno[i] = alloca (recog_data.n_alternatives * sizeof (int));
for (j = 0; j < recog_data.n_alternatives; j++)
op_alt_regno[i][j] = -1;
destination. */
min_labelno = get_first_label_num ();
n_labels = max_label_num () - min_labelno;
- label_live = (HARD_REG_SET *) xmalloc (n_labels * sizeof (HARD_REG_SET));
+ label_live = xmalloc (n_labels * sizeof (HARD_REG_SET));
CLEAR_HARD_REG_SET (ever_live_at_start);
FOR_EACH_BB_REVERSE (bb)
}
size = 32;
- dst = (char *) xmalloc (size);
+ dst = xmalloc (size);
res = RegQueryValueExA (reg_key, key, 0, &type, dst, &size);
if (res == ERROR_MORE_DATA && type == REG_SZ)
{
- dst = (char *) xrealloc (dst, size);
+ dst = xrealloc (dst, size);
res = RegQueryValueExA (reg_key, key, 0, &type, dst, &size);
}
keylen++)
;
- key = (char *) alloca (keylen + 1);
+ key = alloca (keylen + 1);
strncpy (key, &name[1], keylen);
key[keylen] = 0;
void
debug_tree (tree node)
{
- table = (struct bucket **) xcalloc (HASH_SIZE, sizeof (struct bucket *));
+ table = xcalloc (HASH_SIZE, sizeof (struct bucket *));
print_node (stderr, "", node, 0);
free (table);
table = 0;
}
/* Add this node to the table. */
- b = (struct bucket *) xmalloc (sizeof (struct bucket));
+ b = xmalloc (sizeof (struct bucket));
b->node = node;
b->next = table[hash];
table[hash] = b;
static char *
savestring (const char *input, unsigned int size)
{
- char *output = (char *) xmalloc (size + 1);
+ char *output = xmalloc (size + 1);
strcpy (output, input);
return output;
}
static char *
dupnstr (const char *s, size_t n)
{
- char *ret_val = (char *) xmalloc (n + 1);
+ char *ret_val = xmalloc (n + 1);
strncpy (ret_val, s, n);
ret_val[n] = '\0';
static int
file_could_be_converted (const char *path)
{
- char *const dir_name = (char *) alloca (strlen (path) + 1);
+ char *const dir_name = alloca (strlen (path) + 1);
if (access (path, R_OK))
return 0;
static struct string_list *
string_list_cons (const char *string, struct string_list *rest)
{
- struct string_list *temp
- = (struct string_list *) xmalloc (sizeof (struct string_list));
+ struct string_list *temp = xmalloc (sizeof (struct string_list));
temp->next = rest;
temp->name = string;
if (!strcmp (p->symbol, search_symbol))
return p;
}
- p->hash_next = (hash_table_entry *) xmalloc (sizeof (hash_table_entry));
+ p->hash_next = xmalloc (sizeof (hash_table_entry));
p = p->hash_next;
return add_symbol (p, search_symbol);
}
if (line_buf == 0)
{
line_buf_size = 1024;
- line_buf = (char *) xmalloc (line_buf_size);
+ line_buf = xmalloc (line_buf_size);
}
copy_p = line_buf;
int offset = copy_p - line_buf;
line_buf_size *= 2;
line_buf_size += size;
- line_buf = (char *) xrealloc (line_buf, line_buf_size);
+ line_buf = xrealloc (line_buf, line_buf_size);
copy_p = line_buf + offset;
}
strcpy (copy_p, unexp_p->contracted);
{
int offset = copy_p - line_buf;
line_buf_size *= 2;
- line_buf = (char *) xrealloc (line_buf, line_buf_size);
+ line_buf = xrealloc (line_buf, line_buf_size);
copy_p = line_buf + offset;
}
*copy_p++ = *s++;
{
int offset = copy_p - line_buf;
line_buf_size *= 2;
- line_buf = (char *) xrealloc (line_buf, line_buf_size);
+ line_buf = xrealloc (line_buf, line_buf_size);
copy_p = line_buf + offset;
}
*copy_p++ = '\n';
{
/* Setup the current working directory as needed. */
const char *const cwd2 = (cwd) ? cwd : cwd_buffer;
- char *const abs_buffer
- = (char *) alloca (strlen (cwd2) + strlen (rel_filename) + 2);
+ char *const abs_buffer = alloca (strlen (cwd2) + strlen (rel_filename) + 2);
char *endp = abs_buffer;
char *outp, *inp;
size_t filename_len = strlen (filename);
path_p = abspath (cwd, filename);
- rel_buf_p = rel_buffer = (char *) xmalloc (filename_len);
+ rel_buf_p = rel_buffer = xmalloc (filename_len);
while (*cwd_p && IS_SAME_PATH_CHAR (*cwd_p, *path_p))
{
else
{
struct stat stat_buf;
- file_info *file_p = (file_info *) xmalloc (sizeof (file_info));
+ file_info *file_p = xmalloc (sizeof (file_info));
/* If we cannot get status on any given source file, give a warning
and then just set its time of last modification to infinity. */
#endif
)
p++;
- filename = (char *) alloca ((size_t) (p - filename_start) + 1);
+ filename = alloca ((size_t) (p - filename_start) + 1);
strncpy (filename, filename_start, (size_t) (p - filename_start));
filename[p-filename_start] = '\0';
}
{
const char *p;
const char *semicolon_p;
- def_dec_info *def_dec_p = (def_dec_info *) xmalloc (sizeof (def_dec_info));
+ def_dec_info *def_dec_p = xmalloc (sizeof (def_dec_info));
#ifndef UNPROTOIZE
def_dec_p->written = 0;
#endif
)
p++;
- filename = (char *) alloca ((size_t) (p - filename_start) + 1);
+ filename = alloca ((size_t) (p - filename_start) + 1);
strncpy (filename, filename_start, (size_t) (p - filename_start));
filename[p-filename_start] = '\0';
const char *left_paren_p = find_corresponding_lparen (p);
#ifndef UNPROTOIZE
{
- f_list_chain_item *cip
- = (f_list_chain_item *) xmalloc (sizeof (f_list_chain_item));
+ f_list_chain_item *cip = xmalloc (sizeof (f_list_chain_item));
cip->formals_list
= dupnstr (left_paren_p + 1, (size_t) (p - (left_paren_p+1)));
/* p now points to the leftmost character of the function name. */
{
- char *fn_string = (char *) alloca (past_fn - p + 1);
+ char *fn_string = alloca (past_fn - p + 1);
strncpy (fn_string, p, (size_t) (past_fn - p));
fn_string[past_fn-p] = '\0';
/* Build up the contents in a temporary vector
that is so big that to has to be big enough. */
const char **temp_params
- = (const char **) alloca ((strlen (params_list) + 8) * sizeof (char *));
+ = alloca ((strlen (params_list) + 8) * sizeof (char *));
int param_count = 0;
const char *param;
struct stat st;
/* Make a copy of the compile_params in heap space. */
- compile_params
- = (const char **) xmalloc (sizeof (char *) * (param_count+1));
+ compile_params = xmalloc (sizeof (char *) * (param_count+1));
memcpy (compile_params, temp_params, sizeof (char *) * param_count);
}
int is_syscalls)
{
size_t base_len = strlen (base_source_filename);
- char * aux_info_filename
- = (char *) alloca (base_len + strlen (aux_info_suffix) + 1);
+ char * aux_info_filename = alloca (base_len + strlen (aux_info_suffix) + 1);
char *aux_info_base;
char *aux_info_limit;
char *aux_info_relocated_name;
{
const char *filename = hp->symbol;
int last_char_index = strlen (filename) - 1;
- char *const new_filename = (char *) alloca (strlen (filename)
- + strlen (cplus_suffix) + 1);
+ char *const new_filename = alloca (strlen (filename)
+ + strlen (cplus_suffix) + 1);
/* Note that we don't care here if the given file was converted or not. It
is possible that the given file was *not* converted, simply because there
{
/* Why copy this string into `needed' at all?
Why not just use user->ansi_decl without copying? */
- char *needed = (char *) alloca (strlen (user->ansi_decl) + 1);
+ char *needed = alloca (strlen (user->ansi_decl) + 1);
char *p;
strcpy (needed, user->ansi_decl);
if ((repl_write_ptr + 1) + len >= repl_text_limit)
{
size_t new_size = (repl_text_limit - repl_text_base) << 1;
- char *new_buf = (char *) xrealloc (repl_text_base, new_size);
+ char *new_buf = xrealloc (repl_text_base, new_size);
repl_write_ptr = new_buf + (repl_write_ptr - repl_text_base);
repl_text_base = new_buf;
goto not_missed;
{
- char *func_name = (char *) alloca (id_length + 1);
+ char *func_name = alloca (id_length + 1);
static const char * const stmt_keywords[]
= { "if", "else", "do", "while", "for", "switch", "case", "return", 0 };
const char * const *stmt_keyword;
/* Allocate a buffer to hold the original text. */
- orig_text_base = new_orig_text_base = (char *) xmalloc (orig_size + 2);
+ orig_text_base = new_orig_text_base = xmalloc (orig_size + 2);
orig_text_limit = new_orig_text_limit = new_orig_text_base + orig_size;
/* Allocate a buffer to hold the cleaned-up version of the original text. */
- clean_text_base = new_clean_text_base = (char *) xmalloc (orig_size + 2);
+ clean_text_base = new_clean_text_base = xmalloc (orig_size + 2);
clean_text_limit = new_clean_text_limit = new_clean_text_base + orig_size;
clean_read_ptr = clean_text_base - 1;
buffer can be expanded later as needed. */
repl_size = orig_size + (orig_size >> 2) + 4096;
- repl_text_base = (char *) xmalloc (repl_size + 2);
+ repl_text_base = xmalloc (repl_size + 2);
repl_text_limit = repl_text_base + repl_size - 1;
repl_write_ptr = repl_text_base - 1;
{
int clean_file;
size_t clean_size = orig_text_limit - orig_text_base;
- char *const clean_filename = (char *) alloca (strlen (convert_filename) + 6 + 1);
+ char *const clean_filename = alloca (strlen (convert_filename) + 6 + 1);
/* Open (and create) the clean file. */
if (!nosave_flag)
{
char *new_filename
- = (char *) xmalloc (strlen (convert_filename) + strlen (save_suffix) + 2);
+ = xmalloc (strlen (convert_filename) + strlen (save_suffix) + 2);
strcpy (new_filename, convert_filename);
#ifdef __MSDOS__
if (nondefault_syscalls_dir)
{
syscalls_absolute_filename
- = (char *) xmalloc (strlen (nondefault_syscalls_dir) + 1
- + sizeof (syscalls_filename));
+ = xmalloc (strlen (nondefault_syscalls_dir) + 1
+ + sizeof (syscalls_filename));
strcpy (syscalls_absolute_filename, nondefault_syscalls_dir);
}
else
default_syscalls_dir = standard_exec_prefix;
}
syscalls_absolute_filename
- = (char *) xmalloc (strlen (default_syscalls_dir) + 0
- + strlen (target_machine) + 1
- + strlen (target_version) + 1
- + sizeof (syscalls_filename));
+ = xmalloc (strlen (default_syscalls_dir) + 0
+ + strlen (target_machine) + 1
+ + strlen (target_version) + 1
+ + sizeof (syscalls_filename));
strcpy (syscalls_absolute_filename, default_syscalls_dir);
strcat (syscalls_absolute_filename, target_machine);
strcat (syscalls_absolute_filename, "/");
/* Now actually make a list of the base source filenames. */
base_source_filenames
- = (const char **) xmalloc ((n_base_source_files + 1) * sizeof (char *));
+ = xmalloc ((n_base_source_files + 1) * sizeof (char *));
n_base_source_files = 0;
for (; optind < argc; optind++)
{
bitmap b = find_sub_conflicts (wp, size_word);
if (!b)
{
- struct tagged_conflict *cl =
- (struct tagged_conflict *) ra_alloc (sizeof *cl);
+ struct tagged_conflict *cl = ra_alloc (sizeof *cl);
cl->conflicts = BITMAP_XMALLOC ();
cl->size_word = size_word;
cl->next = wp->sub_conflicts;
subwebs could be source and target of coalescing). */
if (GET_CODE (s) == REG && GET_CODE (d) == REG)
{
- struct move *m = (struct move *) ra_calloc (sizeof (struct move));
+ struct move *m = ra_calloc (sizeof (struct move));
struct move_list *ml;
m->insn = insn;
- ml = (struct move_list *) ra_alloc (sizeof (struct move_list));
+ ml = ra_alloc (sizeof (struct move_list));
ml->move = m;
ml->next = wl_moves;
wl_moves = ml;
basic_block bb;
FOR_ALL_BB (bb)
{
- struct ra_bb_info *info =
- (struct ra_bb_info *) xcalloc (1, sizeof *info);
+ struct ra_bb_info *info = xcalloc (1, sizeof *info);
info->regnos_mentioned = BITMAP_XMALLOC ();
info->live_throughout = BITMAP_XMALLOC ();
info->old_aux = bb->aux;
struct curr_use use;
basic_block bb;
- number_seen = (int *) xcalloc (get_max_uid (), sizeof (int));
- visit_trace = (struct visit_trace *) xcalloc (get_max_uid (),
- sizeof (visit_trace[0]));
+ number_seen = xcalloc (get_max_uid (), sizeof (int));
+ visit_trace = xcalloc (get_max_uid (), sizeof (visit_trace[0]));
update_regnos_mentioned ();
/* Here's the main loop.
web->orig_x = reg;
if (!web->dlink)
{
- web->dlink = (struct dlist *) ra_calloc (sizeof (struct dlist));
+ web->dlink = ra_calloc (sizeof (struct dlist));
DLIST_WEB (web->dlink) = web;
}
/* XXX
struct web *w;
if (GET_CODE (reg) != SUBREG)
abort ();
- w = (struct web *) xmalloc (sizeof (struct web));
+ w = xmalloc (sizeof (struct web));
/* Copy most content from parent-web. */
*w = *web;
/* And initialize the private stuff. */
for (cl = web->conflict_list; cl; cl = cl->next)
{
struct conflict_link *ncl;
- ncl = (struct conflict_link *) ra_alloc (sizeof *ncl);
+ ncl = ra_alloc (sizeof *ncl);
ncl->t = cl->t;
ncl->sub = NULL;
ncl->next = web->orig_conflict_list;
struct sub_conflict *sl, *nsl;
for (sl = cl->sub; sl; sl = sl->next)
{
- nsl = (struct sub_conflict *) ra_alloc (sizeof *nsl);
+ nsl = ra_alloc (sizeof *nsl);
nsl->s = sl->s;
nsl->t = sl->t;
nsl->next = ncl->sub;
copy_conflict_list (pfrom);
if (!TEST_BIT (sup_igraph, (pfrom->id * num_webs + pto->id)))
{
- cl = (struct conflict_link *) ra_alloc (sizeof (*cl));
+ cl = ra_alloc (sizeof (*cl));
cl->t = pto;
cl->sub = NULL;
cl->next = pfrom->conflict_list;
means we are not interested in this subconflict. */
if (!may_delete || cl->sub != NULL)
{
- sl = (struct sub_conflict *) ra_alloc (sizeof (*sl));
+ sl = ra_alloc (sizeof (*sl));
sl->s = from;
sl->t = to;
sl->next = cl->sub;
struct web *web;
struct web_link **wl;
{
- struct web *cweb = (struct web *) xmalloc (sizeof *cweb);
- struct web_link *link = (struct web_link *) ra_alloc (sizeof *link);
+ struct web *cweb = xmalloc (sizeof *cweb);
+ struct web_link *link = ra_alloc (sizeof *link);
link->next = *wl;
*wl = link;
link->web = cweb;
continue;
}
if (web->num_defs)
- web->defs = (struct ref **) xmalloc (web->num_defs *
- sizeof (web->defs[0]));
+ web->defs = xmalloc (web->num_defs * sizeof (web->defs[0]));
if (web->num_uses)
- web->uses = (struct ref **) xmalloc (web->num_uses *
- sizeof (web->uses[0]));
+ web->uses = xmalloc (web->num_uses * sizeof (web->uses[0]));
def_i = use_i = 0;
for (link = web->temp_refs; link; link = link->next)
{
allocate a new one. */
if (ra_pass == 1)
{
- web = (struct web *) xmalloc (sizeof (struct web));
+ web = xmalloc (sizeof (struct web));
newid = last_num_webs++;
init_one_web (web, GET_CODE (reg) == SUBREG
? SUBREG_REG (reg) : reg);
else
{
/* Else allocate a new one. */
- web = (struct web *) xmalloc (sizeof (struct web));
+ web = xmalloc (sizeof (struct web));
newid = last_num_webs++;
}
}
num_subwebs = 0;
/* First build webs and ordinary subwebs. */
- all_refs = (struct df_link *) xcalloc (df->def_id + df->use_id,
- sizeof (all_refs[0]));
+ all_refs = xcalloc (df->def_id + df->use_id, sizeof (all_refs[0]));
webnum = parts_to_webs_1 (df, ©_webs, all_refs);
/* Setup the webs for hardregs which are still missing (weren't
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (!hardreg2web[i])
{
- struct web *web = (struct web *) xmalloc (sizeof (struct web));
+ struct web *web = xmalloc (sizeof (struct web));
init_one_web (web, gen_rtx_REG (reg_raw_mode[i], i));
web->id = last_num_webs++;
hardreg2web[web->regno] = web;
}
/* Now that everyone has an ID, we can setup the id2web array. */
- id2web = (struct web **) xcalloc (webnum, sizeof (id2web[0]));
+ id2web = xcalloc (webnum, sizeof (id2web[0]));
for (d = WEBS(INITIAL); d; d = d->next)
{
struct web *web = DLIST_WEB (d);
#endif
bitmap ignore_defs = BITMAP_XMALLOC ();
unsigned int have_ignored;
- unsigned int *pass_cache = (unsigned int *) xcalloc (num_webs, sizeof (int));
+ unsigned int *pass_cache = xcalloc (num_webs, sizeof (int));
unsigned int pass = 0;
if (ra_pass > 1)
for (; test && test->move != m; test = test->next);
if (! test)
{
- newml = (struct move_list*)
- ra_alloc (sizeof (struct move_list));
+ newml = ra_alloc (sizeof (struct move_list));
newml->move = m;
newml->next = m->source_web->moves;
m->source_web->moves = newml;
for (; test && test->move != m; test = test->next);
if (! test)
{
- newml = (struct move_list*)
- ra_alloc (sizeof (struct move_list));
+ newml = ra_alloc (sizeof (struct move_list));
newml->move = m;
newml->next = m->target_web->moves;
m->target_web->moves = newml;
unsigned int i;
struct dlist *d;
move_handled = sbitmap_alloc (get_max_uid () );
- web_parts = (struct web_part *) xcalloc (df->def_id + df->use_id,
- sizeof web_parts[0]);
- def2web = (struct web **) xcalloc (df->def_id + df->use_id,
- sizeof def2web[0]);
+ web_parts = xcalloc (df->def_id + df->use_id, sizeof web_parts[0]);
+ def2web = xcalloc (df->def_id + df->use_id, sizeof def2web[0]);
use2web = &def2web[df->def_id];
live_over_abnormal = sbitmap_alloc (df->use_id);
sbitmap_zero (live_over_abnormal);
if (!last_max_uid)
{
/* Setup copy cache, for copy_insn_p (). */
- copy_cache = (struct copy_p_cache *)
- xcalloc (get_max_uid (), sizeof (copy_cache[0]));
+ copy_cache = xcalloc (get_max_uid (), sizeof (copy_cache[0]));
init_bb_info ();
}
else
{
- copy_cache = (struct copy_p_cache *)
- xrealloc (copy_cache, get_max_uid () * sizeof (copy_cache[0]));
+ copy_cache = xrealloc (copy_cache, get_max_uid () * sizeof (copy_cache[0]));
memset (©_cache[last_max_uid], 0,
(get_max_uid () - last_max_uid) * sizeof (copy_cache[0]));
}
unsigned int i, num, max_num;
struct web **order2web;
max_num = num_webs - num_subwebs;
- order2web = (struct web **) xmalloc (max_num * sizeof (order2web[0]));
+ order2web = xmalloc (max_num * sizeof (order2web[0]));
for (i = 0, num = 0; i < max_num; i++)
if (id2web[i]->regno >= max_normal_pseudo)
order2web[num++] = id2web[i];
if (ml->move)
{
struct move *m = ml->move;
- d = (struct dlist *) ra_calloc (sizeof (struct dlist));
+ d = ra_calloc (sizeof (struct dlist));
DLIST_MOVE (d) = m;
m->dlink = d;
put_move (m, WORKLIST);
int newcol, c;
HARD_REG_SET precolored_neighbors, spill_temps;
HARD_REG_SET possible_begin, wide_seen;
- cost_neighbors = (unsigned HOST_WIDE_INT *)
- xcalloc (FIRST_PSEUDO_REGISTER, sizeof (cost_neighbors[0]));
+ cost_neighbors = xcalloc (FIRST_PSEUDO_REGISTER, sizeof (cost_neighbors[0]));
/* For each hard-regs count the number of preceding hardregs, which
would overlap this color, if used in WEB's mode. */
- min_color = (unsigned int *) xcalloc (FIRST_PSEUDO_REGISTER, sizeof (int));
+ min_color = xcalloc (FIRST_PSEUDO_REGISTER, sizeof (int));
CLEAR_HARD_REG_SET (possible_begin);
for (c = 0; c < FIRST_PSEUDO_REGISTER; c++)
{
remove_list (web->dlink, &WEBS(SPILLED));
put_web (web, COLORED);
web->color = newcol;
- old_colors = (int *) xcalloc (num_webs, sizeof (int));
+ old_colors = xcalloc (num_webs, sizeof (int));
for (wl = web->conflict_list; wl; wl = wl_next)
{
struct web *web2 = alias (wl->t);
unsigned int i, num;
struct web **order2web;
num = num_webs - num_subwebs;
- order2web = (struct web **) xmalloc (num * sizeof (order2web[0]));
+ order2web = xmalloc (num * sizeof (order2web[0]));
for (i = 0; i < num; i++)
{
order2web[i] = id2web[i];
p->conflicts += conflicts;
return;
}
- p = (struct web_pair *) ra_alloc (sizeof *p);
+ p = ra_alloc (sizeof *p);
p->next_hash = web_pair_hash[hash];
p->next_list = web_pair_list;
p->smaller = web1;
struct web_pair *p;
if (!num_web_pairs)
return;
- sorted = (struct web_pair **) xmalloc (num_web_pairs * sizeof (sorted[0]));
+ sorted = xmalloc (num_web_pairs * sizeof (sorted[0]));
for (p = web_pair_list, i = 0; p; p = p->next_list)
sorted[i++] = p;
if (i != num_web_pairs)
choose_spill_colors ()
{
struct dlist *d;
- unsigned HOST_WIDE_INT *costs = (unsigned HOST_WIDE_INT *)
- xmalloc (FIRST_PSEUDO_REGISTER * sizeof (costs[0]));
+ unsigned HOST_WIDE_INT *costs = xmalloc (FIRST_PSEUDO_REGISTER * sizeof (costs[0]));
for (d = WEBS(SPILLED); d; d = d->next)
{
struct web *web = DLIST_WEB (d);
{
struct rtx_list *l;
/* PRE: X is not already in LIST. */
- l = (struct rtx_list *) ra_alloc (sizeof (*l));
+ l = ra_alloc (sizeof (*l));
l->next = *list;
l->x = x;
*list = l;
int nl_first_reload;
struct rewrite_info ri;
rtx insn;
- ri.needed_loads = (struct web **) xmalloc (num_webs * sizeof (struct web *));
+ ri.needed_loads = xmalloc (num_webs * sizeof (struct web *));
ri.need_reload = BITMAP_XMALLOC ();
ri.scratch = BITMAP_XMALLOC ();
ri.live = sbitmap_alloc (num_webs);
}
ra_max_regno = max_regno = max_reg_num ();
allocate_reg_info (max_regno, FALSE, FALSE);
- ra_reg_renumber = (short *) xmalloc (max_regno * sizeof (short));
+ ra_reg_renumber = xmalloc (max_regno * sizeof (short));
for (si = 0; si < max_regno; si++)
ra_reg_renumber[si] = -1;
ra_build_realloc (df);
if (!live_at_end)
{
- live_at_end = (bitmap *) xmalloc ((last_basic_block + 2)
- * sizeof (bitmap));
+ live_at_end = xmalloc ((last_basic_block + 2) * sizeof (bitmap));
for (i = 0; i < last_basic_block + 2; i++)
live_at_end[i] = BITMAP_XMALLOC ();
live_at_end += 2;
"after allocation/spilling, before reload", NULL);
/* Allocate the reg_equiv_memory_loc array for reload. */
- reg_equiv_memory_loc = (rtx *) xcalloc (max_regno, sizeof (rtx));
+ reg_equiv_memory_loc = xcalloc (max_regno, sizeof (rtx));
/* And possibly initialize it. */
allocate_initial_values (reg_equiv_memory_loc);
/* And one last regclass pass just before reload. */
if (noperands == 0)
return 1;
- operands = (rtx *) alloca (noperands * sizeof (rtx));
- constraints = (const char **) alloca (noperands * sizeof (char *));
+ operands = alloca (noperands * sizeof (rtx));
+ constraints = alloca (noperands * sizeof (char *));
decode_asm_operands (x, operands, NULL, constraints, NULL);
else
changes_allocated *= 2;
- changes =
- (change_t*) xrealloc (changes,
- sizeof (change_t) * changes_allocated);
+ changes = xrealloc (changes, sizeof (change_t) * changes_allocated);
}
changes[num_changes].object = object;
if (GET_CODE (body) == PARALLEL)
{
- clobber_reg = (rtx *) alloca (XVECLEN (body, 0) * sizeof (rtx));
+ clobber_reg = alloca (XVECLEN (body, 0) * sizeof (rtx));
for (i = 0; i < XVECLEN (body, 0); i++)
if (GET_CODE (XVECEXP (body, 0, i)) == CLOBBER)
for (i = 0, note = REG_NOTES (insn); note; note = XEXP (note, 1))
i++;
- note_reg = (rtx *) alloca (i * sizeof (rtx));
- note_loc = (rtx **) alloca (i * sizeof (rtx *));
- note_kind = (enum reg_note *) alloca (i * sizeof (enum reg_note));
+ note_reg = alloca (i * sizeof (rtx));
+ note_loc = alloca (i * sizeof (rtx *));
+ note_kind = alloca (i * sizeof (enum reg_note));
n_notes = 0;
for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
if (GET_CODE (body) == PARALLEL)
{
- clobber_reg = (rtx *) alloca (XVECLEN (body, 0) * sizeof (rtx));
- clobber_loc = (rtx **) alloca (XVECLEN (body, 0) * sizeof (rtx *));
+ clobber_reg = alloca (XVECLEN (body, 0) * sizeof (rtx));
+ clobber_loc = alloca (XVECLEN (body, 0) * sizeof (rtx *));
for (i = 0; i < XVECLEN (body, 0); i++)
if (GET_CODE (XVECEXP (body, 0, i)) == CLOBBER)
basic_block *stack, *sp;
int inserted;
- stack = (basic_block *) xmalloc (sizeof (*stack) * n_basic_blocks);
+ stack = xmalloc (sizeof (*stack) * n_basic_blocks);
sp = stack;
*sp++ = block;
/* Compute number of hard regs in each class. */
- memset ((char *) reg_class_size, 0, sizeof reg_class_size);
+ memset (reg_class_size, 0, sizeof reg_class_size);
for (i = 0; i < N_REG_CLASSES; i++)
for (j = 0; j < FIRST_PSEUDO_REGISTER; j++)
if (TEST_HARD_REG_BIT (reg_class_contents[i], j))
init_recog ();
- costs = (struct costs *) xmalloc (nregs * sizeof (struct costs));
+ costs = xmalloc (nregs * sizeof (struct costs));
#ifdef FORBIDDEN_INC_DEC_CLASSES
- in_inc_dec = (char *) xmalloc (nregs);
+ in_inc_dec = xmalloc (nregs);
#endif /* FORBIDDEN_INC_DEC_CLASSES */
fprintf (dump, "\n\nPass %i\n\n",pass);
/* Zero out our accumulation of the cost of each class for each reg. */
- memset ((char *) costs, 0, nregs * sizeof (struct costs));
+ memset (costs, 0, nregs * sizeof (struct costs));
#ifdef FORBIDDEN_INC_DEC_CLASSES
memset (in_inc_dec, 0, nregs);
if (*p == 0)
{
if (GET_CODE (op) == REG && REGNO (op) >= FIRST_PSEUDO_REGISTER)
- memset ((char *) &this_op_costs[i], 0, sizeof this_op_costs[i]);
+ memset (&this_op_costs[i], 0, sizeof this_op_costs[i]);
continue;
}
if (!reg_n_info)
{
VARRAY_REG_INIT (reg_n_info, regno_allocated, "reg_n_info");
- renumber = (short *) xmalloc (size_renumber);
- reg_pref_buffer = (struct reg_pref *) xmalloc (regno_allocated
- * sizeof (struct reg_pref));
+ renumber = xmalloc (size_renumber);
+ reg_pref_buffer = xmalloc (regno_allocated
+ * sizeof (struct reg_pref));
}
else
{
free ((char *) renumber);
free ((char *) reg_pref);
- renumber = (short *) xmalloc (size_renumber);
- reg_pref_buffer = (struct reg_pref *) xmalloc (regno_allocated
- * sizeof (struct reg_pref));
+ renumber = xmalloc (size_renumber);
+ reg_pref_buffer = xmalloc (regno_allocated
+ * sizeof (struct reg_pref));
}
else
{
- renumber = (short *) xrealloc ((char *) renumber, size_renumber);
- reg_pref_buffer = (struct reg_pref *) xrealloc ((char *) reg_pref_buffer,
- regno_allocated
- * sizeof (struct reg_pref));
+ renumber = xrealloc (renumber, size_renumber);
+ reg_pref_buffer = xrealloc (reg_pref_buffer,
+ regno_allocated
+ * sizeof (struct reg_pref));
}
}
size_info = (regno_allocated - old_allocated) * sizeof (reg_info)
+ sizeof (struct reg_info_data) - sizeof (reg_info);
- reg_data = (struct reg_info_data *) xcalloc (size_info, 1);
+ reg_data = xcalloc (size_info, 1);
reg_data->min_index = old_allocated;
reg_data->max_index = regno_allocated - 1;
reg_data->next = reg_info_head;
if (!reg_data->used_p) /* page just allocated with calloc */
reg_data->used_p = 1; /* no need to zero */
else
- memset ((char *) ®_data->data[local_min], 0,
- sizeof (reg_info) * (max - min_index - local_min + 1));
+ memset (®_data->data[local_min], 0,
+ sizeof (reg_info) * (max - min_index - local_min + 1));
for (i = min_index+local_min; i <= max; i++)
{
can suppress some optimizations in those zones. */
mark_flags_life_zones (discover_flags_reg ());
- regno_src_regno = (int *) xmalloc (sizeof *regno_src_regno * nregs);
+ regno_src_regno = xmalloc (sizeof *regno_src_regno * nregs);
for (i = nregs; --i >= 0; ) regno_src_regno[i] = -1;
- regmove_bb_head = (int *) xmalloc (sizeof (int) * (old_max_uid + 1));
+ regmove_bb_head = xmalloc (sizeof (int) * (old_max_uid + 1));
for (i = old_max_uid; i >= 0; i--) regmove_bb_head[i] = -1;
FOR_EACH_BB (bb)
regmove_bb_head[INSN_UID (bb->head)] = bb->index;
{
struct csa_memlist *ml;
- ml = (struct csa_memlist *) xmalloc (sizeof (*ml));
+ ml = xmalloc (sizeof (*ml));
if (XEXP (*mem, 0) == stack_pointer_rtx)
ml->sp_offset = 0;
memset (tick, 0, sizeof tick);
gcc_obstack_init (&rename_obstack);
- first_obj = (char *) obstack_alloc (&rename_obstack, 0);
+ first_obj = obstack_alloc (&rename_obstack, 0);
FOR_EACH_BB (bb)
{
{
if (type == OP_OUT)
{
- struct du_chain *this = (struct du_chain *)
- obstack_alloc (&rename_obstack, sizeof (struct du_chain));
+ struct du_chain *this
+ = obstack_alloc (&rename_obstack, sizeof (struct du_chain));
this->next_use = 0;
this->next_chain = open_chains;
this->loc = loc;
be replaced with, terminate the chain. */
if (class != NO_REGS)
{
- this = (struct du_chain *)
- obstack_alloc (&rename_obstack, sizeof (struct du_chain));
+ this = obstack_alloc (&rename_obstack, sizeof (struct du_chain));
this->next_use = 0;
this->next_chain = (*p)->next_chain;
this->loc = loc;
void
clear_secondary_mem (void)
{
- memset ((char *) secondary_memlocs, 0, sizeof secondary_memlocs);
+ memset (secondary_memlocs, 0, sizeof secondary_memlocs);
}
#endif /* SECONDARY_MEMORY_NEEDED */
\f
/* The eliminated forms of any secondary memory locations are per-insn, so
clear them out here. */
- memset ((char *) secondary_memlocs_elim, 0, sizeof secondary_memlocs_elim);
+ memset (secondary_memlocs_elim, 0, sizeof secondary_memlocs_elim);
#endif
/* Dispose quickly of (set (reg..) (reg..)) if both have hard regs and it
/* Initialize obstack for our rtl allocation. */
gcc_obstack_init (&reload_obstack);
- reload_startobj = (char *) obstack_alloc (&reload_obstack, 0);
+ reload_startobj = obstack_alloc (&reload_obstack, 0);
INIT_REG_SET (&spilled_pseudos);
INIT_REG_SET (&pseudos_counted);
if (unused_insn_chains == 0)
{
- c = (struct insn_chain *)
- obstack_alloc (&reload_obstack, sizeof (struct insn_chain));
+ c = obstack_alloc (&reload_obstack, sizeof (struct insn_chain));
INIT_REG_SET (&c->live_throughout);
INIT_REG_SET (&c->dead_or_set);
}
failure = 0;
- reload_firstobj = (char *) obstack_alloc (&reload_obstack, 0);
+ reload_firstobj = obstack_alloc (&reload_obstack, 0);
/* Make sure that the last insn in the chain
is not something that needs reloading. */
#endif
/* We don't have a stack slot for any spill reg yet. */
- memset ((char *) spill_stack_slot, 0, sizeof spill_stack_slot);
- memset ((char *) spill_stack_slot_width, 0, sizeof spill_stack_slot_width);
+ memset (spill_stack_slot, 0, sizeof spill_stack_slot);
+ memset (spill_stack_slot_width, 0, sizeof spill_stack_slot_width);
/* Initialize the save area information for caller-save, in case some
are needed. */
Record memory equivalents in reg_mem_equiv so they can
be substituted eventually by altering the REG-rtx's. */
- reg_equiv_constant = (rtx *) xcalloc (max_regno, sizeof (rtx));
- reg_equiv_mem = (rtx *) xcalloc (max_regno, sizeof (rtx));
- reg_equiv_init = (rtx *) xcalloc (max_regno, sizeof (rtx));
- reg_equiv_address = (rtx *) xcalloc (max_regno, sizeof (rtx));
- reg_max_ref_width = (unsigned int *) xcalloc (max_regno, sizeof (int));
- reg_old_renumber = (short *) xcalloc (max_regno, sizeof (short));
+ reg_equiv_constant = xcalloc (max_regno, sizeof (rtx));
+ reg_equiv_mem = xcalloc (max_regno, sizeof (rtx));
+ reg_equiv_init = xcalloc (max_regno, sizeof (rtx));
+ reg_equiv_address = xcalloc (max_regno, sizeof (rtx));
+ reg_max_ref_width = xcalloc (max_regno, sizeof (int));
+ reg_old_renumber = xcalloc (max_regno, sizeof (short));
memcpy (reg_old_renumber, reg_renumber, max_regno * sizeof (short));
- pseudo_forbidden_regs
- = (HARD_REG_SET *) xmalloc (max_regno * sizeof (HARD_REG_SET));
- pseudo_previous_regs
- = (HARD_REG_SET *) xcalloc (max_regno, sizeof (HARD_REG_SET));
+ pseudo_forbidden_regs = xmalloc (max_regno * sizeof (HARD_REG_SET));
+ pseudo_previous_regs = xcalloc (max_regno, sizeof (HARD_REG_SET));
CLEAR_HARD_REG_SET (bad_spill_regs_global);
allocate would occasionally cause it to exceed the stack limit and
cause a core dump. */
offsets_known_at = xmalloc (num_labels);
- offsets_at
- = (int (*)[NUM_ELIMINABLE_REGS])
- xmalloc (num_labels * NUM_ELIMINABLE_REGS * sizeof (int));
+ offsets_at = xmalloc (num_labels * NUM_ELIMINABLE_REGS * sizeof (int));
/* Alter each pseudo-reg rtx to contain its hard reg number.
Assign stack slots to the pseudos that lack hard regs or equivalents.
{
save_call_clobbered_regs ();
/* That might have allocated new insn_chain structures. */
- reload_firstobj = (char *) obstack_alloc (&reload_obstack, 0);
+ reload_firstobj = obstack_alloc (&reload_obstack, 0);
}
calculate_needs_all_insns (global);
copy_reloads (struct insn_chain *chain)
{
chain->n_reloads = n_reloads;
- chain->rld
- = (struct reload *) obstack_alloc (&reload_obstack,
- n_reloads * sizeof (struct reload));
+ chain->rld = obstack_alloc (&reload_obstack,
+ n_reloads * sizeof (struct reload));
memcpy (chain->rld, rld, n_reloads * sizeof (struct reload));
- reload_insn_firstobj = (char *) obstack_alloc (&reload_obstack, 0);
+ reload_insn_firstobj = obstack_alloc (&reload_obstack, 0);
}
/* Walk the chain of insns, and determine for each whether it needs reloads
something_needs_elimination = 0;
- reload_insn_firstobj = (char *) obstack_alloc (&reload_obstack, 0);
+ reload_insn_firstobj = obstack_alloc (&reload_obstack, 0);
for (chain = reload_insn_chain; chain != 0; chain = next)
{
rtx insn = chain->insn;
#endif
if (!reg_eliminate)
- reg_eliminate = (struct elim_table *)
- xcalloc (sizeof (struct elim_table), NUM_ELIMINABLE_REGS);
+ reg_eliminate = xcalloc (sizeof (struct elim_table), NUM_ELIMINABLE_REGS);
/* Does this function require a frame pointer? */
/* Retry global register allocation if possible. */
if (global)
{
- memset ((char *) pseudo_forbidden_regs, 0, max_regno * sizeof (HARD_REG_SET));
+ memset (pseudo_forbidden_regs, 0, max_regno * sizeof (HARD_REG_SET));
/* For every insn that needs reloads, set the registers used as spill
regs in pseudo_forbidden_regs for every pseudo live across the
insn. */
#endif
rtx x;
- memset ((char *) spill_reg_rtx, 0, sizeof spill_reg_rtx);
- memset ((char *) spill_reg_store, 0, sizeof spill_reg_store);
- reg_last_reload_reg = (rtx *) xcalloc (max_regno, sizeof (rtx));
- reg_has_output_reload = (char *) xmalloc (max_regno);
+ memset (spill_reg_rtx, 0, sizeof spill_reg_rtx);
+ memset (spill_reg_store, 0, sizeof spill_reg_store);
+ reg_last_reload_reg = xcalloc (max_regno, sizeof (rtx));
+ reg_has_output_reload = xmalloc (max_regno);
CLEAR_HARD_REG_SET (reg_reloaded_valid);
set_initial_elim_offsets ();
rld[i].reg_rtx = save_reload_reg_rtx[i];
memset (reload_inherited, 0, MAX_RELOADS);
- memset ((char *) reload_inheritance_insn, 0, MAX_RELOADS * sizeof (rtx));
- memset ((char *) reload_override_in, 0, MAX_RELOADS * sizeof (rtx));
+ memset (reload_inheritance_insn, 0, MAX_RELOADS * sizeof (rtx));
+ memset (reload_override_in, 0, MAX_RELOADS * sizeof (rtx));
CLEAR_HARD_REG_SET (reload_reg_used);
CLEAR_HARD_REG_SET (reload_reg_used_at_all);
epilogue_insn = insn;
}
- uid_to_ruid = (int *) xmalloc ((max_uid + 1) * sizeof (int));
+ uid_to_ruid = xmalloc ((max_uid + 1) * sizeof (int));
for (i = 0, insn = first; insn; i++, insn = NEXT_INSN (insn))
uid_to_ruid[INSN_UID (insn)] = i;
if (unfilled_firstobj == 0)
{
gcc_obstack_init (&unfilled_slots_obstack);
- unfilled_firstobj = (rtx *) obstack_alloc (&unfilled_slots_obstack, 0);
+ unfilled_firstobj = obstack_alloc (&unfilled_slots_obstack, 0);
}
for (insn = next_active_insn (first); insn; insn = next_active_insn (insn))
end_of_function_label = 0;
/* Initialize the statistics for this function. */
- memset ((char *) num_insns_needing_delays, 0, sizeof num_insns_needing_delays);
- memset ((char *) num_filled_delays, 0, sizeof num_filled_delays);
+ memset (num_insns_needing_delays, 0, sizeof num_insns_needing_delays);
+ memset (num_filled_delays, 0, sizeof num_filled_delays);
/* Now do the delay slot filling. Try everything twice in case earlier
changes make more slots fillable. */
obstack_free (&unfilled_slots_obstack, unfilled_firstobj);
/* It is not clear why the line below is needed, but it does seem to be. */
- unfilled_firstobj = (rtx *) obstack_alloc (&unfilled_slots_obstack, 0);
+ unfilled_firstobj = obstack_alloc (&unfilled_slots_obstack, 0);
if (file)
{
fprintf (file, "\n");
}
}
- memset ((char *) total_delay_slots, 0, sizeof total_delay_slots);
- memset ((char *) total_annul_slots, 0, sizeof total_annul_slots);
+ memset (total_delay_slots, 0, sizeof total_delay_slots);
+ memset (total_annul_slots, 0, sizeof total_annul_slots);
for (insn = first; insn; insn = NEXT_INSN (insn))
{
if (! INSN_DELETED_P (insn)
{
/* Allocate a place to put our results and chain it into the
hash table. */
- tinfo = (struct target_info *) xmalloc (sizeof (struct target_info));
+ tinfo = xmalloc (sizeof (struct target_info));
tinfo->uid = INSN_UID (target);
tinfo->block = b;
tinfo->next
MARK_SRC_DEST_CALL);
/* Allocate and initialize the tables used by mark_target_live_regs. */
- target_hash_table = (struct target_info **)
- xcalloc (TARGET_HASH_PRIME, sizeof (struct target_info *));
- bb_ticks = (int *) xcalloc (last_basic_block, sizeof (int));
+ target_hash_table = xcalloc (TARGET_HASH_PRIME, sizeof (struct target_info *));
+ bb_ticks = xcalloc (last_basic_block, sizeof (int));
}
\f
/* Free up the resources allocated to mark_target_live_regs (). This
bytes = size * sizeof (SBITMAP_ELT_TYPE);
amt = (sizeof (struct simple_bitmap_def)
+ bytes - sizeof (SBITMAP_ELT_TYPE));
- bmap = (sbitmap) xmalloc (amt);
+ bmap = xmalloc (amt);
bmap->n_bits = n_elms;
bmap->size = size;
bmap->bytes = bytes;
{
amt = (sizeof (struct simple_bitmap_def)
+ bytes - sizeof (SBITMAP_ELT_TYPE));
- bmap = (sbitmap) xrealloc (bmap, amt);
+ bmap = xrealloc (bmap, amt);
}
if (n_elms > bmap->n_bits)
}
amt = vector_bytes + (n_vecs * elm_bytes);
- bitmap_vector = (sbitmap *) xmalloc (amt);
+ bitmap_vector = xmalloc (amt);
for (i = 0, offset = vector_bytes; i < n_vecs; i++, offset += elm_bytes)
{
int max_reg = (reload_completed ? FIRST_PSEUDO_REGISTER : max_reg_num ());
deps->max_reg = max_reg;
- deps->reg_last = (struct deps_reg *)
- xcalloc (max_reg, sizeof (struct deps_reg));
+ deps->reg_last = xcalloc (max_reg, sizeof (struct deps_reg));
INIT_REG_SET (&deps->reg_last_in_use);
INIT_REG_SET (&deps->reg_conditional_sets);
}
/* ??? We can kill these soon. */
- in_edges = (int *) xcalloc (last_basic_block, sizeof (int));
- out_edges = (int *) xcalloc (last_basic_block, sizeof (int));
- edge_table = (haifa_edge *) xcalloc (num_edges, sizeof (haifa_edge));
+ in_edges = xcalloc (last_basic_block, sizeof (int));
+ out_edges = xcalloc (last_basic_block, sizeof (int));
+ edge_table = xcalloc (num_edges, sizeof (haifa_edge));
nr_edges = 0;
for (i = 0; i < num_edges; i++)
STACK, SP and DFS_NR are only used during the first traversal. */
/* Allocate and initialize variables for the first traversal. */
- max_hdr = (int *) xmalloc (last_basic_block * sizeof (int));
- dfs_nr = (int *) xcalloc (last_basic_block, sizeof (int));
- stack = (int *) xmalloc (nr_edges * sizeof (int));
+ max_hdr = xmalloc (last_basic_block * sizeof (int));
+ dfs_nr = xcalloc (last_basic_block, sizeof (int));
+ stack = xmalloc (nr_edges * sizeof (int));
inner = sbitmap_alloc (last_basic_block);
sbitmap_ones (inner);
/* Second traversal:find reducible inner loops and topologically sort
block of each region. */
- queue = (int *) xmalloc (n_basic_blocks * sizeof (int));
+ queue = xmalloc (n_basic_blocks * sizeof (int));
/* Find blocks which are inner loop headers. We still have non-reducible
loops to consider at this point. */
static void
split_edges (int bb_src, int bb_trg, edgelst *bl)
{
- sbitmap src = (edgeset) sbitmap_alloc (pot_split[bb_src]->n_bits);
+ sbitmap src = sbitmap_alloc (pot_split[bb_src]->n_bits);
sbitmap_copy (src, pot_split[bb_src]);
sbitmap_difference (src, src, pot_split[bb_trg]);
add the TO block to the update block list. This list can end
up with a lot of duplicates. We need to weed them out to avoid
overrunning the end of the bblst_table. */
- update_blocks = (char *) alloca (last_basic_block);
+ update_blocks = alloca (last_basic_block);
memset (update_blocks, 0, last_basic_block);
update_idx = 0;
/* Prepare current target block info. */
if (current_nr_blocks > 1)
{
- candidate_table = (candidate *) xmalloc (current_nr_blocks
- * sizeof (candidate));
+ candidate_table = xmalloc (current_nr_blocks * sizeof (candidate));
bblst_last = 0;
/* bblst_table holds split blocks and update blocks for each block after
the TO blocks of region edges, so there can be at most rgn_nr_edges
of them. */
bblst_size = (current_nr_blocks - target_bb) * rgn_nr_edges;
- bblst_table = (int *) xmalloc (bblst_size * sizeof (int));
+ bblst_table = xmalloc (bblst_size * sizeof (int));
bitlst_table_last = 0;
- bitlst_table = (int *) xmalloc (rgn_nr_edges * sizeof (int));
+ bitlst_table = xmalloc (rgn_nr_edges * sizeof (int));
compute_trg_info (target_bb);
}
init_deps_global ();
/* Initializations for region data dependence analysis. */
- bb_deps = (struct deps *) xmalloc (sizeof (struct deps) * current_nr_blocks);
+ bb_deps = xmalloc (sizeof (struct deps) * current_nr_blocks);
for (bb = 0; bb < current_nr_blocks; bb++)
init_deps (bb_deps + bb);
{
int i;
- prob = (float *) xmalloc ((current_nr_blocks) * sizeof (float));
+ prob = xmalloc ((current_nr_blocks) * sizeof (float));
dom = sbitmap_vector_alloc (current_nr_blocks, current_nr_blocks);
sbitmap_vector_zero (dom, current_nr_blocks);
/* Edge to bit. */
rgn_nr_edges = 0;
- edge_to_bit = (int *) xmalloc (nr_edges * sizeof (int));
+ edge_to_bit = xmalloc (nr_edges * sizeof (int));
for (i = 1; i < nr_edges; i++)
if (CONTAINING_RGN (FROM_BLOCK (i)) == rgn)
EDGE_TO_BIT (i) = rgn_nr_edges++;
- rgn_edges = (int *) xmalloc (rgn_nr_edges * sizeof (int));
+ rgn_edges = xmalloc (rgn_nr_edges * sizeof (int));
rgn_nr_edges = 0;
for (i = 1; i < nr_edges; i++)
int rgn;
nr_regions = 0;
- rgn_table = (region *) xmalloc ((n_basic_blocks) * sizeof (region));
- rgn_bb_table = (int *) xmalloc ((n_basic_blocks) * sizeof (int));
- block_to_bb = (int *) xmalloc ((last_basic_block) * sizeof (int));
- containing_rgn = (int *) xmalloc ((last_basic_block) * sizeof (int));
+ rgn_table = xmalloc ((n_basic_blocks) * sizeof (region));
+ rgn_bb_table = xmalloc ((n_basic_blocks) * sizeof (int));
+ block_to_bb = xmalloc ((last_basic_block) * sizeof (int));
+ containing_rgn = xmalloc ((last_basic_block) * sizeof (int));
/* Compute regions for scheduling. */
if (reload_completed
if (CHECK_DEAD_NOTES)
{
blocks = sbitmap_alloc (last_basic_block);
- deaths_in_region = (int *) xmalloc (sizeof (int) * nr_regions);
+ deaths_in_region = xmalloc (sizeof (int) * nr_regions);
/* Remove all death notes from the subroutine. */
for (rgn = 0; rgn < nr_regions; rgn++)
{
}
/* Compute length of one field in line. */
- s = (char *) alloca (INSN_LEN + 6);
+ s = alloca (INSN_LEN + 6);
sprintf (s, " %33s", "uname");
n1 = strlen (s);
{
tree decl = (*lang_hooks.decls.getdecls) ();
unsigned int len = list_length (decl);
- tree *vec = (tree *) xmalloc (sizeof (tree) * len);
+ tree *vec = xmalloc (sizeof (tree) * len);
unsigned int i;
/* Process the decls in reverse order--earliest first. Put them
const char *filename ATTRIBUTE_UNUSED)
{
#ifdef MIPS_DEBUGGING_INFO
- struct sdb_file *n = (struct sdb_file *) xmalloc (sizeof *n);
+ struct sdb_file *n = xmalloc (sizeof *n);
n->next = current_file;
n->name = filename;
sdbout_init (const char *input_file_name ATTRIBUTE_UNUSED)
{
#ifdef MIPS_DEBUGGING_INFO
- current_file = (struct sdb_file *) xmalloc (sizeof *current_file);
+ current_file = xmalloc (sizeof *current_file);
current_file->next = NULL;
current_file->name = input_file_name;
#endif
int first, negate, changed;
int i, j;
- memset ((char *) ops, 0, sizeof ops);
+ memset (ops, 0, sizeof ops);
/* Set up the two operands and then expand them until nothing has been
changed. If we run out of room in our array, give up; this should
edges = create_edge_list ();
/* Initialize the values array with everything as undefined. */
- values = (value *) xmalloc (VARRAY_SIZE (ssa_definition) * sizeof (value));
+ values = xmalloc (VARRAY_SIZE (ssa_definition) * sizeof (value));
for (i = 0; i < VARRAY_SIZE (ssa_definition); i++)
{
if (i < FIRST_PSEUDO_REGISTER)
executable_edges = sbitmap_alloc (NUM_EDGES (edges));
sbitmap_zero (executable_edges);
- edge_info = (edge *) xmalloc (NUM_EDGES (edges) * sizeof (edge));
+ edge_info = xmalloc (NUM_EDGES (edges) * sizeof (edge));
flow_edges = ENTRY_BLOCK_PTR->succ;
/* Add the successors of the entry block to the edge worklist. That
ssa_rename_from_pair *answer;
srfp.reg = reg;
srfp.original = NULL_RTX;
- answer = (ssa_rename_from_pair *)
- htab_find_with_hash (ssa_rename_from_ht, (void *) &srfp, reg);
+ answer = htab_find_with_hash (ssa_rename_from_ht, (void *) &srfp, reg);
return (answer == 0 ? NULL_RTX : answer->original);
}
create_delayed_rename (struct rename_context *c, rtx *reg_loc)
{
struct rename_set_data *r;
- r = (struct rename_set_data *) xmalloc (sizeof(*r));
+ r = xmalloc (sizeof(*r));
if (GET_CODE (*reg_loc) != REG
|| !CONVERT_REGISTER_TO_SSA_P (REGNO (*reg_loc)))
VARRAY_RTX_INIT (ssa_definition, nregs * 3, "ssa_definition");
ssa_rename_from_initialize ();
- ssa_rename_to_pseudo = (rtx *) alloca (nregs * sizeof(rtx));
- memset ((char *) ssa_rename_to_pseudo, 0, nregs * sizeof(rtx));
- memset ((char *) ssa_rename_to_hard, 0,
- FIRST_PSEUDO_REGISTER * NUM_MACHINE_MODES * sizeof (rtx));
+ ssa_rename_to_pseudo = alloca (nregs * sizeof(rtx));
+ memset (ssa_rename_to_pseudo, 0, nregs * sizeof(rtx));
+ memset (ssa_rename_to_hard, 0,
+ FIRST_PSEUDO_REGISTER * NUM_MACHINE_MODES * sizeof (rtx));
rename_block (0, idom);
present in Phi(B). There is an edge from FIND(T0)->FIND(T1) for
each T0 = PHI(...,T1,...), where T1 is for the edge from block C. */
- nodes = (rtx *) alloca (n_nodes * sizeof(rtx));
+ nodes = alloca (n_nodes * sizeof(rtx));
pred = sbitmap_vector_alloc (n_nodes, n_nodes);
succ = sbitmap_vector_alloc (n_nodes, n_nodes);
sbitmap_vector_zero (pred, n_nodes);
visited = sbitmap_alloc (n_nodes);
sbitmap_zero (visited);
- tstack = stack = (int *) alloca (n_nodes * sizeof (int));
+ tstack = stack = alloca (n_nodes * sizeof (int));
for (i = 0; i < n_nodes; ++i)
if (! TEST_BIT (visited, i))
/* Allocate and return a new `struct nesting'. */
-#define ALLOC_NESTING() \
- (struct nesting *) ggc_alloc (sizeof (struct nesting))
+#define ALLOC_NESTING() ggc_alloc (sizeof (struct nesting))
/* Pop the nesting stack element by element until we pop off
the element which is at the top of STACK.
void
init_stmt_for_function (void)
{
- cfun->stmt = ((struct stmt_status *)ggc_alloc (sizeof (struct stmt_status)));
+ cfun->stmt =ggc_alloc (sizeof (struct stmt_status));
/* We are not currently within any block, conditional, loop or case. */
block_stack = 0;
if (stack_block_stack != 0)
{
- p = (struct label_chain *) ggc_alloc (sizeof (struct label_chain));
+ p = ggc_alloc (sizeof (struct label_chain));
p->next = stack_block_stack->data.block.label_chain;
stack_block_stack->data.block.label_chain = p;
p->label = label;
if (block != end_block)
{
/* Ok, a fixup is needed. Add a fixup to the list of such. */
- struct goto_fixup *fixup
- = (struct goto_fixup *) ggc_alloc (sizeof (struct goto_fixup));
+ struct goto_fixup *fixup = ggc_alloc (sizeof (struct goto_fixup));
/* In case an old stack level is restored, make sure that comes
after any pending stack adjust. */
/* ?? If the fixup isn't to come at the present position,
tree t;
int i;
/* Vector of RTX's of evaluated output operands. */
- rtx *output_rtx = (rtx *) alloca (noutputs * sizeof (rtx));
- int *inout_opnum = (int *) alloca (noutputs * sizeof (int));
- rtx *real_output_rtx = (rtx *) alloca (noutputs * sizeof (rtx));
+ rtx *output_rtx = alloca (noutputs * sizeof (rtx));
+ int *inout_opnum = alloca (noutputs * sizeof (int));
+ rtx *real_output_rtx = alloca (noutputs * sizeof (rtx));
enum machine_mode *inout_mode
- = (enum machine_mode *) alloca (noutputs * sizeof (enum machine_mode));
+ = alloca (noutputs * sizeof (enum machine_mode));
const char **constraints
- = (const char **) alloca ((noutputs + ninputs) * sizeof (const char *));
+ = alloca ((noutputs + ninputs) * sizeof (const char *));
int old_generating_concat_p = generating_concat_p;
/* An ASM with no outputs needs to be treated as volatile, for now. */
int n_regs = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
unsigned int bitsize
= MIN (TYPE_ALIGN (TREE_TYPE (retval_rhs)), BITS_PER_WORD);
- rtx *result_pseudos = (rtx *) alloca (sizeof (rtx) * n_regs);
+ rtx *result_pseudos = alloca (sizeof (rtx) * n_regs);
rtx result_reg, src = NULL_RTX, dst = NULL_RTX;
rtx result_val = expand_expr (retval_rhs, NULL_RTX, VOIDmode, 0);
enum machine_mode tmpmode, result_reg_mode;
/* Compute all the actuals. */
- argvec = (rtx *) alloca (i * sizeof (rtx));
+ argvec = alloca (i * sizeof (rtx));
for (a = actuals, i = 0; a; a = TREE_CHAIN (a), i++)
argvec[i] = expand_expr (TREE_VALUE (a), NULL_RTX, VOIDmode, 0);
/* Add this label to the chain, and succeed. */
- r = (struct case_node *) ggc_alloc (sizeof (struct case_node));
+ r = ggc_alloc (sizeof (struct case_node));
r->low = low;
/* If the bounds are equal, turn this into the one-value case. */
/* We deliberately use calloc here, not cmalloc, so that we can suppress
this optimization if we don't have enough memory rather than
aborting, as xmalloc would do. */
- && (cases_seen =
- (unsigned char *) really_call_calloc (bytes_needed, 1)) != NULL)
+ && (cases_seen = really_call_calloc (bytes_needed, 1)) != NULL)
{
HOST_WIDE_INT i;
tree v = TYPE_VALUES (type);
/* Get table of labels to jump to, in order of case index. */
ncases = tree_low_cst (range, 0) + 1;
- labelvec = (rtx *) alloca (ncases * sizeof (rtx));
- memset ((char *) labelvec, 0, ncases * sizeof (rtx));
+ labelvec = alloca (ncases * sizeof (rtx));
+ memset (labelvec, 0, ncases * sizeof (rtx));
for (n = thiscase->data.case_stmt.case_list; n; n = n->right)
{
record_layout_info
start_record_layout (tree t)
{
- record_layout_info rli
- = (record_layout_info) xmalloc (sizeof (struct record_layout_info_s));
+ record_layout_info rli = xmalloc (sizeof (struct record_layout_info_s));
rli->t = t;
timevar_enable = true;
/* Zero all elapsed times. */
- memset ((void *) timevars, 0, sizeof (timevars));
+ memset (timevars, 0, sizeof (timevars));
/* Initialize the names of timing variables. */
#define DEFTIMEVAR(identifier__, name__) \
unused_stack_instances = unused_stack_instances->next;
}
else
- context = (struct timevar_stack_def *)
- xmalloc (sizeof (struct timevar_stack_def));
+ context = xmalloc (sizeof (struct timevar_stack_def));
/* Fill it in and put it on the stack. */
context->timevar = tv;
static void
symbol_push (symbol *p)
{
- struct symbol_stack_entry *ep = (struct symbol_stack_entry *) obstack_alloc
+ struct symbol_stack_entry *ep = obstack_alloc
(&symbol_stack_obstack, sizeof (struct symbol_stack_entry));
ep->value = p;
ep->next = symbol_stack;
if (p->tweaking)
return;
- ep = (struct file_stack_entry *) obstack_alloc
+ ep = obstack_alloc
(&file_stack_obstack, sizeof (struct file_stack_entry));
ep->value = p;
ep->next = file_stack;
{
struct file_stack *fs;
- fs = (struct file_stack *) xmalloc (sizeof (struct file_stack));
+ fs = xmalloc (sizeof (struct file_stack));
fs->location = input_location;
fs->next = input_file_stack;
input_filename = file;
allocate_reg_info (max_regno, FALSE, TRUE);
/* And the reg_equiv_memory_loc array. */
- reg_equiv_memory_loc = (rtx *) xcalloc (max_regno, sizeof (rtx));
+ reg_equiv_memory_loc = xcalloc (max_regno, sizeof (rtx));
allocate_initial_values (reg_equiv_memory_loc);
if (asm_file_name == 0)
{
int len = strlen (dump_base_name);
- char *dumpname = (char *) xmalloc (len + 6);
+ char *dumpname = xmalloc (len + 6);
memcpy (dumpname, dump_base_name, len + 1);
strip_off_ending (dumpname, len);
strcat (dumpname, ".s");
}
#ifdef IO_BUFFER_SIZE
- setvbuf (asm_out_file, (char *) xmalloc (IO_BUFFER_SIZE),
+ setvbuf (asm_out_file, xmalloc (IO_BUFFER_SIZE),
_IOFBF, IO_BUFFER_SIZE);
#endif
di->free_list = dq->next;
}
else
- dq = (dump_queue_p) xmalloc (sizeof (struct dump_queue));
+ dq = xmalloc (sizeof (struct dump_queue));
/* Create a new entry in the splay-tree. */
- dni = (dump_node_info_p) xmalloc (sizeof (struct dump_node_info));
+ dni = xmalloc (sizeof (struct dump_node_info));
dni->index = index;
dni->binfo_p = ((flags & DUMP_BINFO) != 0);
dq->node = splay_tree_insert (di->nodes, (splay_tree_key) t,
/* Clear all bits of the real value type so that we can later do
bitwise comparisons to see if two values are the same. */
- memset ((char *) &d, 0, sizeof d);
+ memset (&d, 0, sizeof d);
if (! TREE_UNSIGNED (TREE_TYPE (i)))
REAL_VALUE_FROM_INT (d, TREE_INT_CST_LOW (i), TREE_INT_CST_HIGH (i),
struct type_hash *h;
void **loc;
- h = (struct type_hash *) ggc_alloc (sizeof (struct type_hash));
+ h = ggc_alloc (sizeof (struct type_hash));
h->hash = hashcode;
h->type = type;
loc = htab_find_slot_with_hash (type_hash_table, h, hashcode, INSERT);
file = input_filename;
len = strlen (file);
- q = (char *) alloca (9 * 2 + len);
+ q = alloca (9 * 2 + len);
memcpy (q, file, len + 1);
clean_symbol_name (q);
p = q;
}
- buf = (char *) alloca (sizeof (FILE_FUNCTION_FORMAT) + strlen (p)
- + strlen (type));
+ buf = 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
int bit_size = wd_size * set_word_size;
int bit_pos = 0;
unsigned char *bytep = buffer;
- char *bit_buffer = (char *) alloca (bit_size);
+ char *bit_buffer = alloca (bit_size);
tree non_const_bits = get_set_constructor_bits (init, bit_buffer, bit_size);
for (i = 0; i < wd_size; i++)
without initializing fields within the map structure.
To be safe, we use xcalloc to zero the memory. */
- map = (struct inline_remap *) xcalloc (1, sizeof (struct inline_remap));
+ map = xcalloc (1, sizeof (struct inline_remap));
/* Allocate the label map. */
if (max_labelno > 0)
{
- map->label_map = (rtx *) xcalloc (max_labelno, sizeof (rtx));
- local_label = (char *) xcalloc (max_labelno, sizeof (char));
+ map->label_map = xcalloc (max_labelno, sizeof (rtx));
+ local_label = xcalloc (max_labelno, sizeof (char));
}
/* Search the loop and mark all local labels, i.e. the ones which have to
/* Allocate space for the insn map. */
- map->insn_map = (rtx *) xmalloc (max_insnno * sizeof (rtx));
+ map->insn_map = xmalloc (max_insnno * sizeof (rtx));
/* Set this to zero, to indicate that we are doing loop unrolling,
not function inlining. */
preconditioning code and find_splittable_regs will never be used
to access the splittable_regs[] and addr_combined_regs[] arrays. */
- splittable_regs = (rtx *) xcalloc (maxregnum, sizeof (rtx));
- splittable_regs_updates = (int *) xcalloc (maxregnum, sizeof (int));
- addr_combined_regs
- = (struct induction **) xcalloc (maxregnum, sizeof (struct induction *));
- local_regno = (char *) xcalloc (maxregnum, sizeof (char));
+ splittable_regs = xcalloc (maxregnum, sizeof (rtx));
+ splittable_regs_updates = xcalloc (maxregnum, sizeof (int));
+ addr_combined_regs = xcalloc (maxregnum, sizeof (struct induction *));
+ local_regno = xcalloc (maxregnum, sizeof (char));
/* Mark all local registers, i.e. the ones which are referenced only
inside the loop. */
int less_p = (cc == LE || cc == LEU || cc == LT || cc == LTU);
int unsigned_p = (cc == LEU || cc == GEU || cc == LTU || cc == GTU);
- map->reg_map = (rtx *) xmalloc (maxregnum * sizeof (rtx));
+ map->reg_map = xmalloc (maxregnum * sizeof (rtx));
VARRAY_CONST_EQUIV_INIT (map->const_equiv_varray, maxregnum,
"unroll_loop_precondition");
/* Now emit a sequence of branches to jump to the proper precond
loop entry point. */
- labels = (rtx *) xmalloc (sizeof (rtx) * unroll_number);
+ labels = xmalloc (sizeof (rtx) * unroll_number);
for (i = 0; i < unroll_number; i++)
labels[i] = gen_label_rtx ();
emit_label_after (labels[unroll_number - i],
PREV_INSN (loop_start));
- memset ((char *) map->insn_map, 0, max_insnno * sizeof (rtx));
- memset ((char *) &VARRAY_CONST_EQUIV (map->const_equiv_varray, 0),
+ memset (map->insn_map, 0, max_insnno * sizeof (rtx));
+ memset (&VARRAY_CONST_EQUIV (map->const_equiv_varray, 0),
0, (VARRAY_SIZE (map->const_equiv_varray)
* sizeof (struct const_equiv_data)));
map->const_age = 0;
the constant maps also. */
maxregnum = max_reg_num ();
- map->reg_map = (rtx *) xmalloc (maxregnum * sizeof (rtx));
+ map->reg_map = xmalloc (maxregnum * sizeof (rtx));
init_reg_map (map, maxregnum);
for (i = 0; i < unroll_number; i++)
{
- memset ((char *) map->insn_map, 0, max_insnno * sizeof (rtx));
- memset ((char *) &VARRAY_CONST_EQUIV (map->const_equiv_varray, 0), 0,
+ memset (map->insn_map, 0, max_insnno * sizeof (rtx));
+ memset (&VARRAY_CONST_EQUIV (map->const_equiv_varray, 0), 0,
VARRAY_SIZE (map->const_equiv_varray) * sizeof (struct const_equiv_data));
map->const_age = 0;
if (*(uword *) begin == 0)
return;
- ob = (struct object *) malloc (sizeof (struct object));
+ ob = malloc (sizeof (struct object));
__register_frame_info (begin, ob);
}
void
__register_frame_table (void *begin)
{
- struct object *ob = (struct object *) malloc (sizeof (struct object));
+ struct object *ob = malloc (sizeof (struct object));
__register_frame_info_table (begin, ob);
}
return 0;
size = sizeof (struct fde_vector) + sizeof (fde *) * count;
- if ((accu->linear = (struct fde_vector *) malloc (size)))
+ if ((accu->linear = malloc (size)))
{
accu->linear->count = 0;
- if ((accu->erratic = (struct fde_vector *) malloc (size)))
+ if ((accu->erratic = malloc (size)))
accu->erratic->count = 0;
return 1;
}
if (!entry)
{
- entry = (struct in_named_entry *) ggc_alloc (sizeof (*entry));
+ entry = ggc_alloc (sizeof (*entry));
*slot = entry;
entry->name = ggc_strdup (section);
entry->flags = flags;
char *tmp;
len = int_size_in_bytes (TREE_TYPE (exp));
- tmp = (char *) alloca (len);
+ tmp = alloca (len);
get_set_constructor_bytes (exp, (unsigned char *) tmp, len);
p = tmp;
break;
if (int_size_in_bytes (TREE_TYPE (t1)) != len)
return 0;
- tmp1 = (unsigned char *) alloca (len);
- tmp2 = (unsigned char *) alloca (len);
+ tmp1 = alloca (len);
+ tmp2 = alloca (len);
if (get_set_constructor_bytes (t1, tmp1, len) != NULL_TREE)
return 0;
init_varasm_status (struct function *f)
{
struct varasm_status *p;
- p = (struct varasm_status *) ggc_alloc (sizeof (struct varasm_status));
+ p = ggc_alloc (sizeof (struct varasm_status));
f->varasm = p;
p->x_const_rtx_hash_table
- = ((struct constant_descriptor_rtx **)
- ggc_alloc_cleared (MAX_RTX_HASH_TABLE
- * sizeof (struct constant_descriptor_rtx *)));
+ = ggc_alloc_cleared (MAX_RTX_HASH_TABLE
+ * sizeof (struct constant_descriptor_rtx *));
p->x_const_rtx_sym_hash_table
- = ((struct pool_constant **)
- ggc_alloc_cleared (MAX_RTX_HASH_TABLE
- * sizeof (struct pool_constant *)));
+ = ggc_alloc_cleared (MAX_RTX_HASH_TABLE
+ * sizeof (struct pool_constant *));
p->x_first_pool = p->x_last_pool = 0;
p->x_pool_offset = 0;
{
struct constant_descriptor_rtx *ptr;
- ptr = (struct constant_descriptor_rtx *) ggc_alloc (sizeof (*ptr));
+ ptr = ggc_alloc (sizeof (*ptr));
decode_rtx_const (mode, x, &ptr->value);
return ptr;
LABEL_PRESERVE_P (XEXP (x, 0)) = 1;
/* Allocate a pool constant descriptor, fill it in, and chain it in. */
- pool = (struct pool_constant *) ggc_alloc (sizeof (struct pool_constant));
+ pool = ggc_alloc (sizeof (struct pool_constant));
pool->desc = desc;
pool->constant = x;
pool->mode = mode;
thissize, align, 1);
else if (TREE_CODE (exp) == CONSTRUCTOR)
{
- unsigned char *buffer = (unsigned char *) alloca (thissize);
+ unsigned char *buffer = alloca (thissize);
if (get_set_constructor_bytes (exp, buffer, thissize))
abort ();
assemble_string ((char *) buffer, thissize);
size_t data_size = num_elements * element[element_kind].size;
varray_type ptr;
if (element[element_kind].uses_ggc)
- ptr = (varray_type) ggc_alloc_cleared (VARRAY_HDR_SIZE + data_size);
+ ptr = ggc_alloc_cleared (VARRAY_HDR_SIZE + data_size);
else
- ptr = (varray_type) xcalloc (VARRAY_HDR_SIZE + data_size, 1);
+ ptr = xcalloc (VARRAY_HDR_SIZE + data_size, 1);
ptr->num_elements = num_elements;
ptr->elements_used = 0;
size_t data_size = n * elem_size;
if (element[va->type].uses_ggc)
- va = (varray_type) ggc_realloc (va, VARRAY_HDR_SIZE + data_size);
+ va = ggc_realloc (va, VARRAY_HDR_SIZE + data_size);
else
- va = (varray_type) xrealloc ((char *) va, VARRAY_HDR_SIZE + data_size);
+ va = xrealloc (va, VARRAY_HDR_SIZE + data_size);
va->num_elements = n;
if (n > old_elements)
memset (&va->data.c[old_data_size], 0, data_size - old_data_size);
if (func_table_in_use == func_table_allocated)
{
func_table_allocated += FUNC_TABLE_INCREMENT;
- func_table = (char **) xrealloc (func_table,
- func_table_allocated * sizeof (char *));
+ func_table = xrealloc (func_table,
+ func_table_allocated * sizeof (char *));
}
/* Add the new entry to the end of the function name table. */
{
file_info_table_allocated += FILE_TABLE_INCREMENT;
- file_info_table
- = (dst_file_info_ref) xrealloc (file_info_table,
- (file_info_table_allocated
- * sizeof (dst_file_info_entry)));
+ file_info_table = xrealloc (file_info_table,
+ (file_info_table_allocated
+ * sizeof (dst_file_info_entry)));
}
/* Add the new entry to the end of the filename table. */
if (line_info_table_in_use == line_info_table_allocated)
{
line_info_table_allocated += LINE_INFO_TABLE_INCREMENT;
- line_info_table
- = (dst_line_info_ref) xrealloc (line_info_table,
- (line_info_table_allocated
- * sizeof (dst_line_info_entry)));
+ line_info_table = xrealloc (line_info_table,
+ (line_info_table_allocated
+ * sizeof (dst_line_info_entry)));
}
/* Add the new entry at the end of the line_info_table. */
/* Allocate the initial hunk of the file_info_table. */
file_info_table
- = (dst_file_info_ref) xcalloc (FILE_TABLE_INCREMENT,
- sizeof (dst_file_info_entry));
+ = xcalloc (FILE_TABLE_INCREMENT, sizeof (dst_file_info_entry));
file_info_table_allocated = FILE_TABLE_INCREMENT;
/* Skip the first entry - file numbers begin at 1 */
file_info_table_in_use = 1;
- func_table = (char **) xcalloc (FUNC_TABLE_INCREMENT, sizeof (char *));
+ func_table = xcalloc (FUNC_TABLE_INCREMENT, sizeof (char *));
func_table_allocated = FUNC_TABLE_INCREMENT;
func_table_in_use = 1;
/* Allocate the initial hunk of the line_info_table. */
line_info_table
- = (dst_line_info_ref) xcalloc (LINE_INFO_TABLE_INCREMENT,
- sizeof (dst_line_info_entry));
+ = xcalloc (LINE_INFO_TABLE_INCREMENT, sizeof (dst_line_info_entry));
line_info_table_allocated = LINE_INFO_TABLE_INCREMENT;
/* zero-th entry is allocated, but unused */
line_info_table_in_use = 1;
{
if (name[i] == '[')
{
- char *n = (char *) alloca (i + 1);
+ char *n = alloca (i + 1);
strncpy (n, name, i);
n[i] = '\0';
name = n;