alias.c [...]: Remove unnecessary casts.

* 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.

From-SVN: r69587
This commit is contained in:
Kaveh R. Ghazi 2003-07-19 14:47:15 +00:00 committed by Kaveh Ghazi
parent 308ca868d3
commit 703ad42b4b
119 changed files with 952 additions and 1145 deletions

View File

@ -1,3 +1,27 @@
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> 2003-07-19 Gabriel Dos Reis <gdr@integrable-solutions.net>
* c-pragma.c (apply_pragma_weak): Don't use warning_with_decl. * c-pragma.c (apply_pragma_weak): Don't use warning_with_decl.

View File

@ -632,8 +632,7 @@ record_alias_subset (HOST_WIDE_INT superset, HOST_WIDE_INT subset)
{ {
/* Create an entry for the SUPERSET, so that we have a place to /* Create an entry for the SUPERSET, so that we have a place to
attach the SUBSET. */ attach the SUBSET. */
superset_entry superset_entry = xmalloc (sizeof (struct alias_set_entry));
= (alias_set_entry) xmalloc (sizeof (struct alias_set_entry));
superset_entry->alias_set = superset; superset_entry->alias_set = superset;
superset_entry->children superset_entry->children
= splay_tree_new (splay_tree_compare_ints, 0, 0); = splay_tree_new (splay_tree_compare_ints, 0, 0);
@ -2717,17 +2716,16 @@ init_alias_analysis (void)
optimization. Loop unrolling can create a large number of optimization. Loop unrolling can create a large number of
registers. */ registers. */
reg_base_value_size = maxreg * 2; reg_base_value_size = maxreg * 2;
reg_base_value = (rtx *) ggc_alloc_cleared (reg_base_value_size reg_base_value = ggc_alloc_cleared (reg_base_value_size * sizeof (rtx));
* sizeof (rtx));
new_reg_base_value = (rtx *) xmalloc (reg_base_value_size * sizeof (rtx)); new_reg_base_value = xmalloc (reg_base_value_size * sizeof (rtx));
reg_seen = (char *) xmalloc (reg_base_value_size); reg_seen = xmalloc (reg_base_value_size);
if (! reload_completed && flag_old_unroll_loops) if (! reload_completed && flag_old_unroll_loops)
{ {
/* ??? Why are we realloc'ing if we're just going to zero it? */ /* ??? Why are we realloc'ing if we're just going to zero it? */
alias_invariant = (rtx *)xrealloc (alias_invariant, alias_invariant = xrealloc (alias_invariant,
reg_base_value_size * sizeof (rtx)); reg_base_value_size * sizeof (rtx));
memset ((char *)alias_invariant, 0, 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 /* The basic idea is that each pass through this loop will use the
@ -2764,10 +2762,10 @@ init_alias_analysis (void)
copying_arguments = true; copying_arguments = true;
/* Wipe the potential alias information clean for this pass. */ /* 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. */ /* 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. /* Mark all hard registers which may contain an address.
The stack, frame and argument pointers may contain an address. The stack, frame and argument pointers may contain an address.

View File

@ -105,7 +105,7 @@ create_alloc_pool (const char *name, size_t size, size_t num)
pool_size = sizeof (struct alloc_pool_def); pool_size = sizeof (struct alloc_pool_def);
/* and allocate that much memory. */ /* and allocate that much memory. */
pool = (alloc_pool) xmalloc (pool_size); pool = xmalloc (pool_size);
/* Now init the various pieces of our pool structure. */ /* Now init the various pieces of our pool structure. */
pool->name = xstrdup (name); pool->name = xstrdup (name);
@ -176,7 +176,7 @@ pool_alloc (alloc_pool pool)
alloc_pool_list block_header; alloc_pool_list block_header;
/* Make the block. */ /* Make the block. */
block = (char *) xmalloc (pool->block_size); block = xmalloc (pool->block_size);
block_header = (alloc_pool_list) block; block_header = (alloc_pool_list) block;
block += align_eight (sizeof (struct alloc_pool_list_def)); block += align_eight (sizeof (struct alloc_pool_list_def));

View File

@ -131,8 +131,7 @@ bitmap_element_allocate (bitmap head)
obstack_chunk_free); obstack_chunk_free);
} }
element = (bitmap_element *) obstack_alloc (&bitmap_obstack, element = obstack_alloc (&bitmap_obstack, sizeof (bitmap_element));
sizeof (bitmap_element));
} }
} }
else else

View File

@ -128,7 +128,7 @@ extern int bitmap_last_set_bit (bitmap);
/* Allocate a bitmap with oballoc. */ /* Allocate a bitmap with oballoc. */
#define BITMAP_OBSTACK_ALLOC(OBSTACK) \ #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. */ /* Allocate a bitmap with ggc_alloc. */
#define BITMAP_GGC_ALLOC() \ #define BITMAP_GGC_ALLOC() \
@ -136,7 +136,7 @@ extern int bitmap_last_set_bit (bitmap);
/* Allocate a bitmap with xmalloc. */ /* Allocate a bitmap with xmalloc. */
#define BITMAP_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. */ /* Do any cleanup needed on a bitmap when it is no longer used. */
#define BITMAP_FREE(BITMAP) \ #define BITMAP_FREE(BITMAP) \

View File

@ -277,9 +277,8 @@ find_btr_def_group (btr_def_group *all_btr_def_groups, btr_def def)
if (!this_group) if (!this_group)
{ {
this_group = (btr_def_group) this_group = obstack_alloc (&migrate_btrl_obstack,
obstack_alloc (&migrate_btrl_obstack, sizeof (struct btr_def_group_s));
sizeof (struct btr_def_group_s));
this_group->src = def_src; this_group->src = def_src;
this_group->members = NULL; this_group->members = NULL;
this_group->next = *all_btr_def_groups; this_group->next = *all_btr_def_groups;
@ -301,8 +300,8 @@ add_btr_def (fibheap_t all_btr_defs, basic_block bb, int insn_luid, rtx insn,
unsigned int dest_reg, int other_btr_uses_before_def, unsigned int dest_reg, int other_btr_uses_before_def,
btr_def_group *all_btr_def_groups) btr_def_group *all_btr_def_groups)
{ {
btr_def this = (btr_def) btr_def this
obstack_alloc (&migrate_btrl_obstack, sizeof (struct btr_def_s)); = obstack_alloc (&migrate_btrl_obstack, sizeof (struct btr_def_s));
this->bb = bb; this->bb = bb;
this->luid = insn_luid; this->luid = insn_luid;
this->insn = insn; this->insn = insn;
@ -353,8 +352,7 @@ new_btr_user (basic_block bb, int insn_luid, rtx insn)
usep = NULL; usep = NULL;
} }
use = usep ? *usep : NULL_RTX; use = usep ? *usep : NULL_RTX;
user = (btr_user) user = obstack_alloc (&migrate_btrl_obstack, sizeof (struct btr_user_s));
obstack_alloc (&migrate_btrl_obstack, sizeof (struct btr_user_s));
user->bb = bb; user->bb = bb;
user->luid = insn_luid; user->luid = insn_luid;
user->insn = insn; user->insn = insn;
@ -736,8 +734,7 @@ build_btr_def_use_webs (fibheap_t all_btr_defs)
sbitmap *btr_defset = sbitmap_vector_alloc ( sbitmap *btr_defset = sbitmap_vector_alloc (
(last_btr - first_btr) + 1, max_uid); (last_btr - first_btr) + 1, max_uid);
sbitmap *bb_gen = sbitmap_vector_alloc (n_basic_blocks, max_uid); sbitmap *bb_gen = sbitmap_vector_alloc (n_basic_blocks, max_uid);
HARD_REG_SET *btrs_written = (HARD_REG_SET *) xcalloc ( HARD_REG_SET *btrs_written = xcalloc (n_basic_blocks, sizeof (HARD_REG_SET));
n_basic_blocks, sizeof (HARD_REG_SET));
sbitmap *bb_kill; sbitmap *bb_kill;
sbitmap *bb_out; sbitmap *bb_out;
@ -841,8 +838,7 @@ augment_live_range (bitmap live_range, HARD_REG_SET *btrs_live_in_range,
{ {
basic_block *worklist, *tos; basic_block *worklist, *tos;
tos = worklist = tos = worklist = xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
(basic_block *) xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
if (dominated_by_p (dom, new_bb, head_bb)) if (dominated_by_p (dom, new_bb, head_bb))
*tos++ = new_bb; *tos++ = new_bb;
@ -1318,8 +1314,7 @@ migrate_btr_defs (enum reg_class btr_class, int allow_callee_save)
first_btr = reg; first_btr = reg;
} }
btrs_live = btrs_live = xcalloc (n_basic_blocks, sizeof (HARD_REG_SET));
(HARD_REG_SET *) xcalloc (n_basic_blocks, sizeof (HARD_REG_SET));
build_btr_def_use_webs (all_btr_defs); build_btr_def_use_webs (all_btr_defs);

View File

@ -1082,7 +1082,7 @@ result_vector (int savep, rtx result)
int regno, size, align, nelts; int regno, size, align, nelts;
enum machine_mode mode; enum machine_mode mode;
rtx reg, mem; rtx reg, mem;
rtx *savevec = (rtx *) alloca (FIRST_PSEUDO_REGISTER * sizeof (rtx)); rtx *savevec = alloca (FIRST_PSEUDO_REGISTER * sizeof (rtx));
size = nelts = 0; size = nelts = 0;
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)

View File

@ -875,12 +875,12 @@ c_expand_start_cond (tree cond, int compstmt_count, tree if_stmt)
if (if_stack_space == 0) if (if_stack_space == 0)
{ {
if_stack_space = 10; 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) else if (if_stack_space == if_stack_pointer)
{ {
if_stack_space += 10; 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; IF_COND (if_stmt) = cond;
@ -1354,7 +1354,7 @@ static struct tlist *
new_tlist (struct tlist *next, tree t, tree writer) new_tlist (struct tlist *next, tree t, tree writer)
{ {
struct tlist *l; struct tlist *l;
l = (struct tlist *) obstack_alloc (&tlist_obstack, sizeof *l); l = obstack_alloc (&tlist_obstack, sizeof *l);
l->next = next; l->next = next;
l->expr = t; l->expr = t;
l->writer = writer; l->writer = writer;
@ -1624,8 +1624,7 @@ verify_tree (tree x, struct tlist **pbefore_sp, struct tlist **pno_sp,
if (! t) if (! t)
{ {
t = (struct tlist_cache *) obstack_alloc (&tlist_obstack, t = obstack_alloc (&tlist_obstack, sizeof *t);
sizeof *t);
t->next = save_expr_cache; t->next = save_expr_cache;
t->expr = x; t->expr = x;
save_expr_cache = t; save_expr_cache = t;
@ -4313,7 +4312,7 @@ c_expand_builtin_printf (tree arglist, rtx target, enum machine_mode tmode,
/* Create a NULL-terminated string that's one char shorter /* Create a NULL-terminated string that's one char shorter
than the original, stripping off the trailing '\n'. */ than the original, stripping off the trailing '\n'. */
const int newlen = TREE_STRING_LENGTH (stripped_string) - 1; 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); memcpy (newstr, TREE_STRING_POINTER (stripped_string), newlen - 1);
newstr[newlen - 1] = 0; newstr[newlen - 1] = 0;
@ -4877,7 +4876,7 @@ handle_mode_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED,
if (len > 4 && p[0] == '_' && p[1] == '_' if (len > 4 && p[0] == '_' && p[1] == '_'
&& p[len - 1] == '_' && p[len - 2] == '_') && p[len - 1] == '_' && p[len - 2] == '_')
{ {
char *newp = (char *) alloca (len - 1); char *newp = alloca (len - 1);
strcpy (newp, &p[2]); strcpy (newp, &p[2]);
newp[len - 4] = '\0'; newp[len - 4] = '\0';

View File

@ -360,8 +360,7 @@ make_binding_level (void)
memset (result, 0, sizeof(struct binding_level)); memset (result, 0, sizeof(struct binding_level));
} }
else else
result = (struct binding_level *) result = ggc_alloc_cleared (sizeof (struct binding_level));
ggc_alloc_cleared (sizeof (struct binding_level));
return result; return result;
} }
@ -1732,8 +1731,7 @@ pushdecl (tree x)
/* Functions need the lang_decl data. */ /* Functions need the lang_decl data. */
if (TREE_CODE (x) == FUNCTION_DECL && ! DECL_LANG_SPECIFIC (x)) if (TREE_CODE (x) == FUNCTION_DECL && ! DECL_LANG_SPECIFIC (x))
DECL_LANG_SPECIFIC (x) = (struct lang_decl *) DECL_LANG_SPECIFIC (x) = ggc_alloc_cleared (sizeof (struct lang_decl));
ggc_alloc_cleared (sizeof (struct lang_decl));
/* A local extern declaration for a function doesn't constitute nesting. /* A local extern declaration for a function doesn't constitute nesting.
A local auto declaration does, since it's a forward decl A local auto declaration does, since it's a forward decl
@ -4375,8 +4373,8 @@ grokdeclarator (tree declarator, tree declspecs,
decl = build_decl (FUNCTION_DECL, declarator, type); decl = build_decl (FUNCTION_DECL, declarator, type);
decl = build_decl_attribute_variant (decl, decl_attr); decl = build_decl_attribute_variant (decl, decl_attr);
DECL_LANG_SPECIFIC (decl) = (struct lang_decl *) DECL_LANG_SPECIFIC (decl)
ggc_alloc_cleared (sizeof (struct lang_decl)); = ggc_alloc_cleared (sizeof (struct lang_decl));
if (pedantic && type_quals && ! DECL_IN_SYSTEM_HEADER (decl)) if (pedantic && type_quals && ! DECL_IN_SYSTEM_HEADER (decl))
pedwarn ("ISO C forbids qualified function types"); pedwarn ("ISO C forbids qualified function types");
@ -6630,8 +6628,7 @@ void
c_push_function_context (struct function *f) c_push_function_context (struct function *f)
{ {
struct language_function *p; struct language_function *p;
p = ((struct language_function *) p = ggc_alloc (sizeof (struct language_function));
ggc_alloc (sizeof (struct language_function)));
f->language = p; f->language = p;
p->base.x_stmt_tree = c_stmt_tree; p->base.x_stmt_tree = c_stmt_tree;
@ -6694,9 +6691,8 @@ c_dup_lang_specific_decl (tree decl)
if (!DECL_LANG_SPECIFIC (decl)) if (!DECL_LANG_SPECIFIC (decl))
return; return;
ld = (struct lang_decl *) ggc_alloc (sizeof (struct lang_decl)); ld = ggc_alloc (sizeof (struct lang_decl));
memcpy ((char *) ld, (char *) DECL_LANG_SPECIFIC (decl), memcpy (ld, DECL_LANG_SPECIFIC (decl), sizeof (struct lang_decl));
sizeof (struct lang_decl));
DECL_LANG_SPECIFIC (decl) = ld; DECL_LANG_SPECIFIC (decl) = ld;
} }
@ -6943,7 +6939,7 @@ merge_translation_unit_decls (void)
if (TREE_PUBLIC (decl) && DECL_EXTERNAL (decl)) if (TREE_PUBLIC (decl) && DECL_EXTERNAL (decl))
{ {
tree global_decl; tree global_decl;
global_decl = (tree) htab_find (link_hash_table, decl); global_decl = htab_find (link_hash_table, decl);
if (! global_decl) if (! global_decl)
continue; continue;
@ -6967,7 +6963,7 @@ c_write_global_declarations(void)
{ {
tree globals = BLOCK_VARS (DECL_INITIAL (link)); tree globals = BLOCK_VARS (DECL_INITIAL (link));
int len = list_length (globals); int len = list_length (globals);
tree *vec = (tree *) xmalloc (sizeof (tree) * len); tree *vec = xmalloc (sizeof (tree) * len);
int i; int i;
tree decl; tree decl;

View File

@ -306,7 +306,7 @@ add_path (char *path, int chain, int cxx_aware)
{ {
struct cpp_path *p; struct cpp_path *p;
p = (struct cpp_path *) xmalloc (sizeof (struct cpp_path)); p = xmalloc (sizeof (struct cpp_path));
p->next = NULL; p->next = NULL;
p->name = path; p->name = path;
if (chain == SYSTEM || chain == AFTER) if (chain == SYSTEM || chain == AFTER)

View File

@ -123,7 +123,7 @@ get_fileinfo (const char *name)
if (n) if (n)
return (struct c_fileinfo *) n->value; 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->time = 0;
fi->interface_only = 0; fi->interface_only = 0;
fi->interface_unknown = 1; fi->interface_unknown = 1;

View File

@ -220,8 +220,7 @@ c_common_init_options (unsigned int argc, const char **argv ATTRIBUTE_UNUSED)
flag_exceptions = c_dialect_cxx (); flag_exceptions = c_dialect_cxx ();
warn_pointer_arith = c_dialect_cxx (); warn_pointer_arith = c_dialect_cxx ();
deferred_opts = (struct deferred_opt *) deferred_opts = xmalloc (argc * sizeof (struct deferred_opt));
xmalloc (argc * sizeof (struct deferred_opt));
result = lang_flags[c_language]; result = lang_flags[c_language];

View File

@ -75,15 +75,13 @@ do { \
newsize = *(YYSSZ) *= 2; \ newsize = *(YYSSZ) *= 2; \
if (malloced_yyss) \ if (malloced_yyss) \
{ \ { \
newss = (short *) \ newss = really_call_realloc (*(SS), newsize * sizeof (short)); \
really_call_realloc (*(SS), newsize * sizeof (short)); \ newvs = really_call_realloc (*(VS), newsize * sizeof (YYSTYPE)); \
newvs = (YYSTYPE *) \
really_call_realloc (*(VS), newsize * sizeof (YYSTYPE)); \
} \ } \
else \ else \
{ \ { \
newss = (short *) really_call_malloc (newsize * sizeof (short)); \ newss = really_call_malloc (newsize * sizeof (short)); \
newvs = (YYSTYPE *) really_call_malloc (newsize * sizeof (YYSTYPE)); \ newvs = really_call_malloc (newsize * sizeof (YYSTYPE)); \
if (newss) \ if (newss) \
memcpy (newss, *(SS), (SSSIZE)); \ memcpy (newss, *(SS), (SSSIZE)); \
if (newvs) \ if (newvs) \
@ -3524,7 +3522,7 @@ init_reswords (void)
if (!c_dialect_objc ()) if (!c_dialect_objc ())
mask |= D_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++) for (i = 0; i < N_reswords; i++)
{ {
/* If a keyword is disabled, do not enter it into the table /* If a keyword is disabled, do not enter it into the table

View File

@ -74,7 +74,7 @@ push_alignment (int alignment, tree id)
{ {
align_stack * entry; align_stack * entry;
entry = (align_stack *) ggc_alloc (sizeof (* entry)); entry = ggc_alloc (sizeof (* entry));
entry->alignment = alignment; entry->alignment = alignment;
entry->num_pushes = 1; entry->num_pushes = 1;

View File

@ -3617,9 +3617,8 @@ warn_for_assignment (const char *msgid, const char *opname, tree function,
{ {
/* Function name is known; supply it. */ /* Function name is known; supply it. */
const char *const argstring = _("passing arg of `%s'"); const char *const argstring = _("passing arg of `%s'");
new_opname = (char *) alloca (IDENTIFIER_LENGTH (function) new_opname = alloca (IDENTIFIER_LENGTH (function)
+ strlen (argstring) + 1 + strlen (argstring) + 1 + 1);
+ 1);
sprintf (new_opname, argstring, sprintf (new_opname, argstring,
IDENTIFIER_POINTER (function)); IDENTIFIER_POINTER (function));
} }
@ -3627,7 +3626,7 @@ warn_for_assignment (const char *msgid, const char *opname, tree function,
{ {
/* Function name unknown (call through ptr). */ /* Function name unknown (call through ptr). */
const char *const argnofun = _("passing arg of pointer to function"); 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); sprintf (new_opname, argnofun);
} }
} }
@ -3635,9 +3634,8 @@ warn_for_assignment (const char *msgid, const char *opname, tree function,
{ {
/* Function name is known; supply it. */ /* Function name is known; supply it. */
const char *const argstring = _("passing arg %d of `%s'"); const char *const argstring = _("passing arg %d of `%s'");
new_opname = (char *) alloca (IDENTIFIER_LENGTH (function) new_opname = alloca (IDENTIFIER_LENGTH (function)
+ strlen (argstring) + 1 + 25 + strlen (argstring) + 1 + 25 /*%d*/ + 1);
/*%d*/ + 1);
sprintf (new_opname, argstring, argnum, sprintf (new_opname, argstring, argnum,
IDENTIFIER_POINTER (function)); IDENTIFIER_POINTER (function));
} }
@ -3645,7 +3643,7 @@ warn_for_assignment (const char *msgid, const char *opname, tree function,
{ {
/* Function name unknown (call through ptr); just give arg number. */ /* Function name unknown (call through ptr); just give arg number. */
const char *const argnofun = _("passing arg %d of pointer to function"); 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); sprintf (new_opname, argnofun, argnum);
} }
opname = new_opname; opname = new_opname;
@ -3777,12 +3775,10 @@ static int spelling_size; /* Size of the spelling stack. */
{ \ { \
spelling_size += 10; \ spelling_size += 10; \
if (spelling_base == 0) \ if (spelling_base == 0) \
spelling_base \ spelling_base = xmalloc (spelling_size * sizeof (struct spelling)); \
= (struct spelling *) xmalloc (spelling_size * sizeof (struct spelling)); \
else \ else \
spelling_base \ spelling_base = xrealloc (spelling_base, \
= (struct spelling *) xrealloc (spelling_base, \ spelling_size * sizeof (struct spelling)); \
spelling_size * sizeof (struct spelling)); \
RESTORE_SPELLING_DEPTH (depth); \ RESTORE_SPELLING_DEPTH (depth); \
} \ } \
\ \
@ -3872,7 +3868,7 @@ error_init (const char *msgid)
char *ofwhat; char *ofwhat;
error ("%s", _(msgid)); error ("%s", _(msgid));
ofwhat = print_spelling ((char *) alloca (spelling_length () + 1)); ofwhat = print_spelling (alloca (spelling_length () + 1));
if (*ofwhat) if (*ofwhat)
error ("(near initialization for `%s')", ofwhat); error ("(near initialization for `%s')", ofwhat);
} }
@ -3887,7 +3883,7 @@ pedwarn_init (const char *msgid)
char *ofwhat; char *ofwhat;
pedwarn ("%s", _(msgid)); pedwarn ("%s", _(msgid));
ofwhat = print_spelling ((char *) alloca (spelling_length () + 1)); ofwhat = print_spelling (alloca (spelling_length () + 1));
if (*ofwhat) if (*ofwhat)
pedwarn ("(near initialization for `%s')", ofwhat); pedwarn ("(near initialization for `%s')", ofwhat);
} }
@ -3902,7 +3898,7 @@ warning_init (const char *msgid)
char *ofwhat; char *ofwhat;
warning ("%s", _(msgid)); warning ("%s", _(msgid));
ofwhat = print_spelling ((char *) alloca (spelling_length () + 1)); ofwhat = print_spelling (alloca (spelling_length () + 1));
if (*ofwhat) if (*ofwhat)
warning ("(near initialization for `%s')", ofwhat); warning ("(near initialization for `%s')", ofwhat);
} }
@ -4286,8 +4282,7 @@ void
start_init (tree decl, tree asmspec_tree, int top_level) start_init (tree decl, tree asmspec_tree, int top_level)
{ {
const char *locus; const char *locus;
struct initializer_stack *p struct initializer_stack *p = xmalloc (sizeof (struct initializer_stack));
= (struct initializer_stack *) xmalloc (sizeof (struct initializer_stack));
const char *asmspec = 0; const char *asmspec = 0;
if (asmspec_tree) if (asmspec_tree)
@ -4387,8 +4382,7 @@ finish_init (void)
void void
really_start_incremental_init (tree type) really_start_incremental_init (tree type)
{ {
struct constructor_stack *p struct constructor_stack *p = xmalloc (sizeof (struct constructor_stack));
= (struct constructor_stack *) xmalloc (sizeof (struct constructor_stack));
if (type == 0) if (type == 0)
type = TREE_TYPE (constructor_decl); type = TREE_TYPE (constructor_decl);
@ -4524,7 +4518,7 @@ push_init_level (int implicit)
value = find_init_member (constructor_index); 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->type = constructor_type;
p->fields = constructor_fields; p->fields = constructor_fields;
p->index = constructor_index; p->index = constructor_index;
@ -4908,8 +4902,7 @@ push_range_stack (tree range_end)
{ {
struct constructor_range_stack *p; struct constructor_range_stack *p;
p = (struct constructor_range_stack *) p = ggc_alloc (sizeof (struct constructor_range_stack));
ggc_alloc (sizeof (struct constructor_range_stack));
p->prev = constructor_range_stack; p->prev = constructor_range_stack;
p->next = 0; p->next = 0;
p->fields = constructor_fields; p->fields = constructor_fields;
@ -5081,7 +5074,7 @@ add_pending_init (tree purpose, tree value)
} }
} }
r = (struct init_node *) ggc_alloc (sizeof (struct init_node)); r = ggc_alloc (sizeof (struct init_node));
r->purpose = purpose; r->purpose = purpose;
r->value = value; r->value = value;
@ -6183,7 +6176,7 @@ c_expand_asm_operands (tree string, tree outputs, tree inputs,
int noutputs = list_length (outputs); int noutputs = list_length (outputs);
int i; int i;
/* o[I] is the place that output number I should be written. */ /* 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; tree tail;
/* Record the contents of OUTPUTS before it is modified. */ /* Record the contents of OUTPUTS before it is modified. */
@ -6381,7 +6374,7 @@ c_start_case (tree exp)
} }
/* Add this new SWITCH_STMT to the stack. */ /* 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->switch_stmt = build_stmt (SWITCH_STMT, exp, NULL_TREE, orig_type);
cs->cases = splay_tree_new (case_compare, NULL, NULL); cs->cases = splay_tree_new (case_compare, NULL, NULL);
cs->next = switch_stack; cs->next = switch_stack;

View File

@ -942,8 +942,7 @@ store_unaligned_arguments_into_pseudos (struct arg_data *args, int num_actuals)
int endian_correction = 0; int endian_correction = 0;
args[i].n_aligned_regs = args[i].partial ? args[i].partial : nregs; args[i].n_aligned_regs = args[i].partial ? args[i].partial : nregs;
args[i].aligned_regs = (rtx *) xmalloc (sizeof (rtx) args[i].aligned_regs = xmalloc (sizeof (rtx) * args[i].n_aligned_regs);
* args[i].n_aligned_regs);
/* Structures smaller than a word are normally aligned to the /* Structures smaller than a word are normally aligned to the
least significant byte. On a BYTES_BIG_ENDIAN machine, least significant byte. On a BYTES_BIG_ENDIAN machine,
@ -2367,8 +2366,8 @@ expand_call (tree exp, rtx target, int ignore)
INIT_CUMULATIVE_ARGS (args_so_far, funtype, NULL_RTX, fndecl); INIT_CUMULATIVE_ARGS (args_so_far, funtype, NULL_RTX, fndecl);
/* Make a vector to hold all the information about each arg. */ /* Make a vector to hold all the information about each arg. */
args = (struct arg_data *) alloca (num_actuals * sizeof (struct arg_data)); args = alloca (num_actuals * sizeof (struct arg_data));
memset ((char *) args, 0, 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 /* Build up entries in the ARGS array, compute the size of the
arguments into ARGS_SIZE, etc. */ arguments into ARGS_SIZE, etc. */
@ -2758,8 +2757,7 @@ expand_call (tree exp, rtx target, int ignore)
highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use, highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use,
needed); needed);
#endif #endif
stack_usage_map stack_usage_map = alloca (highest_outgoing_arg_in_use);
= (char *) alloca (highest_outgoing_arg_in_use);
if (initial_highest_arg_in_use) if (initial_highest_arg_in_use)
memcpy (stack_usage_map, initial_stack_usage_map, memcpy (stack_usage_map, initial_stack_usage_map,
@ -2864,8 +2862,7 @@ expand_call (tree exp, rtx target, int ignore)
= stack_arg_under_construction; = stack_arg_under_construction;
stack_arg_under_construction = 0; stack_arg_under_construction = 0;
/* Make a new map for the new argument list. */ /* Make a new map for the new argument list. */
stack_usage_map = (char *) stack_usage_map = alloca (highest_outgoing_arg_in_use);
alloca (highest_outgoing_arg_in_use);
memset (stack_usage_map, 0, highest_outgoing_arg_in_use); memset (stack_usage_map, 0, highest_outgoing_arg_in_use);
highest_outgoing_arg_in_use = 0; highest_outgoing_arg_in_use = 0;
} }
@ -3659,8 +3656,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
of the full argument passing conventions to limit complexity here since of the full argument passing conventions to limit complexity here since
library functions shouldn't have many args. */ library functions shouldn't have many args. */
argvec = (struct arg *) alloca ((nargs + 1) * sizeof (struct arg)); argvec = alloca ((nargs + 1) * sizeof (struct arg));
memset ((char *) argvec, 0, (nargs + 1) * sizeof (struct arg)); memset (argvec, 0, (nargs + 1) * sizeof (struct arg));
#ifdef INIT_CUMULATIVE_LIBCALL_ARGS #ifdef INIT_CUMULATIVE_LIBCALL_ARGS
INIT_CUMULATIVE_LIBCALL_ARGS (args_so_far, outmode, fun); INIT_CUMULATIVE_LIBCALL_ARGS (args_so_far, outmode, fun);
@ -3895,7 +3892,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use, highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use,
needed); needed);
#endif #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) if (initial_highest_arg_in_use)
memcpy (stack_usage_map, initial_stack_usage_map, memcpy (stack_usage_map, initial_stack_usage_map,

View File

@ -155,7 +155,7 @@ init_flow (void)
if (!initialized) if (!initialized)
{ {
gcc_obstack_init (&flow_obstack); gcc_obstack_init (&flow_obstack);
flow_firstobj = (char *) obstack_alloc (&flow_obstack, 0); flow_firstobj = obstack_alloc (&flow_obstack, 0);
initialized = 1; initialized = 1;
} }
else else
@ -163,7 +163,7 @@ init_flow (void)
free_alloc_pool (bb_pool); free_alloc_pool (bb_pool);
free_alloc_pool (edge_pool); free_alloc_pool (edge_pool);
obstack_free (&flow_obstack, flow_firstobj); 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", bb_pool = create_alloc_pool ("Basic block pool",
sizeof (struct basic_block_def), 100); sizeof (struct basic_block_def), 100);
@ -697,7 +697,7 @@ alloc_aux_for_blocks (int size)
/* Check whether AUX data are still allocated. */ /* Check whether AUX data are still allocated. */
else if (first_block_aux_obj) else if (first_block_aux_obj)
abort (); abort ();
first_block_aux_obj = (char *) obstack_alloc (&block_aux_obstack, 0); first_block_aux_obj = obstack_alloc (&block_aux_obstack, 0);
if (size) if (size)
{ {
basic_block bb; basic_block bb;
@ -763,7 +763,7 @@ alloc_aux_for_edges (int size)
else if (first_edge_aux_obj) else if (first_edge_aux_obj)
abort (); abort ();
first_edge_aux_obj = (char *) obstack_alloc (&edge_aux_obstack, 0); first_edge_aux_obj = obstack_alloc (&edge_aux_obstack, 0);
if (size) if (size)
{ {
basic_block bb; basic_block bb;
@ -819,9 +819,8 @@ verify_flow_info (void)
basic_block bb, last_bb_seen; basic_block bb, last_bb_seen;
basic_block *last_visited; basic_block *last_visited;
last_visited = (basic_block *) xcalloc (last_basic_block + 2, last_visited = xcalloc (last_basic_block + 2, sizeof (basic_block));
sizeof (basic_block)); edge_checksum = xcalloc (last_basic_block + 2, sizeof (size_t));
edge_checksum = (size_t *) xcalloc (last_basic_block + 2, sizeof (size_t));
/* Check bb chain & numbers. */ /* Check bb chain & numbers. */
last_bb_seen = ENTRY_BLOCK_PTR; last_bb_seen = ENTRY_BLOCK_PTR;

View File

@ -139,11 +139,11 @@ mark_dfs_back_edges (void)
bool found = false; bool found = false;
/* Allocate the preorder and postorder number arrays. */ /* Allocate the preorder and postorder number arrays. */
pre = (int *) xcalloc (last_basic_block, sizeof (int)); pre = xcalloc (last_basic_block, sizeof (int));
post = (int *) xcalloc (last_basic_block, sizeof (int)); post = xcalloc (last_basic_block, sizeof (int));
/* Allocate stack for back-tracking up CFG. */ /* 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; sp = 0;
/* Allocate bitmap to track nodes that have been visited. */ /* Allocate bitmap to track nodes that have been visited. */
@ -402,8 +402,7 @@ find_unreachable_blocks (void)
edge e; edge e;
basic_block *tos, *worklist, bb; basic_block *tos, *worklist, bb;
tos = worklist = tos = worklist = xmalloc (sizeof (basic_block) * n_basic_blocks);
(basic_block *) xmalloc (sizeof (basic_block) * n_basic_blocks);
/* Clear all the reachability flags. */ /* Clear all the reachability flags. */
@ -473,10 +472,10 @@ create_edge_list (void)
num_edges++; num_edges++;
} }
elist = (struct edge_list *) xmalloc (sizeof (struct edge_list)); elist = xmalloc (sizeof (struct edge_list));
elist->num_blocks = block_count; elist->num_blocks = block_count;
elist->num_edges = num_edges; 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; num_edges = 0;
@ -735,7 +734,7 @@ flow_reverse_top_sort_order_compute (int *rts_order)
sbitmap visited; sbitmap visited;
/* Allocate stack for back-tracking up CFG. */ /* 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; sp = 0;
/* Allocate bitmap to track nodes that have been visited. */ /* Allocate bitmap to track nodes that have been visited. */
@ -804,7 +803,7 @@ flow_depth_first_order_compute (int *dfs_order, int *rc_order)
sbitmap visited; sbitmap visited;
/* Allocate stack for back-tracking up CFG. */ /* 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; sp = 0;
/* Allocate bitmap to track nodes that have been visited. */ /* Allocate bitmap to track nodes that have been visited. */
@ -909,12 +908,11 @@ flow_preorder_transversal_compute (int *pot_order)
basic_block bb; basic_block bb;
/* Allocate stack for back-tracking up CFG. */ /* 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; sp = 0;
/* Allocate the tree. */ /* Allocate the tree. */
dfst = (struct dfst_node *) xcalloc (last_basic_block, dfst = xcalloc (last_basic_block, sizeof (struct dfst_node));
sizeof (struct dfst_node));
FOR_EACH_BB (bb) FOR_EACH_BB (bb)
{ {
@ -924,9 +922,7 @@ flow_preorder_transversal_compute (int *pot_order)
dfst[bb->index].node dfst[bb->index].node
= (max_successors = (max_successors
? (struct dfst_node **) xcalloc (max_successors, ? xcalloc (max_successors, sizeof (struct dfst_node *)) : NULL);
sizeof (struct dfst_node *))
: NULL);
} }
/* Allocate bitmap to track nodes that have been visited. */ /* Allocate bitmap to track nodes that have been visited. */
@ -1038,8 +1034,8 @@ static void
flow_dfs_compute_reverse_init (depth_first_search_ds data) flow_dfs_compute_reverse_init (depth_first_search_ds data)
{ {
/* Allocate stack for back-tracking up CFG. */ /* Allocate stack for back-tracking up CFG. */
data->stack = (basic_block *) xmalloc ((n_basic_blocks - (INVALID_BLOCK + 1)) data->stack = xmalloc ((n_basic_blocks - (INVALID_BLOCK + 1))
* sizeof (basic_block)); * sizeof (basic_block));
data->sp = 0; data->sp = 0;
/* Allocate bitmap to track nodes that have been visited. */ /* Allocate bitmap to track nodes that have been visited. */

View File

@ -241,7 +241,7 @@ flow_loop_entry_edges_find (struct loop *loop)
if (! num_entries) if (! num_entries)
abort (); abort ();
loop->entry_edges = (edge *) xmalloc (num_entries * sizeof (edge *)); loop->entry_edges = xmalloc (num_entries * sizeof (edge *));
num_entries = 0; num_entries = 0;
for (e = loop->header->pred; e; e = e->pred_next) for (e = loop->header->pred; e; e = e->pred_next)
@ -288,7 +288,7 @@ flow_loop_exit_edges_find (struct loop *loop)
return; 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. */ /* Store all exiting edges into an array. */
num_exits = 0; num_exits = 0;
@ -322,7 +322,7 @@ flow_loop_nodes_find (basic_block header, struct loop *loop)
if (loop->latch->loop_father != loop) 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; sp = 0;
num_nodes++; num_nodes++;
stack[sp++] = loop->latch; stack[sp++] = loop->latch;
@ -380,7 +380,7 @@ flow_loop_pre_header_scan (struct loop *loop)
num++) num++)
ebb = ebb->pred->src; 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; loop->num_pre_header_edges = num;
/* Store edges in order that they are followed. The source of the first edge /* Store edges in order that they are followed. The source of the first edge
@ -817,7 +817,7 @@ flow_loops_find (struct loops *loops, int flags)
} }
/* Allocate loop structures. */ /* 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. */ /* Dummy loop containing whole function. */
loops->parray[0] = xcalloc (1, sizeof (struct loop)); loops->parray[0] = xcalloc (1, sizeof (struct loop));
@ -844,8 +844,8 @@ flow_loops_find (struct loops *loops, int flags)
{ {
/* Compute depth first search order of the CFG so that outer /* Compute depth first search order of the CFG so that outer
natural loops will be found before inner natural loops. */ natural loops will be found before inner natural loops. */
dfs_order = (int *) xmalloc (n_basic_blocks * sizeof (int)); dfs_order = xmalloc (n_basic_blocks * sizeof (int));
rc_order = (int *) xmalloc (n_basic_blocks * sizeof (int)); rc_order = xmalloc (n_basic_blocks * sizeof (int));
flow_depth_first_order_compute (dfs_order, rc_order); flow_depth_first_order_compute (dfs_order, rc_order);
/* Save CFG derived information to avoid recomputing it. */ /* Save CFG derived information to avoid recomputing it. */

View File

@ -1721,12 +1721,9 @@ print_rtl_with_bb (FILE *outf, rtx rtx_first)
{ {
enum bb_state { NOT_IN_BB, IN_ONE_BB, IN_MULTIPLE_BB }; enum bb_state { NOT_IN_BB, IN_ONE_BB, IN_MULTIPLE_BB };
int max_uid = get_max_uid (); int max_uid = get_max_uid ();
basic_block *start basic_block *start = xcalloc (max_uid, sizeof (basic_block));
= (basic_block *) xcalloc (max_uid, sizeof (basic_block)); basic_block *end = xcalloc (max_uid, sizeof (basic_block));
basic_block *end enum bb_state *in_bb_p = xcalloc (max_uid, sizeof (enum bb_state));
= (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 bb; basic_block bb;
@ -1832,7 +1829,7 @@ rtl_verify_flow_info_1 (void)
int err = 0; int err = 0;
basic_block bb, last_bb_seen; 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. */ /* Check bb chain & numbers. */
last_bb_seen = ENTRY_BLOCK_PTR; last_bb_seen = ENTRY_BLOCK_PTR;

View File

@ -689,7 +689,7 @@ add_prefix (struct path_prefix *pprefix, const char *prefix)
if (len > pprefix->max_len) if (len > pprefix->max_len)
pprefix->max_len = len; pprefix->max_len = len;
pl = (struct prefix_list *) xmalloc (sizeof (struct prefix_list)); pl = xmalloc (sizeof (struct prefix_list));
pl->prefix = xstrdup (prefix); pl->prefix = xstrdup (prefix);
if (*prev) if (*prev)
@ -716,7 +716,7 @@ static void
prefix_from_string (const char *p, struct path_prefix *pprefix) prefix_from_string (const char *p, struct path_prefix *pprefix)
{ {
const char *startp, *endp; const char *startp, *endp;
char *nstore = (char *) xmalloc (strlen (p) + 3); char *nstore = xmalloc (strlen (p) + 3);
if (debug) if (debug)
fprintf (stderr, "Convert string '%s' into prefixes, separator = '%c'\n", p, PATH_SEPARATOR); fprintf (stderr, "Convert string '%s' into prefixes, separator = '%c'\n", p, PATH_SEPARATOR);
@ -838,9 +838,9 @@ main (int argc, char **argv)
/* Do not invoke xcalloc before this point, since locale needs to be /* Do not invoke xcalloc before this point, since locale needs to be
set first, in case a diagnostic is issued. */ set first, in case a diagnostic is issued. */
ld1 = (const char **)(ld1_argv = (char **) xcalloc(sizeof (char *), argc+3)); ld1 = (const char **)(ld1_argv = xcalloc(sizeof (char *), argc+3));
ld2 = (const char **)(ld2_argv = (char **) xcalloc(sizeof (char *), argc+10)); ld2 = (const char **)(ld2_argv = xcalloc(sizeof (char *), argc+10));
object = (const char **)(object_lst = (char **) xcalloc(sizeof (char *), argc)); object = (const char **)(object_lst = xcalloc(sizeof (char *), argc));
#ifdef DEBUG #ifdef DEBUG
debug = 1; debug = 1;
@ -865,7 +865,7 @@ main (int argc, char **argv)
#endif #endif
obstack_begin (&temporary_obstack, 0); 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; current_demangling_style = auto_demangling;
p = getenv ("COLLECT_GCC_OPTIONS"); p = getenv ("COLLECT_GCC_OPTIONS");
@ -880,8 +880,7 @@ main (int argc, char **argv)
/* -fno-exceptions -w */ /* -fno-exceptions -w */
num_c_args += 2; num_c_args += 2;
c_ptr = (const char **) c_ptr = (const char **) (c_argv = xcalloc (sizeof (char *), num_c_args));
(c_argv = (char **) xcalloc (sizeof (char *), num_c_args));
if (argc < 2) if (argc < 2)
fatal ("no arguments"); fatal ("no arguments");
@ -1337,7 +1336,7 @@ main (int argc, char **argv)
/* Strip now if it was requested on the command line. */ /* Strip now if it was requested on the command line. */
if (strip_flag) 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; const char ** strip_argv = (const char **) real_strip_argv;
strip_argv[0] = strip_file_name; strip_argv[0] = strip_file_name;
@ -1579,8 +1578,7 @@ static long sequence_number = 0;
static void static void
add_to_list (struct head *head_ptr, const char *name) add_to_list (struct head *head_ptr, const char *name)
{ {
struct id *newid struct id *newid = xcalloc (sizeof (struct id) + strlen (name), 1);
= (struct id *) xcalloc (sizeof (struct id) + strlen (name), 1);
struct id *p; struct id *p;
strcpy (newid->name, name); strcpy (newid->name, name);
@ -2278,7 +2276,7 @@ locatelib (const char *name)
cnt++; cnt++;
q = xstrdup (p); q = xstrdup (p);
} }
l = (const char **) xmalloc ((cnt + 3) * sizeof (char *)); l = xmalloc ((cnt + 3) * sizeof (char *));
pp = l; pp = l;
if (ldr) if (ldr)
{ {

View File

@ -456,7 +456,7 @@ do_SUBST (rtx *into, rtx newval)
if (undobuf.frees) if (undobuf.frees)
buf = undobuf.frees, undobuf.frees = buf->next; buf = undobuf.frees, undobuf.frees = buf->next;
else else
buf = (struct undo *) xmalloc (sizeof (struct undo)); buf = xmalloc (sizeof (struct undo));
buf->is_int = 0; buf->is_int = 0;
buf->where.r = into; buf->where.r = into;
@ -484,7 +484,7 @@ do_SUBST_INT (int *into, int newval)
if (undobuf.frees) if (undobuf.frees)
buf = undobuf.frees, undobuf.frees = buf->next; buf = undobuf.frees, undobuf.frees = buf->next;
else else
buf = (struct undo *) xmalloc (sizeof (struct undo)); buf = xmalloc (sizeof (struct undo));
buf->is_int = 1; buf->is_int = 1;
buf->where.i = into; buf->where.i = into;
@ -520,23 +520,18 @@ combine_instructions (rtx f, unsigned int nregs)
combine_max_regno = nregs; combine_max_regno = nregs;
reg_nonzero_bits = ((unsigned HOST_WIDE_INT *) reg_nonzero_bits = xcalloc (nregs, sizeof (unsigned HOST_WIDE_INT));
xcalloc (nregs, sizeof (unsigned HOST_WIDE_INT))); reg_sign_bit_copies = xcalloc (nregs, sizeof (unsigned char));
reg_sign_bit_copies
= (unsigned char *) xcalloc (nregs, sizeof (unsigned char));
reg_last_death = (rtx *) xmalloc (nregs * sizeof (rtx)); reg_last_death = xmalloc (nregs * sizeof (rtx));
reg_last_set = (rtx *) xmalloc (nregs * sizeof (rtx)); reg_last_set = xmalloc (nregs * sizeof (rtx));
reg_last_set_value = (rtx *) xmalloc (nregs * sizeof (rtx)); reg_last_set_value = xmalloc (nregs * sizeof (rtx));
reg_last_set_table_tick = (int *) xmalloc (nregs * sizeof (int)); reg_last_set_table_tick = xmalloc (nregs * sizeof (int));
reg_last_set_label = (int *) xmalloc (nregs * sizeof (int)); reg_last_set_label = xmalloc (nregs * sizeof (int));
reg_last_set_invalid = (char *) xmalloc (nregs * sizeof (char)); reg_last_set_invalid = xmalloc (nregs * sizeof (char));
reg_last_set_mode reg_last_set_mode = xmalloc (nregs * sizeof (enum machine_mode));
= (enum machine_mode *) xmalloc (nregs * sizeof (enum machine_mode)); reg_last_set_nonzero_bits = xmalloc (nregs * sizeof (HOST_WIDE_INT));
reg_last_set_nonzero_bits reg_last_set_sign_bit_copies = xmalloc (nregs * sizeof (char));
= (unsigned HOST_WIDE_INT *) xmalloc (nregs * sizeof (HOST_WIDE_INT));
reg_last_set_sign_bit_copies
= (char *) xmalloc (nregs * sizeof (char));
init_reg_last_arrays (); init_reg_last_arrays ();
@ -548,7 +543,7 @@ combine_instructions (rtx f, unsigned int nregs)
if (INSN_UID (insn) > i) if (INSN_UID (insn) > i)
i = INSN_UID (insn); i = INSN_UID (insn);
uid_cuid = (int *) xmalloc ((i + 1) * sizeof (int)); uid_cuid = xmalloc ((i + 1) * sizeof (int));
max_uid_cuid = i; max_uid_cuid = i;
nonzero_bits_mode = mode_for_size (HOST_BITS_PER_WIDE_INT, MODE_INT, 0); nonzero_bits_mode = mode_for_size (HOST_BITS_PER_WIDE_INT, MODE_INT, 0);
@ -788,14 +783,14 @@ init_reg_last_arrays (void)
{ {
unsigned int nregs = combine_max_regno; unsigned int nregs = combine_max_regno;
memset ((char *) reg_last_death, 0, nregs * sizeof (rtx)); memset (reg_last_death, 0, nregs * sizeof (rtx));
memset ((char *) reg_last_set, 0, nregs * sizeof (rtx)); memset (reg_last_set, 0, nregs * sizeof (rtx));
memset ((char *) reg_last_set_value, 0, nregs * sizeof (rtx)); memset (reg_last_set_value, 0, nregs * sizeof (rtx));
memset ((char *) reg_last_set_table_tick, 0, nregs * sizeof (int)); memset (reg_last_set_table_tick, 0, nregs * sizeof (int));
memset ((char *) reg_last_set_label, 0, nregs * sizeof (int)); memset (reg_last_set_label, 0, nregs * sizeof (int));
memset (reg_last_set_invalid, 0, nregs * sizeof (char)); memset (reg_last_set_invalid, 0, nregs * sizeof (char));
memset ((char *) reg_last_set_mode, 0, nregs * sizeof (enum machine_mode)); memset (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_nonzero_bits, 0, nregs * sizeof (HOST_WIDE_INT));
memset (reg_last_set_sign_bit_copies, 0, nregs * sizeof (char)); memset (reg_last_set_sign_bit_copies, 0, nregs * sizeof (char));
} }

View File

@ -148,8 +148,7 @@ arc_eq (const void *arcp1, const void *arcp2)
conflict_graph conflict_graph
conflict_graph_new (int num_regs) conflict_graph_new (int num_regs)
{ {
conflict_graph graph conflict_graph graph = xmalloc (sizeof (struct conflict_graph_def));
= (conflict_graph) xmalloc (sizeof (struct conflict_graph_def));
graph->num_regs = num_regs; graph->num_regs = num_regs;
/* Set up the hash table. No delete action is specified; memory /* Set up the hash table. No delete action is specified; memory
@ -161,8 +160,7 @@ conflict_graph_new (int num_regs)
obstack_init (&graph->arc_obstack); obstack_init (&graph->arc_obstack);
/* Create and zero the lookup table by register number. */ /* Create and zero the lookup table by register number. */
graph->neighbor_heads graph->neighbor_heads = xmalloc (num_regs * sizeof (conflict_graph_arc));
= (conflict_graph_arc *) xmalloc (num_regs * sizeof (conflict_graph_arc));
memset (graph->neighbor_heads, 0, num_regs * sizeof (conflict_graph_arc)); memset (graph->neighbor_heads, 0, num_regs * sizeof (conflict_graph_arc));
return graph; return graph;
@ -206,8 +204,7 @@ conflict_graph_add (conflict_graph graph, int reg1, int reg2)
/* Allocate an arc. */ /* Allocate an arc. */
arc arc
= (conflict_graph_arc) = obstack_alloc (&graph->arc_obstack,
obstack_alloc (&graph->arc_obstack,
sizeof (struct conflict_graph_arc_def)); sizeof (struct conflict_graph_arc_def));
/* Record the reg numbers. */ /* Record the reg numbers. */

View File

@ -888,12 +888,12 @@ coverage_init (const char *filename)
int len = strlen (filename); int len = strlen (filename);
/* Name of da file. */ /* 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); strcpy (da_file_name, filename);
strcat (da_file_name, GCOV_DATA_SUFFIX); strcat (da_file_name, GCOV_DATA_SUFFIX);
/* Name of bbg file. */ /* 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); strcpy (bbg_file_name, filename);
strcat (bbg_file_name, GCOV_NOTE_SUFFIX); strcat (bbg_file_name, GCOV_NOTE_SUFFIX);

View File

@ -966,8 +966,7 @@ _cpp_expand_op_stack (cpp_reader *pfile)
size_t old_size = (size_t) (pfile->op_limit - pfile->op_stack); size_t old_size = (size_t) (pfile->op_limit - pfile->op_stack);
size_t new_size = old_size * 2 + 20; size_t new_size = old_size * 2 + 20;
pfile->op_stack = (struct op *) xrealloc (pfile->op_stack, pfile->op_stack = xrealloc (pfile->op_stack, new_size * sizeof (struct op));
new_size * sizeof (struct op));
pfile->op_limit = pfile->op_stack + new_size; pfile->op_limit = pfile->op_stack + new_size;
return pfile->op_stack + old_size; return pfile->op_stack + old_size;

View File

@ -459,7 +459,7 @@ read_include_file (cpp_reader *pfile, struct include_file *inc)
size = inc->st.st_size; size = inc->st.st_size;
{ {
buf = (uchar *) xmalloc (size + 1); buf = xmalloc (size + 1);
offset = 0; offset = 0;
while (offset < size) while (offset < size)
{ {
@ -494,7 +494,7 @@ read_include_file (cpp_reader *pfile, struct include_file *inc)
bigger than the majority of C source files. */ bigger than the majority of C source files. */
size = 8 * 1024; size = 8 * 1024;
buf = (uchar *) xmalloc (size + 1); buf = xmalloc (size + 1);
offset = 0; offset = 0;
while ((count = read (inc->fd, buf + offset, size - offset)) > 0) while ((count = read (inc->fd, buf + offset, size - offset)) > 0)
{ {
@ -553,7 +553,7 @@ cpp_included (cpp_reader *pfile, const char *fname)
} }
/* Search directory path for the file. */ /* 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) for (path = pfile->quote_include; path; path = path->next)
{ {
memcpy (name, path->name, path->len); memcpy (name, path->name, path->len);
@ -611,7 +611,7 @@ find_include_file (cpp_reader *pfile, const char *fname, int angle_brackets,
} }
/* Search directory path for the file. */ /* 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) for (; path; path = path->next)
{ {
int len = path->len; int len = path->len;
@ -924,14 +924,13 @@ read_name_map (cpp_reader *pfile, const char *dirname)
if (! strcmp (map_list_ptr->map_list_name, dirname)) if (! strcmp (map_list_ptr->map_list_name, dirname))
return map_list_ptr->map_list_map; return map_list_ptr->map_list_map;
map_list_ptr = ((struct file_name_map_list *) map_list_ptr = xmalloc (sizeof (struct file_name_map_list));
xmalloc (sizeof (struct file_name_map_list)));
map_list_ptr->map_list_name = xstrdup (dirname); map_list_ptr->map_list_name = xstrdup (dirname);
/* The end of the list ends in NULL. */ /* The end of the list ends in NULL. */
map_list_ptr->map_list_map = 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); strcpy (name, dirname);
if (*dirname) if (*dirname)
strcat (name, "/"); strcat (name, "/");
@ -955,8 +954,7 @@ read_name_map (cpp_reader *pfile, const char *dirname)
; ;
to = read_filename_string (ch, f); to = read_filename_string (ch, f);
ptr = ((struct file_name_map *) ptr = xmalloc (sizeof (struct file_name_map));
xmalloc (sizeof (struct file_name_map)));
ptr->map_from = from; ptr->map_from = from;
/* Make the real filename absolute. */ /* Make the real filename absolute. */
@ -1025,7 +1023,7 @@ remap_filename (cpp_reader *pfile, char *name, struct cpp_path *loc)
if (p == name) if (p == name)
cpp_error (pfile, DL_ICE, "absolute file name in remap_filename"); 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); memcpy (dir, name, p - name);
dir[p - name] = '\0'; dir[p - name] = '\0';
from = p + 1; from = p + 1;

View File

@ -37,8 +37,7 @@ alloc_node (hash_table *table)
{ {
cpp_hashnode *node; cpp_hashnode *node;
node = (cpp_hashnode *) obstack_alloc (&table->pfile->hash_ob, node = obstack_alloc (&table->pfile->hash_ob, sizeof (cpp_hashnode));
sizeof (cpp_hashnode));
memset (node, 0, sizeof (cpp_hashnode)); memset (node, 0, sizeof (cpp_hashnode));
return node; return node;
} }

View File

@ -130,7 +130,7 @@ cpp_create_reader (enum c_lang lang, hash_table *table)
/* Initialize this instance of the library if it hasn't been already. */ /* Initialize this instance of the library if it hasn't been already. */
init_library (); init_library ();
pfile = (cpp_reader *) xcalloc (1, sizeof (cpp_reader)); pfile = xcalloc (1, sizeof (cpp_reader));
cpp_set_lang (pfile, lang); cpp_set_lang (pfile, lang);
CPP_OPTION (pfile, warn_import) = 1; CPP_OPTION (pfile, warn_import) = 1;

View File

@ -88,8 +88,8 @@ add_line_note (cpp_buffer *buffer, const uchar *pos, unsigned int type)
if (buffer->notes_used == buffer->notes_cap) if (buffer->notes_used == buffer->notes_cap)
{ {
buffer->notes_cap = buffer->notes_cap * 2 + 200; buffer->notes_cap = buffer->notes_cap * 2 + 200;
buffer->notes = (_cpp_line_note *) buffer->notes = xrealloc (buffer->notes,
xrealloc (buffer->notes, buffer->notes_cap * sizeof (_cpp_line_note)); buffer->notes_cap * sizeof (_cpp_line_note));
} }
buffer->notes[buffer->notes_used].pos = pos; buffer->notes[buffer->notes_used].pos = pos;

View File

@ -1805,7 +1805,7 @@ cpp_define (cpp_reader *pfile, const char *str)
tack " 1" on the end. */ tack " 1" on the end. */
count = strlen (str); count = strlen (str);
buf = (char *) alloca (count + 3); buf = alloca (count + 3);
memcpy (buf, str, count); memcpy (buf, str, count);
p = strchr (str, '='); p = strchr (str, '=');
@ -1866,7 +1866,7 @@ handle_assertion (cpp_reader *pfile, const char *str, int type)
/* Copy the entire option so we can modify it. Change the first /* Copy the entire option so we can modify it. Change the first
"=" in the string to a '(', and tack a ')' on the end. */ "=" 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); memcpy (buf, str, count);
if (p) if (p)

View File

@ -414,7 +414,7 @@ paste_tokens (cpp_reader *pfile, const cpp_token **plhs, const cpp_token *rhs)
lhs = *plhs; lhs = *plhs;
len = cpp_token_len (lhs) + cpp_token_len (rhs) + 1; 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); end = cpp_spell_token (pfile, lhs, buf);
/* Avoid comment headers, since they are still processed in stage 3. /* Avoid comment headers, since they are still processed in stage 3.
@ -991,8 +991,7 @@ expand_arg (cpp_reader *pfile, macro_arg *arg)
/* Loop, reading in the arguments. */ /* Loop, reading in the arguments. */
capacity = 256; capacity = 256;
arg->expanded = (const cpp_token **) arg->expanded = xmalloc (capacity * sizeof (cpp_token *));
xmalloc (capacity * sizeof (cpp_token *));
push_ptoken_context (pfile, NULL, NULL, arg->first, arg->count + 1); push_ptoken_context (pfile, NULL, NULL, arg->first, arg->count + 1);
for (;;) for (;;)
@ -1002,8 +1001,8 @@ expand_arg (cpp_reader *pfile, macro_arg *arg)
if (arg->expanded_count + 1 >= capacity) if (arg->expanded_count + 1 >= capacity)
{ {
capacity *= 2; capacity *= 2;
arg->expanded = (const cpp_token **) arg->expanded = xrealloc (arg->expanded,
xrealloc (arg->expanded, capacity * sizeof (cpp_token *)); capacity * sizeof (cpp_token *));
} }
token = cpp_get_token (pfile); token = cpp_get_token (pfile);
@ -1257,7 +1256,7 @@ _cpp_save_parameter (cpp_reader *pfile, cpp_macro *macro, cpp_hashnode *node)
len = macro->paramc * sizeof (union _cpp_hashnode_value); len = macro->paramc * sizeof (union _cpp_hashnode_value);
if (len > pfile->macro_buffer_len) 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; pfile->macro_buffer_len = len;
} }
((union _cpp_hashnode_value *) pfile->macro_buffer)[macro->paramc - 1] ((union _cpp_hashnode_value *) pfile->macro_buffer)[macro->paramc - 1]
@ -1648,7 +1647,7 @@ cpp_macro_definition (cpp_reader *pfile, const cpp_hashnode *node)
if (len > pfile->macro_buffer_len) 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; pfile->macro_buffer_len = len;
} }

View File

@ -172,7 +172,7 @@ lang_specific_driver (int *in_argc, const char *const **in_argv,
return; return;
/* One more slot for a terminating null. */ /* 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]; new_argv[0] = argv[0];
j = 1; j = 1;

View File

@ -107,8 +107,7 @@ check_output_buffer (cpp_reader *pfile, size_t n)
size_t size = pfile->out.cur - pfile->out.base; size_t size = pfile->out.cur - pfile->out.base;
size_t new_size = (size + n) * 3 / 2; size_t new_size = (size + n) * 3 / 2;
pfile->out.base pfile->out.base = xrealloc (pfile->out.base, new_size);
= (uchar *) xrealloc (pfile->out.base, new_size);
pfile->out.limit = pfile->out.base + new_size; pfile->out.limit = pfile->out.base + new_size;
pfile->out.cur = pfile->out.base + size; pfile->out.cur = pfile->out.base + size;
} }

View File

@ -929,7 +929,7 @@ get_cse_reg_info (unsigned int regno)
cse_reg_info_free_list = p->next; cse_reg_info_free_list = p->next;
} }
else else
p = (struct cse_reg_info *) xmalloc (sizeof (struct cse_reg_info)); p = xmalloc (sizeof (struct cse_reg_info));
/* Insert into hash table. */ /* Insert into hash table. */
p->hash_next = *hash_head; p->hash_next = *hash_head;
@ -967,7 +967,7 @@ new_basic_block (void)
/* Clear out hash table state for this pass. */ /* 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) if (cse_reg_info_used_list)
{ {
@ -1540,7 +1540,7 @@ insert (rtx x, struct table_elt *classp, unsigned int hash, enum machine_mode mo
else else
{ {
n_elements_made++; n_elements_made++;
elt = (struct table_elt *) xmalloc (sizeof (struct table_elt)); elt = xmalloc (sizeof (struct table_elt));
} }
elt->exp = x; elt->exp = x;
@ -4693,7 +4693,7 @@ cse_insn (rtx insn, rtx libcall_insn)
if (GET_CODE (x) == SET) if (GET_CODE (x) == SET)
{ {
sets = (struct set *) alloca (sizeof (struct set)); sets = alloca (sizeof (struct set));
sets[0].rtl = x; sets[0].rtl = x;
/* Ignore SETs that are unconditional jumps. /* Ignore SETs that are unconditional jumps.
@ -4728,7 +4728,7 @@ cse_insn (rtx insn, rtx libcall_insn)
{ {
int lim = XVECLEN (x, 0); 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, /* Find all regs explicitly clobbered in this insn,
and ensure they are not replaced with any other regs and ensure they are not replaced with any other regs
@ -6940,8 +6940,7 @@ cse_main (rtx f, int nregs, int after_loop, FILE *file)
max_insn_uid = get_max_uid (); max_insn_uid = get_max_uid ();
reg_eqv_table = (struct reg_eqv_elem *) reg_eqv_table = xmalloc (nregs * sizeof (struct reg_eqv_elem));
xmalloc (nregs * sizeof (struct reg_eqv_elem));
#ifdef LOAD_EXTEND_OP #ifdef LOAD_EXTEND_OP
@ -6957,7 +6956,7 @@ cse_main (rtx f, int nregs, int after_loop, FILE *file)
/* Find the largest uid. */ /* Find the largest uid. */
max_uid = get_max_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. /* Compute the mapping from uids to cuids.
CUIDs are numbers assigned to insns, like uids, CUIDs are numbers assigned to insns, like uids,
@ -7076,9 +7075,7 @@ cse_basic_block (rtx from, rtx to, struct branch_path *next_branch,
/* This array is undefined before max_reg, so only allocate /* This array is undefined before max_reg, so only allocate
the space actually needed and adjust the start. */ the space actually needed and adjust the start. */
qty_table qty_table = xmalloc ((max_qty - max_reg) * sizeof (struct qty_table_elem));
= (struct qty_table_elem *) xmalloc ((max_qty - max_reg)
* sizeof (struct qty_table_elem));
qty_table -= max_reg; qty_table -= max_reg;
new_basic_block (); new_basic_block ();
@ -7537,7 +7534,7 @@ delete_trivially_dead_insns (rtx insns, int nreg)
timevar_push (TV_DELETE_TRIVIALLY_DEAD); timevar_push (TV_DELETE_TRIVIALLY_DEAD);
/* First count the number of times each register is used. */ /* 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)) for (insn = next_real_insn (insns); insn; insn = next_real_insn (insn))
count_reg_usage (insn, counts, NULL_RTX, 1); count_reg_usage (insn, counts, NULL_RTX, 1);

View File

@ -147,7 +147,7 @@ new_elt_list (struct elt_list *next, cselib_val *elt)
if (el) if (el)
empty_elt_lists = el->next; empty_elt_lists = el->next;
else else
el = (struct elt_list *) ggc_alloc (sizeof (struct elt_list)); el = ggc_alloc (sizeof (struct elt_list));
el->next = next; el->next = next;
el->elt = elt; el->elt = elt;
return el; return el;
@ -164,7 +164,7 @@ new_elt_loc_list (struct elt_loc_list *next, rtx loc)
if (el) if (el)
empty_elt_loc_lists = el->next; empty_elt_loc_lists = el->next;
else 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->next = next;
el->loc = loc; el->loc = loc;
el->setting_insn = cselib_current_insn; el->setting_insn = cselib_current_insn;
@ -704,7 +704,7 @@ new_cselib_val (unsigned int value, enum machine_mode mode)
if (e) if (e)
empty_vals = e->u.next_free; empty_vals = e->u.next_free;
else else
e = (cselib_val *) ggc_alloc (sizeof (cselib_val)); e = ggc_alloc (sizeof (cselib_val));
if (value == 0) if (value == 0)
abort (); abort ();

View File

@ -459,7 +459,7 @@ dbxout_init (const char *input_file_name)
asmfile = asm_out_file; asmfile = asm_out_file;
typevec_len = 100; 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 /* Convert Ltext into the appropriate format for local labels in case
the system doesn't insert underscores in front of user generated the system doesn't insert underscores in front of user generated
@ -513,7 +513,7 @@ dbxout_init (const char *input_file_name)
next_type_number = 1; next_type_number = 1;
#ifdef DBX_USE_BINCL #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->next = NULL;
current_file->file_number = 0; current_file->file_number = 0;
current_file->next_type_number = 1; current_file->next_type_number = 1;
@ -626,7 +626,7 @@ dbxout_start_source_file (unsigned int line ATTRIBUTE_UNUSED,
const char *filename ATTRIBUTE_UNUSED) const char *filename ATTRIBUTE_UNUSED)
{ {
#ifdef DBX_USE_BINCL #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 = current_file;
n->next_type_number = 1; n->next_type_number = 1;
@ -1262,11 +1262,8 @@ dbxout_type (tree type, int full)
if (next_type_number == typevec_len) if (next_type_number == typevec_len)
{ {
typevec typevec
= (struct typeinfo *) ggc_realloc (typevec, = ggc_realloc (typevec, (typevec_len * 2 * sizeof typevec[0]));
(typevec_len * 2 memset (typevec + typevec_len, 0, typevec_len * sizeof typevec[0]);
* sizeof typevec[0]));
memset ((char *) (typevec + typevec_len), 0,
typevec_len * sizeof typevec[0]);
typevec_len *= 2; typevec_len *= 2;
} }

View File

@ -66,7 +66,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef ASM_FORMAT_PRIVATE_NAME #ifndef ASM_FORMAT_PRIVATE_NAME
# define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \ # define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
do { const char *const name_ = (NAME); \ 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)); \ sprintf (output_, ASM_PN_FORMAT, name_, (unsigned long)(LABELNO)); \
} while (0) } while (0)
#endif #endif

View File

@ -316,8 +316,7 @@ df_insn_table_realloc (struct df *df, unsigned int size)
to enlarge it so often. */ to enlarge it so often. */
size += df->insn_size / 4; size += df->insn_size / 4;
df->insns = (struct insn_info *) df->insns = xrealloc (df->insns, size * sizeof (struct insn_info));
xrealloc (df->insns, size * sizeof (struct insn_info));
memset (df->insns + df->insn_size, 0, memset (df->insns + df->insn_size, 0,
(size - df->insn_size) * sizeof (struct insn_info)); (size - df->insn_size) * sizeof (struct insn_info));
@ -344,8 +343,7 @@ df_reg_table_realloc (struct df *df, int size)
if (size < max_reg_num ()) if (size < max_reg_num ())
size = max_reg_num (); size = max_reg_num ();
df->regs = (struct reg_info *) df->regs = xrealloc (df->regs, size * sizeof (struct reg_info));
xrealloc (df->regs, size * sizeof (struct reg_info));
/* Zero the new entries. */ /* Zero the new entries. */
memset (df->regs + df->reg_size, 0, memset (df->regs + df->reg_size, 0,

View File

@ -133,10 +133,10 @@ void debug_dominance_info (dominance_info);
{ \ { \
unsigned int i = 1; /* Catch content == i. */ \ unsigned int i = 1; /* Catch content == i. */ \
if (! (content)) \ if (! (content)) \
(var) = (type *) xcalloc ((num), sizeof (type)); \ (var) = xcalloc ((num), sizeof (type)); \
else \ else \
{ \ { \
(var) = (type *) xmalloc ((num) * sizeof (type)); \ (var) = xmalloc ((num) * sizeof (type)); \
for (i = 0; i < num; i++) \ for (i = 0; i < num; i++) \
(var)[i] = (content); \ (var)[i] = (content); \
} \ } \
@ -212,7 +212,7 @@ calc_dfs_tree_nonrec (struct dom_info *di, basic_block bb, enum cdi_direction re
/* Ending block. */ /* Ending block. */
basic_block ex_block; basic_block ex_block;
stack = (edge *) xmalloc ((n_basic_blocks + 3) * sizeof (edge)); stack = xmalloc ((n_basic_blocks + 3) * sizeof (edge));
sp = 0; sp = 0;
/* Initialize our border blocks, and the first edge. */ /* Initialize our border blocks, and the first edge. */

View File

@ -553,7 +553,7 @@ dwarf_cfi_name (unsigned int cfi_opc)
static inline dw_cfi_ref static inline dw_cfi_ref
new_cfi (void) 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_next = NULL;
cfi->dw_cfi_oprnd1.dw_cfi_reg_num = 0; cfi->dw_cfi_oprnd1.dw_cfi_reg_num = 0;
@ -2248,8 +2248,7 @@ void
dwarf2out_frame_init (void) dwarf2out_frame_init (void)
{ {
/* Allocate the initial hunk of the fde_table. */ /* Allocate the initial hunk of the fde_table. */
fde_table = (dw_fde_ref) ggc_alloc_cleared (FDE_TABLE_INCREMENT fde_table = ggc_alloc_cleared (FDE_TABLE_INCREMENT * sizeof (dw_fde_node));
* sizeof (dw_fde_node));
fde_table_allocated = FDE_TABLE_INCREMENT; fde_table_allocated = FDE_TABLE_INCREMENT;
fde_table_in_use = 0; fde_table_in_use = 0;
@ -2719,8 +2718,7 @@ static inline dw_loc_descr_ref
new_loc_descr (enum dwarf_location_atom op, long unsigned int oprnd1, new_loc_descr (enum dwarf_location_atom op, long unsigned int oprnd1,
long unsigned int oprnd2) long unsigned int oprnd2)
{ {
dw_loc_descr_ref descr dw_loc_descr_ref descr = ggc_alloc_cleared (sizeof (dw_loc_descr_node));
= (dw_loc_descr_ref) ggc_alloc_cleared (sizeof (dw_loc_descr_node));
descr->dw_loc_opc = op; descr->dw_loc_opc = op;
descr->dw_loc_oprnd1.val_class = dw_val_class_unsigned_const; descr->dw_loc_oprnd1.val_class = dw_val_class_unsigned_const;
@ -4444,7 +4442,7 @@ AT_class (dw_attr_ref a)
static inline void static inline void
add_AT_flag (dw_die_ref die, enum dwarf_attribute attr_kind, unsigned int flag) 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_next = NULL;
attr->dw_attr = attr_kind; attr->dw_attr = attr_kind;
@ -4467,7 +4465,7 @@ AT_flag (dw_attr_ref a)
static inline void static inline void
add_AT_int (dw_die_ref die, enum dwarf_attribute attr_kind, long int int_val) 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_next = NULL;
attr->dw_attr = attr_kind; attr->dw_attr = attr_kind;
@ -4491,7 +4489,7 @@ static inline void
add_AT_unsigned (dw_die_ref die, enum dwarf_attribute attr_kind, add_AT_unsigned (dw_die_ref die, enum dwarf_attribute attr_kind,
long unsigned int unsigned_val) 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_next = NULL;
attr->dw_attr = attr_kind; attr->dw_attr = attr_kind;
@ -4515,7 +4513,7 @@ static inline void
add_AT_long_long (dw_die_ref die, enum dwarf_attribute 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) 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_next = NULL;
attr->dw_attr = attr_kind; attr->dw_attr = attr_kind;
@ -4531,7 +4529,7 @@ static inline void
add_AT_float (dw_die_ref die, enum dwarf_attribute attr_kind, add_AT_float (dw_die_ref die, enum dwarf_attribute attr_kind,
unsigned int length, long int *array) 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_next = NULL;
attr->dw_attr = attr_kind; attr->dw_attr = attr_kind;
@ -4561,7 +4559,7 @@ debug_str_eq (const void *x1, const void *x2)
static inline void static inline void
add_AT_string (dw_die_ref die, enum dwarf_attribute attr_kind, const char *str) 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; struct indirect_string_node *node;
void **slot; void **slot;
@ -4638,7 +4636,7 @@ AT_string_form (dw_attr_ref a)
static inline void static inline void
add_AT_die_ref (dw_die_ref die, enum dwarf_attribute attr_kind, dw_die_ref targ_die) 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_next = NULL;
attr->dw_attr = attr_kind; attr->dw_attr = attr_kind;
@ -4680,7 +4678,7 @@ set_AT_ref_external (dw_attr_ref a, int i)
static inline void static inline void
add_AT_fde_ref (dw_die_ref die, enum dwarf_attribute attr_kind, unsigned int targ_fde) 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_next = NULL;
attr->dw_attr = attr_kind; attr->dw_attr = attr_kind;
@ -4694,7 +4692,7 @@ add_AT_fde_ref (dw_die_ref die, enum dwarf_attribute attr_kind, unsigned int tar
static inline void static inline void
add_AT_loc (dw_die_ref die, enum dwarf_attribute attr_kind, dw_loc_descr_ref loc) 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_next = NULL;
attr->dw_attr = attr_kind; attr->dw_attr = attr_kind;
@ -4715,7 +4713,7 @@ AT_loc (dw_attr_ref a)
static inline void static inline void
add_AT_loc_list (dw_die_ref die, enum dwarf_attribute attr_kind, dw_loc_list_ref loc_list) 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_next = NULL;
attr->dw_attr = attr_kind; attr->dw_attr = attr_kind;
@ -4739,7 +4737,7 @@ AT_loc_list (dw_attr_ref a)
static inline void static inline void
add_AT_addr (dw_die_ref die, enum dwarf_attribute attr_kind, rtx addr) 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_next = NULL;
attr->dw_attr = attr_kind; attr->dw_attr = attr_kind;
@ -4762,7 +4760,7 @@ AT_addr (dw_attr_ref a)
static inline void static inline void
add_AT_lbl_id (dw_die_ref die, enum dwarf_attribute attr_kind, const char *lbl_id) 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_next = NULL;
attr->dw_attr = attr_kind; attr->dw_attr = attr_kind;
@ -4776,7 +4774,7 @@ add_AT_lbl_id (dw_die_ref die, enum dwarf_attribute attr_kind, const char *lbl_i
static inline void static inline void
add_AT_lbl_offset (dw_die_ref die, enum dwarf_attribute attr_kind, const char *label) 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_next = NULL;
attr->dw_attr = attr_kind; attr->dw_attr = attr_kind;
@ -4790,7 +4788,7 @@ add_AT_lbl_offset (dw_die_ref die, enum dwarf_attribute attr_kind, const char *l
static inline void static inline void
add_AT_offset (dw_die_ref die, enum dwarf_attribute attr_kind, long unsigned int offset) 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_next = NULL;
attr->dw_attr = attr_kind; attr->dw_attr = attr_kind;
@ -4805,7 +4803,7 @@ static void
add_AT_range_list (dw_die_ref die, enum dwarf_attribute attr_kind, add_AT_range_list (dw_die_ref die, enum dwarf_attribute attr_kind,
long unsigned int offset) 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_next = NULL;
attr->dw_attr = attr_kind; attr->dw_attr = attr_kind;
@ -5089,7 +5087,7 @@ splice_child_die (dw_die_ref parent, dw_die_ref child)
static inline dw_die_ref static inline dw_die_ref
new_die (enum dwarf_tag tag_value, dw_die_ref parent_die, tree t) 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; die->die_tag = tag_value;
@ -5153,7 +5151,7 @@ equate_decl_number_to_die (tree decl, dw_die_ref decl_die)
decl_die_table = ggc_realloc (decl_die_table, decl_die_table = ggc_realloc (decl_die_table,
sizeof (dw_die_ref) * num_allocated); 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)); (num_allocated - decl_die_table_allocated) * sizeof (dw_die_ref));
decl_die_table_allocated = num_allocated; decl_die_table_allocated = num_allocated;
} }
@ -5663,7 +5661,7 @@ compute_section_prefix (dw_die_ref unit_die)
{ {
const char *die_name = get_AT_string (unit_die, DW_AT_name); const char *die_name = get_AT_string (unit_die, DW_AT_name);
const char *base = die_name ? lbasename (die_name) : "anonymous"; const char *base = die_name ? lbasename (die_name) : "anonymous";
char *name = (char *) alloca (strlen (base) + 64); char *name = alloca (strlen (base) + 64);
char *p; char *p;
int i, mark; int i, mark;
unsigned char checksum[16]; unsigned char checksum[16];
@ -6054,7 +6052,7 @@ build_abbrev_table (dw_die_ref die)
abbrev_die_table = ggc_realloc (abbrev_die_table, abbrev_die_table = ggc_realloc (abbrev_die_table,
sizeof (dw_die_ref) * n_alloc); 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)); (n_alloc - abbrev_die_table_allocated) * sizeof (dw_die_ref));
abbrev_die_table_allocated = n_alloc; abbrev_die_table_allocated = n_alloc;
} }
@ -6724,7 +6722,7 @@ output_comp_unit (dw_die_ref die, int output_if_empty)
oldsym = die->die_symbol; oldsym = die->die_symbol;
if (oldsym) if (oldsym)
{ {
tmp = (char *) alloca (strlen (oldsym) + 24); tmp = alloca (strlen (oldsym) + 24);
sprintf (tmp, ".gnu.linkonce.wi.%s", oldsym); sprintf (tmp, ".gnu.linkonce.wi.%s", oldsym);
secname = tmp; secname = tmp;
@ -6771,9 +6769,8 @@ add_pubname (tree decl, dw_die_ref die)
{ {
pubname_table_allocated += PUBNAME_TABLE_INCREMENT; pubname_table_allocated += PUBNAME_TABLE_INCREMENT;
pubname_table pubname_table
= (pubname_ref) ggc_realloc (pubname_table, = ggc_realloc (pubname_table,
(pubname_table_allocated (pubname_table_allocated * sizeof (pubname_entry)));
* sizeof (pubname_entry)));
memset (pubname_table + pubname_table_in_use, 0, memset (pubname_table + pubname_table_in_use, 0,
PUBNAME_TABLE_INCREMENT * sizeof (pubname_entry)); PUBNAME_TABLE_INCREMENT * sizeof (pubname_entry));
} }
@ -6932,9 +6929,9 @@ add_ranges (tree block)
if (in_use == ranges_table_allocated) if (in_use == ranges_table_allocated)
{ {
ranges_table_allocated += RANGES_TABLE_INCREMENT; ranges_table_allocated += RANGES_TABLE_INCREMENT;
ranges_table = (dw_ranges_ref) ranges_table
ggc_realloc (ranges_table, (ranges_table_allocated = ggc_realloc (ranges_table, (ranges_table_allocated
* sizeof (struct dw_ranges_struct))); * sizeof (struct dw_ranges_struct)));
memset (ranges_table + ranges_table_in_use, 0, memset (ranges_table + ranges_table_in_use, 0,
RANGES_TABLE_INCREMENT * sizeof (struct dw_ranges_struct)); RANGES_TABLE_INCREMENT * sizeof (struct dw_ranges_struct));
} }
@ -7084,10 +7081,8 @@ output_file_names (void)
} }
/* Allocate the various arrays we need. */ /* Allocate the various arrays we need. */
files = (struct file_info *) alloca (VARRAY_ACTIVE_SIZE (file_table) files = alloca (VARRAY_ACTIVE_SIZE (file_table) * sizeof (struct file_info));
* sizeof (struct file_info)); dirs = alloca (VARRAY_ACTIVE_SIZE (file_table) * sizeof (struct dir_info));
dirs = (struct dir_info *) alloca (VARRAY_ACTIVE_SIZE (file_table)
* sizeof (struct dir_info));
/* Sort the file names. */ /* Sort the file names. */
for (i = 1; i < VARRAY_ACTIVE_SIZE (file_table); i++) for (i = 1; i < VARRAY_ACTIVE_SIZE (file_table); i++)
@ -7162,8 +7157,8 @@ output_file_names (void)
where we would have to check out every combination of every single where we would have to check out every combination of every single
possible prefix. Instead we use a heuristic which provides nearly optimal possible prefix. Instead we use a heuristic which provides nearly optimal
results in most cases and never is much off. */ results in most cases and never is much off. */
saved = (int *) alloca (ndirs * sizeof (int)); saved = alloca (ndirs * sizeof (int));
savehere = (int *) alloca (ndirs * sizeof (int)); savehere = alloca (ndirs * sizeof (int));
memset (saved, '\0', ndirs * sizeof (saved[0])); memset (saved, '\0', ndirs * sizeof (saved[0]));
for (i = 0; i < ndirs; i++) for (i = 0; i < ndirs; i++)
@ -7220,7 +7215,7 @@ output_file_names (void)
/* We have to emit them in the order they appear in the file_table array /* 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 since the index is used in the debug info generation. To do this
efficiently we generate a back-mapping of the indices first. */ 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++) for (i = 1; i < VARRAY_ACTIVE_SIZE (file_table); i++)
{ {
backmap[files[i].file_idx] = i; backmap[files[i].file_idx] = i;
@ -9092,7 +9087,7 @@ add_const_value_attribute (dw_die_ref die, rtx rtl)
if (GET_MODE_CLASS (mode) == MODE_FLOAT) if (GET_MODE_CLASS (mode) == MODE_FLOAT)
{ {
unsigned length = GET_MODE_SIZE (mode) / 4; 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_TYPE rv;
REAL_VALUE_FROM_CONST_DOUBLE (rv, rtl); REAL_VALUE_FROM_CONST_DOUBLE (rv, rtl);
@ -12213,12 +12208,11 @@ dwarf2out_source_line (unsigned int line, const char *filename)
{ {
separate_line_info_table_allocated += LINE_INFO_TABLE_INCREMENT; separate_line_info_table_allocated += LINE_INFO_TABLE_INCREMENT;
separate_line_info_table 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 separate_line_info_table_allocated
* sizeof (dw_separate_line_info_entry)); * sizeof (dw_separate_line_info_entry));
memset ((separate_line_info_table memset (separate_line_info_table
+ separate_line_info_table_in_use), + separate_line_info_table_in_use,
0, 0,
(LINE_INFO_TABLE_INCREMENT (LINE_INFO_TABLE_INCREMENT
* sizeof (dw_separate_line_info_entry))); * sizeof (dw_separate_line_info_entry)));

View File

@ -3517,8 +3517,8 @@ dienum_push (void)
{ {
pending_siblings_allocated += PENDING_SIBLINGS_INCREMENT; pending_siblings_allocated += PENDING_SIBLINGS_INCREMENT;
pending_sibling_stack pending_sibling_stack
= (unsigned *) xrealloc (pending_sibling_stack, = xrealloc (pending_sibling_stack,
pending_siblings_allocated * sizeof(unsigned)); pending_siblings_allocated * sizeof(unsigned));
} }
pending_siblings++; pending_siblings++;
@ -4406,8 +4406,8 @@ pend_type (tree type)
{ {
pending_types_allocated += PENDING_TYPES_INCREMENT; pending_types_allocated += PENDING_TYPES_INCREMENT;
pending_types_list pending_types_list
= (tree *) xrealloc (pending_types_list, = xrealloc (pending_types_list,
sizeof (tree) * pending_types_allocated); sizeof (tree) * pending_types_allocated);
} }
pending_types_list[pending_types++] = type; pending_types_list[pending_types++] = type;
@ -4533,8 +4533,8 @@ add_incomplete_type (tree type)
{ {
incomplete_types_allocated += INCOMPLETE_TYPES_INCREMENT; incomplete_types_allocated += INCOMPLETE_TYPES_INCREMENT;
incomplete_types_list incomplete_types_list
= (tree *) xrealloc (incomplete_types_list, = xrealloc (incomplete_types_list,
sizeof (tree) * incomplete_types_allocated); sizeof (tree) * incomplete_types_allocated);
} }
incomplete_types_list[incomplete_types++] = type; incomplete_types_list[incomplete_types++] = type;
@ -5851,8 +5851,7 @@ lookup_filename (const char *file_name)
{ {
ft_entries_allocated += FT_ENTRIES_INCREMENT; ft_entries_allocated += FT_ENTRIES_INCREMENT;
filename_table filename_table
= (filename_entry *) = xrealloc (filename_table,
xrealloc (filename_table,
ft_entries_allocated * sizeof (filename_entry)); ft_entries_allocated * sizeof (filename_entry));
} }
@ -6035,23 +6034,19 @@ dwarfout_init (const char *main_input_filename)
/* Allocate the initial hunk of the pending_sibling_stack. */ /* Allocate the initial hunk of the pending_sibling_stack. */
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_allocated = PENDING_SIBLINGS_INCREMENT;
pending_siblings = 1; pending_siblings = 1;
/* Allocate the initial hunk of the filename_table. */ /* Allocate the initial hunk of the filename_table. */
filename_table filename_table = xmalloc (FT_ENTRIES_INCREMENT * sizeof (filename_entry));
= (filename_entry *)
xmalloc (FT_ENTRIES_INCREMENT * sizeof (filename_entry));
ft_entries_allocated = FT_ENTRIES_INCREMENT; ft_entries_allocated = FT_ENTRIES_INCREMENT;
ft_entries = 0; ft_entries = 0;
/* Allocate the initial hunk of the pending_types_list. */ /* Allocate the initial hunk of the pending_types_list. */
pending_types_list pending_types_list = xmalloc (PENDING_TYPES_INCREMENT * sizeof (tree));
= (tree *) xmalloc (PENDING_TYPES_INCREMENT * sizeof (tree));
pending_types_allocated = PENDING_TYPES_INCREMENT; pending_types_allocated = PENDING_TYPES_INCREMENT;
pending_types = 0; pending_types = 0;

View File

@ -772,7 +772,7 @@ gen_rtvec (int n, ...)
if (n == 0) if (n == 0)
return NULL_RTVEC; /* Don't allocate an empty rtvec... */ 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++) for (i = 0; i < n; i++)
vector[i] = va_arg (p, rtx); vector[i] = va_arg (p, rtx);
@ -845,8 +845,8 @@ gen_reg_rtx (enum machine_mode mode)
memset (new + old_size, 0, old_size); memset (new + old_size, 0, old_size);
f->emit->regno_pointer_align = (unsigned char *) new; f->emit->regno_pointer_align = (unsigned char *) new;
new1 = (rtx *) ggc_realloc (f->emit->x_regno_reg_rtx, new1 = ggc_realloc (f->emit->x_regno_reg_rtx,
old_size * 2 * sizeof (rtx)); old_size * 2 * sizeof (rtx));
memset (new1 + old_size, 0, old_size * sizeof (rtx)); memset (new1 + old_size, 0, old_size * sizeof (rtx));
regno_reg_rtx = new1; regno_reg_rtx = new1;
@ -4874,7 +4874,7 @@ start_sequence (void)
free_sequence_stack = tem->next; free_sequence_stack = tem->next;
} }
else else
tem = (struct sequence_stack *) ggc_alloc (sizeof (struct sequence_stack)); tem = ggc_alloc (sizeof (struct sequence_stack));
tem->next = seq_stack; tem->next = seq_stack;
tem->first = first_insn; tem->first = first_insn;
@ -5205,7 +5205,7 @@ init_emit (void)
{ {
struct function *f = cfun; 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; first_insn = NULL;
last_insn = NULL; last_insn = NULL;
seq_rtl_expr = NULL; seq_rtl_expr = NULL;
@ -5222,11 +5222,11 @@ init_emit (void)
f->emit->regno_pointer_align_length = LAST_VIRTUAL_REGISTER + 101; f->emit->regno_pointer_align_length = LAST_VIRTUAL_REGISTER + 101;
f->emit->regno_pointer_align f->emit->regno_pointer_align
= (unsigned char *) ggc_alloc_cleared (f->emit->regno_pointer_align_length = ggc_alloc_cleared (f->emit->regno_pointer_align_length
* sizeof (unsigned char)); * sizeof (unsigned char));
regno_reg_rtx 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. */ /* Put copies of all the hard registers into regno_reg_rtx. */
memcpy (regno_reg_rtx, memcpy (regno_reg_rtx,

View File

@ -458,8 +458,7 @@ init_eh (void)
void void
init_eh_for_function (void) init_eh_for_function (void)
{ {
cfun->eh = (struct eh_status *) cfun->eh = ggc_alloc_cleared (sizeof (struct eh_status));
ggc_alloc_cleared (sizeof (struct eh_status));
} }
/* Start an exception handling region. All instructions emitted /* Start an exception handling region. All instructions emitted
@ -477,7 +476,7 @@ expand_eh_region_start (void)
return; return;
/* Insert a new blank region as a leaf in the tree. */ /* 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; cur_region = cfun->eh->cur_region;
new_region->outer = cur_region; new_region->outer = cur_region;
if (cur_region) if (cur_region)
@ -1158,7 +1157,7 @@ add_ehl_entry (rtx label, struct eh_region *region)
LABEL_PRESERVE_P (label) = 1; LABEL_PRESERVE_P (label) = 1;
entry = (struct ehl_map_entry *) ggc_alloc (sizeof (*entry)); entry = ggc_alloc (sizeof (*entry));
entry->label = label; entry->label = label;
entry->region = region; entry->region = region;
@ -1237,8 +1236,7 @@ current_function_has_exception_handlers (void)
static struct eh_region * static struct eh_region *
duplicate_eh_region_1 (struct eh_region *o, struct inline_remap *map) duplicate_eh_region_1 (struct eh_region *o, struct inline_remap *map)
{ {
struct eh_region *n struct eh_region *n = ggc_alloc_cleared (sizeof (struct eh_region));
= (struct eh_region *) ggc_alloc_cleared (sizeof (struct eh_region));
n->region_number = o->region_number + cfun->eh->last_region_number; n->region_number = o->region_number + cfun->eh->last_region_number;
n->type = o->type; n->type = o->type;
@ -1493,7 +1491,7 @@ add_ttypes_entry (htab_t ttypes_hash, tree type)
{ {
/* Filter value is a 1 based table index. */ /* Filter value is a 1 based table index. */
n = (struct ttypes_filter *) xmalloc (sizeof (*n)); n = xmalloc (sizeof (*n));
n->t = type; n->t = type;
n->filter = VARRAY_ACTIVE_SIZE (cfun->eh->ttype_data) + 1; n->filter = VARRAY_ACTIVE_SIZE (cfun->eh->ttype_data) + 1;
*slot = n; *slot = n;
@ -1521,7 +1519,7 @@ add_ehspec_entry (htab_t ehspec_hash, htab_t ttypes_hash, tree list)
{ {
/* Filter value is a -1 based byte index into a uleb128 buffer. */ /* 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->t = list;
n->filter = -(VARRAY_ACTIVE_SIZE (cfun->eh->ehspec_data) + 1); n->filter = -(VARRAY_ACTIVE_SIZE (cfun->eh->ehspec_data) + 1);
*slot = n; *slot = n;
@ -2187,8 +2185,8 @@ sjlj_build_landing_pads (void)
{ {
struct sjlj_lp_info *lp_info; struct sjlj_lp_info *lp_info;
lp_info = (struct sjlj_lp_info *) xcalloc (cfun->eh->last_region_number + 1, lp_info = xcalloc (cfun->eh->last_region_number + 1,
sizeof (struct sjlj_lp_info)); sizeof (struct sjlj_lp_info));
if (sjlj_find_directly_reachable_regions (lp_info)) if (sjlj_find_directly_reachable_regions (lp_info))
{ {
@ -3108,7 +3106,7 @@ add_action_record (htab_t ar_hash, int filter, int next)
if ((new = *slot) == NULL) 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->offset = VARRAY_ACTIVE_SIZE (cfun->eh->action_record_data) + 1;
new->filter = filter; new->filter = filter;
new->next = next; new->next = next;
@ -3239,8 +3237,7 @@ add_call_site (rtx landing_pad, int action)
if (used >= size) if (used >= size)
{ {
size = (size ? size * 2 : 64); size = (size ? size * 2 : 64);
data = (struct call_site_record *) data = ggc_realloc (data, sizeof (*data) * size);
ggc_realloc (data, sizeof (*data) * size);
cfun->eh->call_site_data = data; cfun->eh->call_site_data = data;
cfun->eh->call_site_data_size = size; cfun->eh->call_site_data_size = size;
} }

View File

@ -2096,8 +2096,8 @@ synth_mult (struct algorithm *alg_out, unsigned HOST_WIDE_INT t,
/* We'll be needing a couple extra algorithm structures now. */ /* We'll be needing a couple extra algorithm structures now. */
alg_in = (struct algorithm *)alloca (sizeof (struct algorithm)); alg_in = alloca (sizeof (struct algorithm));
best_alg = (struct algorithm *)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 /* 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. */ multiplying by the remaining bits and then doing a shift. */

View File

@ -339,7 +339,7 @@ init_expr_once (void)
void void
init_expr (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_chain = 0;
pending_stack_adjust = 0; pending_stack_adjust = 0;
@ -2224,7 +2224,7 @@ gen_group_rtx (rtx orig)
abort (); abort ();
length = XVECLEN (orig, 0); length = XVECLEN (orig, 0);
tmps = (rtx *) alloca (sizeof (rtx) * length); tmps = alloca (sizeof (rtx) * length);
/* Skip a NULL entry in first slot. */ /* Skip a NULL entry in first slot. */
i = XEXP (XVECEXP (orig, 0, 0), 0) ? 0 : 1; i = XEXP (XVECEXP (orig, 0, 0), 0) ? 0 : 1;
@ -2264,7 +2264,7 @@ emit_group_load (rtx dst, rtx orig_src, tree type ATTRIBUTE_UNUSED, int ssize)
else else
start = 1; start = 1;
tmps = (rtx *) alloca (sizeof (rtx) * XVECLEN (dst, 0)); tmps = alloca (sizeof (rtx) * XVECLEN (dst, 0));
/* Process the pieces. */ /* Process the pieces. */
for (i = start; i < XVECLEN (dst, 0); i++) for (i = start; i < XVECLEN (dst, 0); i++)
@ -2421,7 +2421,7 @@ emit_group_store (rtx orig_dst, rtx src, tree type ATTRIBUTE_UNUSED, int ssize)
else else
start = 1; start = 1;
tmps = (rtx *) alloca (sizeof (rtx) * XVECLEN (src, 0)); tmps = alloca (sizeof (rtx) * XVECLEN (src, 0));
/* Copy the (probable) hard regs into pseudos. */ /* Copy the (probable) hard regs into pseudos. */
for (i = start; i < XVECLEN (src, 0); i++) for (i = start; i < XVECLEN (src, 0); i++)
@ -5388,7 +5388,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
{ {
unsigned int set_word_size = TYPE_ALIGN (TREE_TYPE (exp)); unsigned int set_word_size = TYPE_ALIGN (TREE_TYPE (exp));
enum machine_mode mode = mode_for_size (set_word_size, MODE_INT, 1); 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; HOST_WIDE_INT word = 0;
unsigned int bit_pos = 0; unsigned int bit_pos = 0;
unsigned int ibit = 0; unsigned int ibit = 0;

View File

@ -658,8 +658,8 @@ compute_alignments (void)
max_labelno = max_label_num (); max_labelno = max_label_num ();
min_labelno = get_first_label_num (); min_labelno = get_first_label_num ();
label_align = (struct label_alignment *) label_align = xcalloc (max_labelno - min_labelno + 1,
xcalloc (max_labelno - min_labelno + 1, sizeof (struct label_alignment)); sizeof (struct label_alignment));
/* If not optimizing or optimizing for size, don't assign any alignments. */ /* If not optimizing or optimizing for size, don't assign any alignments. */
if (! optimize || optimize_size) if (! optimize || optimize_size)
@ -766,7 +766,7 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED)
/* Compute maximum UID and allocate label_align / uid_shuid. */ /* Compute maximum UID and allocate label_align / uid_shuid. */
max_uid = get_max_uid (); 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 ()) if (max_labelno != max_label_num ())
{ {
@ -779,8 +779,8 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED)
n_labels = max_labelno - min_labelno + 1; n_labels = max_labelno - min_labelno + 1;
n_old_labels = old - min_labelno + 1; n_old_labels = old - min_labelno + 1;
label_align = (struct label_alignment *) xrealloc label_align = xrealloc (label_align,
(label_align, n_labels * sizeof (struct label_alignment)); n_labels * sizeof (struct label_alignment));
/* Range of labels grows monotonically in the function. Abort here /* Range of labels grows monotonically in the function. Abort here
means that the initialization of array got lost. */ means that the initialization of array got lost. */
@ -875,20 +875,20 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED)
#ifdef HAVE_ATTR_length #ifdef HAVE_ATTR_length
/* Allocate the rest of the arrays. */ /* 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; insn_lengths_max_uid = max_uid;
/* Syntax errors can lead to labels being outside of the main insn stream. /* Syntax errors can lead to labels being outside of the main insn stream.
Initialize insn_addresses, so that we get reproducible results. */ Initialize insn_addresses, so that we get reproducible results. */
INSN_ADDRESSES_ALLOC (max_uid); 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 /* Initialize uid_align. We scan instructions
from end to start, and keep in align_tab[n] the last seen insn 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 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 in the alignment chain for an insn that does / has a known
alignment of n. */ 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;) for (i = MAX_CODE_ALIGN; --i >= 0;)
align_tab[i] = NULL_RTX; align_tab[i] = NULL_RTX;
@ -1566,7 +1566,7 @@ final (rtx first, FILE *file, int optimize, int prescan)
max_line = NOTE_LINE_NUMBER (insn); 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)) for (insn = first; insn; insn = NEXT_INSN (insn))
{ {
@ -2055,7 +2055,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
if (asm_noperands (body) >= 0) if (asm_noperands (body) >= 0)
{ {
unsigned int noperands = asm_noperands (body); unsigned int noperands = asm_noperands (body);
rtx *ops = (rtx *) alloca (noperands * sizeof (rtx)); rtx *ops = alloca (noperands * sizeof (rtx));
const char *string; const char *string;
/* There's no telling what that did to the condition codes. */ /* There's no telling what that did to the condition codes. */
@ -3865,8 +3865,8 @@ debug_queue_symbol (tree decl)
if (symbol_queue_index >= symbol_queue_size) if (symbol_queue_index >= symbol_queue_size)
{ {
symbol_queue_size += 10; symbol_queue_size += 10;
symbol_queue = (tree *) xrealloc (symbol_queue, symbol_queue = xrealloc (symbol_queue,
symbol_queue_size * sizeof (tree)); symbol_queue_size * sizeof (tree));
} }
symbol_queue[symbol_queue_index++] = decl; symbol_queue[symbol_queue_index++] = decl;

View File

@ -544,8 +544,7 @@ recognized_function (const cpp_token *fname, unsigned int line, int kind,
/* We only have a partial function declaration, /* We only have a partial function declaration,
so remember that we have to add a complete prototype. */ so remember that we have to add a complete prototype. */
partial_count++; partial_count++;
partial = (struct partial_proto *) partial = obstack_alloc (&scan_file_obstack, sizeof (struct partial_proto));
obstack_alloc (&scan_file_obstack, sizeof (struct partial_proto));
partial->line_seen = line; partial->line_seen = line;
partial->fn = fn; partial->fn = fn;
fn->partial = partial; fn->partial = partial;
@ -1169,7 +1168,7 @@ main (int argc, char **argv)
exit (FATAL_EXIT_CODE); exit (FATAL_EXIT_CODE);
} }
inf_size = sbuf.st_size; inf_size = sbuf.st_size;
inf_buffer = (char *) xmalloc (inf_size + 2); inf_buffer = xmalloc (inf_size + 2);
inf_ptr = inf_buffer; inf_ptr = inf_buffer;
to_read = inf_size; to_read = inf_size;

View File

@ -1082,7 +1082,7 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags)
/* Create a worklist. Allocate an extra slot for ENTRY_BLOCK, and one /* Create a worklist. Allocate an extra slot for ENTRY_BLOCK, and one
because the `head == tail' style test for an empty queue doesn't because the `head == tail' style test for an empty queue doesn't
work with a full queue. */ 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; qtail = queue;
qhead = qend = queue + n_basic_blocks + 2; qhead = qend = queue + n_basic_blocks + 2;
@ -1850,7 +1850,7 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set,
pbi->flags = flags; pbi->flags = flags;
if (flags & (PROP_LOG_LINKS | PROP_AUTOINC)) 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 else
pbi->reg_next_use = NULL; pbi->reg_next_use = NULL;
@ -1932,7 +1932,7 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set,
struct reg_cond_life_info *rcli; struct reg_cond_life_info *rcli;
rtx cond; 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)) if (REGNO_REG_SET_P (bb_true->global_live_at_start, i))
cond = cond_false; cond = cond_false;
@ -2867,7 +2867,7 @@ mark_regno_cond_dead (struct propagate_block_info *pbi, int regno, rtx cond)
/* The register was unconditionally live previously. /* The register was unconditionally live previously.
Record the current condition as the condition under Record the current condition as the condition under
which it is dead. */ which it is dead. */
rcli = (struct reg_cond_life_info *) xmalloc (sizeof (*rcli)); rcli = xmalloc (sizeof (*rcli));
rcli->condition = cond; rcli->condition = cond;
rcli->stores = cond; rcli->stores = cond;
rcli->orig_condition = const0_rtx; rcli->orig_condition = const0_rtx;
@ -3644,7 +3644,7 @@ mark_used_reg (struct propagate_block_info *pbi, rtx reg,
{ {
/* The register was not previously live at all. Record /* The register was not previously live at all. Record
the condition under which it is still dead. */ 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->condition = not_reg_cond (cond);
rcli->stores = const0_rtx; rcli->stores = const0_rtx;
rcli->orig_condition = const0_rtx; rcli->orig_condition = const0_rtx;

View File

@ -313,7 +313,7 @@ mul_double (unsigned HOST_WIDE_INT l1, HOST_WIDE_INT h1,
encode (arg1, l1, h1); encode (arg1, l1, h1);
encode (arg2, l2, h2); encode (arg2, l2, h2);
memset ((char *) prod, 0, sizeof prod); memset (prod, 0, sizeof prod);
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
@ -591,10 +591,10 @@ div_and_round_double (enum tree_code code, int uns,
goto finish_up; 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 (num, 0, sizeof num); /* to zero 9th element */
memset ((char *) den, 0, sizeof den); memset (den, 0, sizeof den);
encode (num, lnum, hnum); encode (num, lnum, hnum);
encode (den, lden, hden); encode (den, lden, hden);

View File

@ -692,7 +692,7 @@ assign_stack_temp_for_type (enum machine_mode mode, HOST_WIDE_INT size, int keep
if (best_p->size - rounded_size >= alignment) 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->in_use = p->addr_taken = 0;
p->size = best_p->size - rounded_size; p->size = best_p->size - rounded_size;
p->base_offset = best_p->base_offset + rounded_size; p->base_offset = best_p->base_offset + rounded_size;
@ -723,7 +723,7 @@ assign_stack_temp_for_type (enum machine_mode mode, HOST_WIDE_INT size, int keep
{ {
HOST_WIDE_INT frame_offset_old = frame_offset; 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. /* We are passing an explicit alignment request to assign_stack_local.
One side effect of that is assign_stack_local will not round SIZE One side effect of that is assign_stack_local will not round SIZE
@ -1477,8 +1477,7 @@ schedule_fixup_var_refs (struct function *function, rtx reg, tree type,
{ {
struct var_refs_queue *temp; struct var_refs_queue *temp;
temp temp = ggc_alloc (sizeof (struct var_refs_queue));
= (struct var_refs_queue *) ggc_alloc (sizeof (struct var_refs_queue));
temp->modified = reg; temp->modified = reg;
temp->promoted_mode = promoted_mode; temp->promoted_mode = promoted_mode;
temp->unsignedp = unsigned_p; temp->unsignedp = unsigned_p;
@ -1553,7 +1552,7 @@ find_fixup_replacement (struct fixup_replacement **replacements, rtx x)
if (p == 0) if (p == 0)
{ {
p = (struct fixup_replacement *) xmalloc (sizeof (struct fixup_replacement)); p = xmalloc (sizeof (struct fixup_replacement));
p->old = x; p->old = x;
p->new = 0; p->new = 0;
p->next = *replacements; p->next = *replacements;
@ -1627,7 +1626,7 @@ fixup_var_refs_insns_with_hash (htab_t ht, rtx var, enum machine_mode promoted_m
rtx insn_list; rtx insn_list;
tmp.key = var; 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)) for (insn_list = ime->insns; insn_list != 0; insn_list = XEXP (insn_list, 1))
if (INSN_P (XEXP (insn_list, 0))) if (INSN_P (XEXP (insn_list, 0)))
fixup_var_refs_insn (XEXP (insn_list, 0), var, promoted_mode, fixup_var_refs_insn (XEXP (insn_list, 0), var, promoted_mode,
@ -3295,7 +3294,7 @@ insns_for_mem_walk (rtx *r, void *data)
{ {
struct insns_for_mem_entry *ifme; struct insns_for_mem_entry *ifme;
tmp.key = *r; 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 /* If we have not already recorded this INSN, do so now. Since
we process the INSNs in order, we know that if we have we process the INSNs in order, we know that if we have
@ -4281,7 +4280,7 @@ assign_parms (tree fndecl)
orig_fnargs = fnargs; orig_fnargs = fnargs;
max_parm_reg = LAST_VIRTUAL_REGISTER + 1; 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) if (SPLIT_COMPLEX_ARGS)
fnargs = split_complex_args (fnargs); fnargs = split_complex_args (fnargs);
@ -4944,10 +4943,10 @@ assign_parms (tree fndecl)
but it's also rare and we need max_parm_reg to be but it's also rare and we need max_parm_reg to be
precisely correct. */ precisely correct. */
max_parm_reg = regno + 1; max_parm_reg = regno + 1;
new = (rtx *) ggc_realloc (parm_reg_stack_loc, new = ggc_realloc (parm_reg_stack_loc,
max_parm_reg * sizeof (rtx)); max_parm_reg * sizeof (rtx));
memset ((char *) (new + old_max_parm_reg), 0, memset (new + old_max_parm_reg, 0,
(max_parm_reg - old_max_parm_reg) * sizeof (rtx)); (max_parm_reg - old_max_parm_reg) * sizeof (rtx));
parm_reg_stack_loc = new; parm_reg_stack_loc = new;
} }
@ -5885,7 +5884,7 @@ identify_blocks (void)
/* Fill the BLOCK_VECTOR with all of the BLOCKs in this function, in /* Fill the BLOCK_VECTOR with all of the BLOCKs in this function, in
depth-first order. */ depth-first order. */
block_vector = get_block_vector (block, &n_blocks); 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 (), last_block_vector = identify_blocks_1 (get_insns (),
block_vector + 1, block_vector + 1,
@ -6189,7 +6188,7 @@ get_block_vector (tree block, int *n_blocks_p)
tree *block_vector; tree *block_vector;
*n_blocks_p = all_blocks (block, NULL); *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); all_blocks (block, block_vector);
return block_vector; return block_vector;
@ -6252,7 +6251,7 @@ debug_find_var_in_block_tree (tree var, tree block)
static void static void
prepare_function_start (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_stmt_for_function ();
init_eh_for_function (); init_eh_for_function ();

127
gcc/gcc.c
View File

@ -1107,8 +1107,7 @@ translate_options (int *argcp, const char *const **argvp)
int argc = *argcp; int argc = *argcp;
const char *const *argv = *argvp; const char *const *argv = *argvp;
int newvsize = (argc + 2) * 2 * sizeof (const char *); int newvsize = (argc + 2) * 2 * sizeof (const char *);
const char **newv = const char **newv = xmalloc (newvsize);
(const char **) xmalloc (newvsize);
int newindex = 0; int newindex = 0;
i = 0; i = 0;
@ -1138,7 +1137,7 @@ translate_options (int *argcp, const char *const **argvp)
} }
newvsize += spaces * sizeof (const char *); newvsize += spaces * sizeof (const char *);
newv = (const char **) xrealloc (newv, newvsize); newv = xrealloc (newv, newvsize);
sp = target_option_translations[tott_idx].replacements; sp = target_option_translations[tott_idx].replacements;
np = xstrdup (sp); np = xstrdup (sp);
@ -1574,8 +1573,8 @@ init_spec (void)
notice ("Using built-in specs.\n"); notice ("Using built-in specs.\n");
#ifdef EXTRA_SPECS #ifdef EXTRA_SPECS
extra_specs = (struct spec_list *) extra_specs = xcalloc (sizeof (struct spec_list),
xcalloc (sizeof (struct spec_list), ARRAY_SIZE (extra_specs_1)); ARRAY_SIZE (extra_specs_1));
for (i = ARRAY_SIZE (extra_specs_1) - 1; i >= 0; i--) for (i = ARRAY_SIZE (extra_specs_1) - 1; i >= 0; i--)
{ {
@ -1733,7 +1732,7 @@ set_spec (const char *name, const char *spec)
if (!sl) if (!sl)
{ {
/* Not found - make it. */ /* 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 = xstrdup (name);
sl->name_len = name_len; sl->name_len = name_len;
sl->ptr_spec = &sl->ptr; sl->ptr_spec = &sl->ptr;
@ -1805,7 +1804,7 @@ static void
alloc_args (void) alloc_args (void)
{ {
argbuf_length = 10; 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). */ /* Clear out the vector of arguments (after a command is executed). */
@ -1827,9 +1826,7 @@ static void
store_arg (const char *arg, int delete_always, int delete_failure) store_arg (const char *arg, int delete_always, int delete_failure)
{ {
if (argbuf_index + 1 == argbuf_length) if (argbuf_index + 1 == argbuf_length)
argbuf argbuf = xrealloc (argbuf, (argbuf_length *= 2) * sizeof (const char *));
= (const char **) xrealloc (argbuf,
(argbuf_length *= 2) * sizeof (const char *));
argbuf[argbuf_index++] = arg; argbuf[argbuf_index++] = arg;
argbuf[argbuf_index] = 0; argbuf[argbuf_index] = 0;
@ -2119,9 +2116,8 @@ read_specs (const char *filename, int main_p)
{ {
/* Add this pair to the vector. */ /* Add this pair to the vector. */
compilers compilers
= ((struct compiler *) = xrealloc (compilers,
xrealloc (compilers, (n_compilers + 2) * sizeof (struct compiler));
(n_compilers + 2) * sizeof (struct compiler)));
compilers[n_compilers].suffix = suffix; compilers[n_compilers].suffix = suffix;
compilers[n_compilers].spec = spec; compilers[n_compilers].spec = spec;
@ -2188,7 +2184,7 @@ record_temp_file (const char *filename, int always_delete, int fail_delete)
if (! strcmp (name, temp->name)) if (! strcmp (name, temp->name))
goto already1; goto already1;
temp = (struct temp_file *) xmalloc (sizeof (struct temp_file)); temp = xmalloc (sizeof (struct temp_file));
temp->next = always_delete_queue; temp->next = always_delete_queue;
temp->name = name; temp->name = name;
always_delete_queue = temp; always_delete_queue = temp;
@ -2203,7 +2199,7 @@ record_temp_file (const char *filename, int always_delete, int fail_delete)
if (! strcmp (name, temp->name)) if (! strcmp (name, temp->name))
goto already2; goto already2;
temp = (struct temp_file *) xmalloc (sizeof (struct temp_file)); temp = xmalloc (sizeof (struct temp_file));
temp->next = failure_delete_queue; temp->next = failure_delete_queue;
temp->name = name; temp->name = name;
failure_delete_queue = temp; failure_delete_queue = temp;
@ -2553,7 +2549,7 @@ add_prefix (struct path_prefix *pprefix, const char *prefix,
if (len > pprefix->max_len) if (len > pprefix->max_len)
pprefix->max_len = len; pprefix->max_len = len;
pl = (struct prefix_list *) xmalloc (sizeof (struct prefix_list)); pl = xmalloc (sizeof (struct prefix_list));
pl->prefix = prefix; pl->prefix = prefix;
pl->require_machine_suffix = require_machine_suffix; pl->require_machine_suffix = require_machine_suffix;
pl->used_flag_ptr = warn; pl->used_flag_ptr = warn;
@ -2622,7 +2618,7 @@ execute (void)
n_commands++; n_commands++;
/* Get storage for each command. */ /* 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, /* Split argbuf into its separate piped processes,
and record info about each one. and record info about each one.
@ -3034,12 +3030,10 @@ add_preprocessor_option (const char *option, int len)
n_preprocessor_options++; n_preprocessor_options++;
if (! preprocessor_options) if (! preprocessor_options)
preprocessor_options preprocessor_options = xmalloc (n_preprocessor_options * sizeof (char *));
= (char **) xmalloc (n_preprocessor_options * sizeof (char *));
else else
preprocessor_options preprocessor_options = xrealloc (preprocessor_options,
= (char **) xrealloc (preprocessor_options, n_preprocessor_options * sizeof (char *));
n_preprocessor_options * sizeof (char *));
preprocessor_options [n_preprocessor_options - 1] = preprocessor_options [n_preprocessor_options - 1] =
save_string (option, len); save_string (option, len);
@ -3051,12 +3045,10 @@ add_assembler_option (const char *option, int len)
n_assembler_options++; n_assembler_options++;
if (! assembler_options) if (! assembler_options)
assembler_options assembler_options = xmalloc (n_assembler_options * sizeof (char *));
= (char **) xmalloc (n_assembler_options * sizeof (char *));
else else
assembler_options assembler_options = xrealloc (assembler_options,
= (char **) xrealloc (assembler_options, n_assembler_options * sizeof (char *));
n_assembler_options * sizeof (char *));
assembler_options [n_assembler_options - 1] = save_string (option, len); assembler_options [n_assembler_options - 1] = save_string (option, len);
} }
@ -3067,12 +3059,10 @@ add_linker_option (const char *option, int len)
n_linker_options++; n_linker_options++;
if (! linker_options) if (! linker_options)
linker_options linker_options = xmalloc (n_linker_options * sizeof (char *));
= (char **) xmalloc (n_linker_options * sizeof (char *));
else else
linker_options linker_options = xrealloc (linker_options,
= (char **) xrealloc (linker_options, n_linker_options * sizeof (char *));
n_linker_options * sizeof (char *));
linker_options [n_linker_options - 1] = save_string (option, len); linker_options [n_linker_options - 1] = save_string (option, len);
} }
@ -3213,7 +3203,7 @@ process_command (int argc, const char *const *argv)
if (temp) if (temp)
{ {
const char *startp, *endp; const char *startp, *endp;
char *nstore = (char *) alloca (strlen (temp) + 3); char *nstore = alloca (strlen (temp) + 3);
startp = endp = temp; startp = endp = temp;
while (1) while (1)
@ -3248,7 +3238,7 @@ process_command (int argc, const char *const *argv)
if (temp && *cross_compile == '0') if (temp && *cross_compile == '0')
{ {
const char *startp, *endp; const char *startp, *endp;
char *nstore = (char *) alloca (strlen (temp) + 3); char *nstore = alloca (strlen (temp) + 3);
startp = endp = temp; startp = endp = temp;
while (1) while (1)
@ -3281,7 +3271,7 @@ process_command (int argc, const char *const *argv)
if (temp && *cross_compile == '0') if (temp && *cross_compile == '0')
{ {
const char *startp, *endp; const char *startp, *endp;
char *nstore = (char *) alloca (strlen (temp) + 3); char *nstore = alloca (strlen (temp) + 3);
startp = endp = temp; startp = endp = temp;
while (1) while (1)
@ -3484,8 +3474,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
} }
else if (strcmp (argv[i], "-specs") == 0) else if (strcmp (argv[i], "-specs") == 0)
{ {
struct user_specs *user = (struct user_specs *) struct user_specs *user = xmalloc (sizeof (struct user_specs));
xmalloc (sizeof (struct user_specs));
if (++i >= argc) if (++i >= argc)
fatal ("argument to `-specs' is missing"); fatal ("argument to `-specs' is missing");
@ -3499,8 +3488,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
} }
else if (strncmp (argv[i], "-specs=", 7) == 0) else if (strncmp (argv[i], "-specs=", 7) == 0)
{ {
struct user_specs *user = (struct user_specs *) struct user_specs *user = xmalloc (sizeof (struct user_specs));
xmalloc (sizeof (struct user_specs));
if (strlen (argv[i]) == 7) if (strlen (argv[i]) == 7)
fatal ("argument to `-specs=' is missing"); fatal ("argument to `-specs=' is missing");
@ -3673,9 +3661,8 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
for (j = 0; j < ARRAY_SIZE (modify_target); j++) for (j = 0; j < ARRAY_SIZE (modify_target); j++)
if (! strcmp (argv[i], modify_target[j].sw)) if (! strcmp (argv[i], modify_target[j].sw))
{ {
char *new_name char *new_name = xmalloc (strlen (modify_target[j].str)
= (char *) xmalloc (strlen (modify_target[j].str) + strlen (spec_machine));
+ strlen (spec_machine));
const char *p, *r; const char *p, *r;
char *q; char *q;
int made_addition = 0; int made_addition = 0;
@ -3818,9 +3805,8 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
/* Then create the space for the vectors and scan again. */ /* Then create the space for the vectors and scan again. */
switches = ((struct switchstr *) switches = xmalloc ((n_switches + 1) * sizeof (struct switchstr));
xmalloc ((n_switches + 1) * sizeof (struct switchstr))); infiles = xmalloc ((n_infiles + 1) * sizeof (struct infile));
infiles = (struct infile *) xmalloc ((n_infiles + 1) * sizeof (struct infile));
n_switches = 0; n_switches = 0;
n_infiles = 0; n_infiles = 0;
last_language_n_infiles = -1; last_language_n_infiles = -1;
@ -3969,7 +3955,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
if (i + n_args >= argc) if (i + n_args >= argc)
fatal ("argument to `-%s' is missing", p); fatal ("argument to `-%s' is missing", p);
switches[n_switches].args switches[n_switches].args
= (const char **) xmalloc ((n_args + 1) * sizeof(const char *)); = xmalloc ((n_args + 1) * sizeof(const char *));
while (j < n_args) while (j < n_args)
switches[n_switches].args[j++] = argv[++i]; switches[n_switches].args[j++] = argv[++i];
/* Null-terminate the vector. */ /* Null-terminate the vector. */
@ -3979,13 +3965,12 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
{ {
/* On some systems, ld cannot handle some options without /* On some systems, ld cannot handle some options without
a space. So split the option from its argument. */ a space. So split the option from its argument. */
char *part1 = (char *) xmalloc (2); char *part1 = xmalloc (2);
part1[0] = c; part1[0] = c;
part1[1] = '\0'; part1[1] = '\0';
switches[n_switches].part1 = part1; switches[n_switches].part1 = part1;
switches[n_switches].args switches[n_switches].args = xmalloc (2 * sizeof (const char *));
= (const char **) xmalloc (2 * sizeof (const char *));
switches[n_switches].args[0] = xstrdup (p+1); switches[n_switches].args[0] = xstrdup (p+1);
switches[n_switches].args[1] = 0; switches[n_switches].args[1] = 0;
} }
@ -4453,7 +4438,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
{ {
struct prefix_list *pl = startfile_prefixes.plist; struct prefix_list *pl = startfile_prefixes.plist;
size_t bufsize = 100; size_t bufsize = 100;
char *buffer = (char *) xmalloc (bufsize); char *buffer = xmalloc (bufsize);
int idx; int idx;
for (; pl; pl = pl->next) for (; pl; pl = pl->next)
@ -4481,7 +4466,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
>= bufsize) >= bufsize)
bufsize = (strlen (pl->prefix) bufsize = (strlen (pl->prefix)
+ strlen (machine_suffix)) * 2 + 1; + strlen (machine_suffix)) * 2 + 1;
buffer = (char *) xrealloc (buffer, bufsize); buffer = xrealloc (buffer, bufsize);
strcpy (buffer, pl->prefix); strcpy (buffer, pl->prefix);
strcat (buffer, machine_suffix); strcat (buffer, machine_suffix);
if (is_directory (buffer, multilib_dir, 1)) if (is_directory (buffer, multilib_dir, 1))
@ -4523,7 +4508,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
/* Remove slash from machine_suffix. */ /* Remove slash from machine_suffix. */
if (strlen (machine_suffix) >= bufsize) if (strlen (machine_suffix) >= bufsize)
bufsize = strlen (machine_suffix) * 2 + 1; bufsize = strlen (machine_suffix) * 2 + 1;
buffer = (char *) xrealloc (buffer, bufsize); buffer = xrealloc (buffer, bufsize);
strcpy (buffer, machine_suffix); strcpy (buffer, machine_suffix);
idx = strlen (buffer); idx = strlen (buffer);
if (IS_DIR_SEPARATOR (buffer[idx - 1])) if (IS_DIR_SEPARATOR (buffer[idx - 1]))
@ -4544,7 +4529,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
/* Remove slash from pl->prefix. */ /* Remove slash from pl->prefix. */
if (strlen (pl->prefix) >= bufsize) if (strlen (pl->prefix) >= bufsize)
bufsize = strlen (pl->prefix) * 2 + 1; bufsize = strlen (pl->prefix) * 2 + 1;
buffer = (char *) xrealloc (buffer, bufsize); buffer = xrealloc (buffer, bufsize);
strcpy (buffer, pl->prefix); strcpy (buffer, pl->prefix);
idx = strlen (buffer); idx = strlen (buffer);
if (IS_DIR_SEPARATOR (buffer[idx - 1])) if (IS_DIR_SEPARATOR (buffer[idx - 1]))
@ -4567,7 +4552,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
char *buf; char *buf;
while (*p != 0 && *p != '\n') while (*p != 0 && *p != '\n')
p++; p++;
buf = (char *) alloca (p - q + 1); buf = alloca (p - q + 1);
strncpy (buf, q, p - q); strncpy (buf, q, p - q);
buf[p - q] = 0; buf[p - q] = 0;
error ("%s", buf); error ("%s", buf);
@ -4581,7 +4566,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
char *buf; char *buf;
while (*p != 0 && *p != '\n') while (*p != 0 && *p != '\n')
p++; p++;
buf = (char *) alloca (p - q + 1); buf = alloca (p - q + 1);
strncpy (buf, q, p - q); strncpy (buf, q, p - q);
buf[p - q] = 0; buf[p - q] = 0;
notice ("%s\n", buf); notice ("%s\n", buf);
@ -4663,8 +4648,8 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
else else
{ {
saved_suffix saved_suffix
= (char *) xmalloc (suffix_length = xmalloc (suffix_length
+ strlen (TARGET_OBJECT_SUFFIX)); + strlen (TARGET_OBJECT_SUFFIX));
strncpy (saved_suffix, suffix, suffix_length); strncpy (saved_suffix, suffix, suffix_length);
strcpy (saved_suffix + suffix_length, strcpy (saved_suffix + suffix_length,
TARGET_OBJECT_SUFFIX); TARGET_OBJECT_SUFFIX);
@ -4735,7 +4720,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
{ {
if (t == 0) if (t == 0)
{ {
t = (struct temp_name *) xmalloc (sizeof (struct temp_name)); t = xmalloc (sizeof (struct temp_name));
t->next = temp_names; t->next = temp_names;
temp_names = t; temp_names = t;
} }
@ -5131,7 +5116,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
} }
else else
{ {
char *x = (char *) alloca (strlen (name) * 2 + 1); char *x = alloca (strlen (name) * 2 + 1);
char *buf = x; char *buf = x;
const char *y = name; const char *y = name;
int flag = 0; int flag = 0;
@ -5812,7 +5797,7 @@ is_directory (const char *path1, const char *path2, int linker)
{ {
int len1 = strlen (path1); int len1 = strlen (path1);
int len2 = strlen (path2); int len2 = strlen (path2);
char *path = (char *) alloca (3 + len1 + len2); char *path = alloca (3 + len1 + len2);
char *cp; char *cp;
struct stat st; struct stat st;
@ -6016,9 +6001,8 @@ main (int argc, const char *const *argv)
/* Initialize the vector of specs to just the default. /* Initialize the vector of specs to just the default.
This means one element containing 0s, as a terminator. */ This means one element containing 0s, as a terminator. */
compilers = (struct compiler *) xmalloc (sizeof default_compilers); compilers = xmalloc (sizeof default_compilers);
memcpy ((char *) compilers, (char *) default_compilers, memcpy (compilers, default_compilers, sizeof default_compilers);
sizeof default_compilers);
n_compilers = n_default_compilers; n_compilers = n_default_compilers;
/* Read specs from a file if there is one. */ /* Read specs from a file if there is one. */
@ -6036,9 +6020,8 @@ main (int argc, const char *const *argv)
/* We need to check standard_exec_prefix/just_machine_suffix/specs /* We need to check standard_exec_prefix/just_machine_suffix/specs
for any override of as, ld and libraries. */ for any override of as, ld and libraries. */
specs_file = (char *) alloca (strlen (standard_exec_prefix) specs_file = alloca (strlen (standard_exec_prefix)
+ strlen (just_machine_suffix) + strlen (just_machine_suffix) + sizeof ("specs"));
+ sizeof ("specs"));
strcpy (specs_file, standard_exec_prefix); strcpy (specs_file, standard_exec_prefix);
strcat (specs_file, just_machine_suffix); strcat (specs_file, just_machine_suffix);
@ -6297,7 +6280,7 @@ main (int argc, const char *const *argv)
i = n_infiles; i = n_infiles;
i += lang_specific_extra_outfiles; 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. */ /* Record which files were specified explicitly as link input. */
@ -6751,8 +6734,7 @@ used_arg (const char *p, int len)
if (*q == ';') if (*q == ';')
cnt++; cnt++;
matches = matches = alloca ((sizeof (struct mswitchstr)) * cnt);
(struct mswitchstr *) alloca ((sizeof (struct mswitchstr)) * cnt);
i = 0; i = 0;
q = multilib_matches; q = multilib_matches;
while (*q != '\0') while (*q != '\0')
@ -6784,8 +6766,7 @@ used_arg (const char *p, int len)
xmalloc from calling fatal, and prevents us from re-executing this xmalloc from calling fatal, and prevents us from re-executing this
block of code. */ block of code. */
mswitches mswitches
= (struct mswitchstr *) = xmalloc (sizeof (struct mswitchstr)
xmalloc (sizeof (struct mswitchstr)
* (n_mdswitches + (n_switches ? n_switches : 1))); * (n_mdswitches + (n_switches ? n_switches : 1)));
for (i = 0; i < n_switches; i++) for (i = 0; i < n_switches; i++)
{ {
@ -6912,9 +6893,7 @@ set_multilib_dir (void)
{ {
int i = 0; int i = 0;
mdswitches mdswitches = xmalloc (sizeof (struct mdswitchstr) * n_mdswitches);
= (struct mdswitchstr *) xmalloc (sizeof (struct mdswitchstr)
* n_mdswitches);
for (start = multilib_defaults; *start != '\0'; start = end + 1) for (start = multilib_defaults; *start != '\0'; start = end + 1)
{ {
while (*start == ' ' || *start == '\t') while (*start == ' ' || *start == '\t')

View File

@ -73,7 +73,7 @@ lang_specific_driver (int *in_argc ATTRIBUTE_UNUSED,
if (shared_libgcc) if (shared_libgcc)
{ {
/* Make sure to have room for the trailing NULL argument. */ /* 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; i = 0;
do do

View File

@ -520,7 +520,7 @@ process_file (const char *file_name)
for (fn = functions; fn; fn = fn->next) for (fn = functions; fn; fn = fn->next)
solve_flow_graph (fn); solve_flow_graph (fn);
for (src = sources; src; src = src->next) 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) for (fn = functions; fn; fn = fn->next)
{ {
coverage_t coverage; coverage_t coverage;
@ -682,7 +682,7 @@ find_source (const char *file_name)
if (!strcmp (file_name, src->name)) if (!strcmp (file_name, src->name))
return src; return src;
src = (source_t *)xcalloc (1, sizeof (source_t)); src = xcalloc (1, sizeof (source_t));
src->name = xstrdup (file_name); src->name = xstrdup (file_name);
src->coverage.name = src->name; src->coverage.name = src->name;
src->index = sources ? sources->index + 1 : 1; src->index = sources ? sources->index + 1 : 1;
@ -748,7 +748,7 @@ read_graph_file (void)
src = find_source (gcov_read_string ()); src = find_source (gcov_read_string ());
lineno = gcov_read_unsigned (); lineno = gcov_read_unsigned ();
fn = (function_t *)xcalloc (1, sizeof (function_t)); fn = xcalloc (1, sizeof (function_t));
fn->name = function_name; fn->name = function_name;
fn->ident = ident; fn->ident = ident;
fn->checksum = checksum; fn->checksum = checksum;
@ -784,8 +784,7 @@ read_graph_file (void)
unsigned ix, num_blocks = GCOV_TAG_BLOCKS_NUM (length); unsigned ix, num_blocks = GCOV_TAG_BLOCKS_NUM (length);
fn->num_blocks = num_blocks; fn->num_blocks = num_blocks;
fn->blocks fn->blocks = xcalloc (fn->num_blocks, sizeof (block_t));
= (block_t *)xcalloc (fn->num_blocks, sizeof (block_t));
for (ix = 0; ix != num_blocks; ix++) for (ix = 0; ix != num_blocks; ix++)
fn->blocks[ix].flags = gcov_read_unsigned (); fn->blocks[ix].flags = gcov_read_unsigned ();
} }
@ -806,7 +805,7 @@ read_graph_file (void)
if (dest >= fn->num_blocks) if (dest >= fn->num_blocks)
goto corrupt; goto corrupt;
arc = (arc_t *) xcalloc (1, sizeof (arc_t)); arc = xcalloc (1, sizeof (arc_t));
arc->dst = &fn->blocks[dest]; arc->dst = &fn->blocks[dest];
arc->src = &fn->blocks[src]; arc->src = &fn->blocks[src];
@ -851,8 +850,7 @@ read_graph_file (void)
else if (fn && tag == GCOV_TAG_LINES) else if (fn && tag == GCOV_TAG_LINES)
{ {
unsigned blockno = gcov_read_unsigned (); unsigned blockno = gcov_read_unsigned ();
unsigned *line_nos unsigned *line_nos = xcalloc (length - 1, sizeof (unsigned));
= (unsigned *)xcalloc (length - 1, sizeof (unsigned));
if (blockno >= fn->num_blocks || fn->blocks[blockno].u.line.encoding) if (blockno >= fn->num_blocks || fn->blocks[blockno].u.line.encoding)
goto corrupt; goto corrupt;
@ -1047,8 +1045,7 @@ read_count_file (void)
goto mismatch; goto mismatch;
if (!fn->counts) if (!fn->counts)
fn->counts fn->counts = xcalloc (fn->num_counts, sizeof (gcov_type));
= (gcov_type *)xcalloc (fn->num_counts, sizeof (gcov_type));
for (ix = 0; ix != fn->num_counts; ix++) for (ix = 0; ix != fn->num_counts; ix++)
fn->counts[ix] += gcov_read_counter (); fn->counts[ix] += gcov_read_counter ();

View File

@ -549,9 +549,9 @@ struct null_pointer_info
}; };
static void compute_can_copy (void); static void compute_can_copy (void);
static char *gmalloc (unsigned int); static void *gmalloc (unsigned int);
static char *grealloc (char *, unsigned int); static void *grealloc (void *, unsigned int);
static char *gcse_alloc (unsigned long); static void *gcse_alloc (unsigned long);
static void alloc_gcse_mem (rtx); static void alloc_gcse_mem (rtx);
static void free_gcse_mem (void); static void free_gcse_mem (void);
static void alloc_reg_set_mem (int); static void alloc_reg_set_mem (int);
@ -821,12 +821,11 @@ gcse_main (rtx f, FILE *file)
if (changed) if (changed)
{ {
free_modify_mem_tables (); free_modify_mem_tables ();
modify_mem_list modify_mem_list = gmalloc (last_basic_block * sizeof (rtx));
= (rtx *) gmalloc (last_basic_block * sizeof (rtx));
canon_modify_mem_list canon_modify_mem_list
= (rtx *) gmalloc (last_basic_block * sizeof (rtx)); = gmalloc (last_basic_block * sizeof (rtx));
memset ((char *) modify_mem_list, 0, last_basic_block * sizeof (rtx)); memset (modify_mem_list, 0, last_basic_block * sizeof (rtx));
memset ((char *) canon_modify_mem_list, 0, last_basic_block * sizeof (rtx)); memset (canon_modify_mem_list, 0, last_basic_block * sizeof (rtx));
} }
free_reg_set_mem (); free_reg_set_mem ();
alloc_reg_set_mem (max_reg_num ()); alloc_reg_set_mem (max_reg_num ());
@ -954,7 +953,7 @@ can_copy_p (enum machine_mode mode)
/* Cover function to xmalloc to record bytes allocated. */ /* Cover function to xmalloc to record bytes allocated. */
static char * static void *
gmalloc (unsigned int size) gmalloc (unsigned int size)
{ {
bytes_used += size; bytes_used += size;
@ -965,19 +964,19 @@ gmalloc (unsigned int size)
We don't record the additional size since we don't know it. We don't record the additional size since we don't know it.
It won't affect memory usage stats much anyway. */ It won't affect memory usage stats much anyway. */
static char * static void *
grealloc (char *ptr, unsigned int size) grealloc (void *ptr, unsigned int size)
{ {
return xrealloc (ptr, size); return xrealloc (ptr, size);
} }
/* Cover function to obstack_alloc. */ /* Cover function to obstack_alloc. */
static char * static void *
gcse_alloc (unsigned long size) gcse_alloc (unsigned long size)
{ {
bytes_used += size; bytes_used += size;
return (char *) obstack_alloc (&gcse_obstack, size); return obstack_alloc (&gcse_obstack, size);
} }
/* Allocate memory for the cuid mapping array, /* Allocate memory for the cuid mapping array,
@ -997,8 +996,8 @@ alloc_gcse_mem (rtx f)
max_uid = get_max_uid (); max_uid = get_max_uid ();
n = (max_uid + 1) * sizeof (int); n = (max_uid + 1) * sizeof (int);
uid_cuid = (int *) gmalloc (n); uid_cuid = gmalloc (n);
memset ((char *) uid_cuid, 0, n); memset (uid_cuid, 0, n);
for (insn = f, i = 0; insn; insn = NEXT_INSN (insn)) for (insn = f, i = 0; insn; insn = NEXT_INSN (insn))
{ {
if (INSN_P (insn)) if (INSN_P (insn))
@ -1011,8 +1010,8 @@ alloc_gcse_mem (rtx f)
max_cuid = i; max_cuid = i;
n = (max_cuid + 1) * sizeof (rtx); n = (max_cuid + 1) * sizeof (rtx);
cuid_insn = (rtx *) gmalloc (n); cuid_insn = gmalloc (n);
memset ((char *) cuid_insn, 0, n); memset (cuid_insn, 0, n);
for (insn = f, i = 0; insn; insn = NEXT_INSN (insn)) for (insn = f, i = 0; insn; insn = NEXT_INSN (insn))
if (INSN_P (insn)) if (INSN_P (insn))
CUID_INSN (i++) = insn; CUID_INSN (i++) = insn;
@ -1021,14 +1020,13 @@ alloc_gcse_mem (rtx f)
reg_set_bitmap = BITMAP_XMALLOC (); reg_set_bitmap = BITMAP_XMALLOC ();
/* Allocate vars to track sets of regs, memory per block. */ /* Allocate vars to track sets of regs, memory per block. */
reg_set_in_block = (sbitmap *) sbitmap_vector_alloc (last_basic_block, reg_set_in_block = sbitmap_vector_alloc (last_basic_block, max_gcse_regno);
max_gcse_regno);
/* Allocate array to keep a list of insns which modify memory in each /* Allocate array to keep a list of insns which modify memory in each
basic block. */ basic block. */
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)); canon_modify_mem_list = gmalloc (last_basic_block * sizeof (rtx));
memset ((char *) modify_mem_list, 0, last_basic_block * sizeof (rtx)); memset (modify_mem_list, 0, last_basic_block * sizeof (rtx));
memset ((char *) canon_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 (); modify_mem_list_set = BITMAP_XMALLOC ();
canon_modify_mem_list_set = BITMAP_XMALLOC (); canon_modify_mem_list_set = BITMAP_XMALLOC ();
} }
@ -1195,8 +1193,8 @@ alloc_reg_set_mem (int n_regs)
reg_set_table_size = n_regs + REG_SET_TABLE_SLOP; reg_set_table_size = n_regs + REG_SET_TABLE_SLOP;
n = reg_set_table_size * sizeof (struct reg_set *); n = reg_set_table_size * sizeof (struct reg_set *);
reg_set_table = (struct reg_set **) gmalloc (n); reg_set_table = gmalloc (n);
memset ((char *) reg_set_table, 0, n); memset (reg_set_table, 0, n);
gcc_obstack_init (&reg_set_obstack); gcc_obstack_init (&reg_set_obstack);
} }
@ -1221,16 +1219,14 @@ record_one_set (int regno, rtx insn)
{ {
int new_size = regno + REG_SET_TABLE_SLOP; int new_size = regno + REG_SET_TABLE_SLOP;
reg_set_table reg_set_table = grealloc (reg_set_table,
= (struct reg_set **) grealloc ((char *) reg_set_table, new_size * sizeof (struct reg_set *));
new_size * sizeof (struct reg_set *)); memset (reg_set_table + reg_set_table_size, 0,
memset ((char *) (reg_set_table + reg_set_table_size), 0,
(new_size - reg_set_table_size) * sizeof (struct reg_set *)); (new_size - reg_set_table_size) * sizeof (struct reg_set *));
reg_set_table_size = new_size; reg_set_table_size = new_size;
} }
new_reg_info = (struct reg_set *) obstack_alloc (&reg_set_obstack, new_reg_info = obstack_alloc (&reg_set_obstack, sizeof (struct reg_set));
sizeof (struct reg_set));
bytes_used += sizeof (struct reg_set); bytes_used += sizeof (struct reg_set);
new_reg_info->insn = insn; new_reg_info->insn = insn;
new_reg_info->next = reg_set_table[regno]; new_reg_info->next = reg_set_table[regno];
@ -1937,7 +1933,7 @@ insert_expr_in_table (rtx x, enum machine_mode mode, rtx insn, int antic_p,
if (! found) if (! found)
{ {
cur_expr = (struct expr *) gcse_alloc (sizeof (struct expr)); cur_expr = gcse_alloc (sizeof (struct expr));
bytes_used += sizeof (struct expr); bytes_used += sizeof (struct expr);
if (table->table[hash] == NULL) if (table->table[hash] == NULL)
/* This is the first pattern that hashed to this index. */ /* This is the first pattern that hashed to this index. */
@ -1976,7 +1972,7 @@ insert_expr_in_table (rtx x, enum machine_mode mode, rtx insn, int antic_p,
else else
{ {
/* First occurrence of this expression in this basic block. */ /* 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); bytes_used += sizeof (struct occr);
/* First occurrence of this expression in any block? */ /* First occurrence of this expression in any block? */
if (cur_expr->antic_occr == NULL) if (cur_expr->antic_occr == NULL)
@ -2011,7 +2007,7 @@ insert_expr_in_table (rtx x, enum machine_mode mode, rtx insn, int antic_p,
else else
{ {
/* First occurrence of this expression in this basic block. */ /* 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); bytes_used += sizeof (struct occr);
/* First occurrence of this expression in any block? */ /* First occurrence of this expression in any block? */
@ -2058,7 +2054,7 @@ insert_set_in_table (rtx x, rtx insn, struct hash_table *table)
if (! found) if (! found)
{ {
cur_expr = (struct expr *) gcse_alloc (sizeof (struct expr)); cur_expr = gcse_alloc (sizeof (struct expr));
bytes_used += sizeof (struct expr); bytes_used += sizeof (struct expr);
if (table->table[hash] == NULL) if (table->table[hash] == NULL)
/* This is the first pattern that hashed to this index. */ /* This is the first pattern that hashed to this index. */
@ -2097,7 +2093,7 @@ insert_set_in_table (rtx x, rtx insn, struct hash_table *table)
else else
{ {
/* First occurrence of this expression in this basic block. */ /* 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); bytes_used += sizeof (struct occr);
/* First occurrence of this expression in any block? */ /* First occurrence of this expression in any block? */
@ -2286,9 +2282,8 @@ dump_hash_table (FILE *file, const char *name, struct hash_table *table)
unsigned int *hash_val; unsigned int *hash_val;
struct expr *expr; struct expr *expr;
flat_table flat_table = xcalloc (table->n_elems, sizeof (struct expr *));
= (struct expr **) xcalloc (table->n_elems, sizeof (struct expr *)); hash_val = xmalloc (table->n_elems * sizeof (unsigned int));
hash_val = (unsigned int *) xmalloc (table->n_elems * sizeof (unsigned int));
for (i = 0; i < (int) table->size; i++) for (i = 0; i < (int) table->size; i++)
for (expr = table->table[i]; expr != NULL; expr = expr->next_same_hash) for (expr = table->table[i]; expr != NULL; expr = expr->next_same_hash)
@ -2459,8 +2454,7 @@ compute_hash_table_work (struct hash_table *table)
/* re-Cache any INSN_LIST nodes we have allocated. */ /* re-Cache any INSN_LIST nodes we have allocated. */
clear_modify_mem_tables (); clear_modify_mem_tables ();
/* Some working arrays used to track first and last set in each block. */ /* Some working arrays used to track first and last set in each block. */
reg_avail_info = (struct reg_avail_info*) reg_avail_info = gmalloc (max_gcse_regno * sizeof (struct reg_avail_info));
gmalloc (max_gcse_regno * sizeof (struct reg_avail_info));
for (i = 0; i < max_gcse_regno; ++i) for (i = 0; i < max_gcse_regno; ++i)
reg_avail_info[i].last_bb = NULL; reg_avail_info[i].last_bb = NULL;
@ -2550,7 +2544,7 @@ alloc_hash_table (int n_insns, struct hash_table *table, int set_p)
??? Later take some measurements. */ ??? Later take some measurements. */
table->size |= 1; table->size |= 1;
n = table->size * sizeof (struct expr *); n = table->size * sizeof (struct expr *);
table->table = (struct expr **) gmalloc (n); table->table = gmalloc (n);
table->set_p = set_p; table->set_p = set_p;
} }
@ -2570,8 +2564,7 @@ compute_hash_table (struct hash_table *table)
{ {
/* Initialize count of number of entries in hash table. */ /* Initialize count of number of entries in hash table. */
table->n_elems = 0; table->n_elems = 0;
memset ((char *) table->table, 0, memset (table->table, 0, table->size * sizeof (struct expr *));
table->size * sizeof (struct expr *));
compute_hash_table_work (table); compute_hash_table_work (table);
} }
@ -2842,16 +2835,16 @@ mark_oprs_set (rtx insn)
static void static void
alloc_rd_mem (int n_blocks, int n_insns) 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); 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); 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); 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); sbitmap_vector_zero (rd_out, n_blocks);
} }
@ -2969,16 +2962,16 @@ compute_rd (void)
static void static void
alloc_avail_expr_mem (int n_blocks, int n_exprs) 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); 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); 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); 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); sbitmap_vector_zero (ae_out, n_blocks);
} }
@ -3175,7 +3168,7 @@ expr_reaches_here_p (struct occr *occr, struct expr *expr, basic_block bb,
int check_self_loop) int check_self_loop)
{ {
int rval; 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); rval = expr_reaches_here_p_work (occr, expr, bb, check_self_loop, visited);
@ -4591,7 +4584,7 @@ one_cprop_pass (int pass, int cprop_jumps, int bypass_jumps)
local_cprop_pass (cprop_jumps); local_cprop_pass (cprop_jumps);
/* Determine implicit sets. */ /* Determine implicit sets. */
implicit_sets = (rtx *) xcalloc (last_basic_block, sizeof (rtx)); implicit_sets = xcalloc (last_basic_block, sizeof (rtx));
find_implicit_sets (); find_implicit_sets ();
alloc_hash_table (max_cuid, &set_hash_table, 1); alloc_hash_table (max_cuid, &set_hash_table, 1);
@ -5108,7 +5101,7 @@ static int
pre_expr_reaches_here_p (basic_block occr_bb, struct expr *expr, basic_block bb) pre_expr_reaches_here_p (basic_block occr_bb, struct expr *expr, basic_block bb)
{ {
int rval; 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); rval = pre_expr_reaches_here_p_work (occr_bb, expr, bb, visited);
@ -5577,7 +5570,7 @@ pre_gcse (void)
/* Compute a mapping from expression number (`bitmap_index') to /* Compute a mapping from expression number (`bitmap_index') to
hash table entry. */ 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 (i = 0; i < expr_hash_table.size; i++)
for (expr = expr_hash_table.table[i]; expr != NULL; expr = expr->next_same_hash) for (expr = expr_hash_table.table[i]; expr != NULL; expr = expr->next_same_hash)
index_map[expr->bitmap_index] = expr; index_map[expr->bitmap_index] = expr;
@ -5988,7 +5981,7 @@ delete_null_pointer_checks (rtx f ATTRIBUTE_UNUSED)
/* Go through the basic blocks, seeing whether or not each block /* Go through the basic blocks, seeing whether or not each block
ends with a conditional branch whose condition is a comparison ends with a conditional branch whose condition is a comparison
against zero. Record the register compared in BLOCK_REG. */ 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) FOR_EACH_BB (bb)
{ {
rtx last_insn = bb->end; rtx last_insn = bb->end;
@ -6220,7 +6213,7 @@ hoist_code (void)
/* Compute a mapping from expression number (`bitmap_index') to /* Compute a mapping from expression number (`bitmap_index') to
hash table entry. */ 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 (i = 0; i < expr_hash_table.size; i++)
for (expr = expr_hash_table.table[i]; expr != NULL; expr = expr->next_same_hash) for (expr = expr_hash_table.table[i]; expr != NULL; expr = expr->next_same_hash)
index_map[expr->bitmap_index] = expr; index_map[expr->bitmap_index] = expr;
@ -6433,7 +6426,7 @@ ldst_entry (rtx x)
if (!ptr) if (!ptr)
{ {
ptr = (struct ls_expr *) xmalloc (sizeof (struct ls_expr)); ptr = xmalloc (sizeof (struct ls_expr));
ptr->next = pre_ldst_mems; ptr->next = pre_ldst_mems;
ptr->expr = NULL; ptr->expr = NULL;
@ -7079,7 +7072,7 @@ compute_store_table (void)
max_gcse_regno = max_reg_num (); 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); max_gcse_regno);
sbitmap_vector_zero (reg_set_in_block, last_basic_block); sbitmap_vector_zero (reg_set_in_block, last_basic_block);
pre_ldst_mems = 0; pre_ldst_mems = 0;
@ -7379,10 +7372,10 @@ build_store_vectors (void)
/* Build the gen_vector. This is any store in the table which is not killed /* Build the gen_vector. This is any store in the table which is not killed
by aliasing later in its block. */ 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); 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); sbitmap_vector_zero (st_antloc, last_basic_block);
for (ptr = first_ls_expr (); ptr != NULL; ptr = next_ls_expr (ptr)) for (ptr = first_ls_expr (); ptr != NULL; ptr = next_ls_expr (ptr))
@ -7415,10 +7408,10 @@ build_store_vectors (void)
} }
} }
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); 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); sbitmap_vector_zero (transp, last_basic_block);
regs_set_in_block = xmalloc (sizeof (int) * max_gcse_regno); regs_set_in_block = xmalloc (sizeof (int) * max_gcse_regno);

View File

@ -268,8 +268,7 @@ main (int argc, char **argv)
if (unit == 0) if (unit == 0)
{ {
unit = (struct function_unit *) unit = xmalloc (sizeof (struct function_unit));
xmalloc (sizeof (struct function_unit));
unit->name = xstrdup (name); unit->name = xstrdup (name);
unit->multiplicity = multiplicity; unit->multiplicity = multiplicity;
unit->simultaneity = simultaneity; unit->simultaneity = simultaneity;

View File

@ -500,8 +500,7 @@ attr_hash_add_rtx (int hashcode, rtx rtl)
{ {
struct attr_hash *h; struct attr_hash *h;
h = (struct attr_hash *) obstack_alloc (hash_obstack, h = obstack_alloc (hash_obstack, sizeof (struct attr_hash));
sizeof (struct attr_hash));
h->hashcode = hashcode; h->hashcode = hashcode;
h->u.rtl = rtl; h->u.rtl = rtl;
h->next = attr_hash_table[hashcode % RTL_HASH_SIZE]; h->next = attr_hash_table[hashcode % RTL_HASH_SIZE];
@ -515,8 +514,7 @@ attr_hash_add_string (int hashcode, char *str)
{ {
struct attr_hash *h; struct attr_hash *h;
h = (struct attr_hash *) obstack_alloc (hash_obstack, h = obstack_alloc (hash_obstack, sizeof (struct attr_hash));
sizeof (struct attr_hash));
h->hashcode = -hashcode; h->hashcode = -hashcode;
h->u.str = str; h->u.str = str;
h->next = attr_hash_table[hashcode % RTL_HASH_SIZE]; h->next = attr_hash_table[hashcode % RTL_HASH_SIZE];
@ -779,7 +777,7 @@ attr_string (const char *str, int len)
return h->u.str; /* <-- return if found. */ return h->u.str; /* <-- return if found. */
/* Not found; create a permanent copy and add it to the hash table. */ /* 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); memcpy (new_str, str, len);
new_str[len] = '\0'; new_str[len] = '\0';
attr_hash_add_string (hashcode, new_str); attr_hash_add_string (hashcode, new_str);
@ -1459,7 +1457,7 @@ get_attr_value (rtx value, struct attr_desc *attr, int insn_code)
|| insn_alternatives[av->first_insn->insn_code])) || insn_alternatives[av->first_insn->insn_code]))
return av; return av;
av = (struct attr_value *) oballoc (sizeof (struct attr_value)); av = oballoc (sizeof (struct attr_value));
av->value = value; av->value = value;
av->next = attr->first_value; av->next = attr->first_value;
attr->first_value = av; attr->first_value = av;
@ -1875,13 +1873,10 @@ expand_units (void)
/* Create an array of ops for each unit. Add an extra unit for the /* 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. */ result_ready_cost function that has the ops of all other units. */
unit_ops = (struct function_unit_op ***) unit_ops = xmalloc ((num_units + 1) * sizeof (struct function_unit_op **));
xmalloc ((num_units + 1) * sizeof (struct function_unit_op **)); unit_num = xmalloc ((num_units + 1) * sizeof (struct function_unit *));
unit_num = (struct function_unit **)
xmalloc ((num_units + 1) * sizeof (struct function_unit *));
unit_num[num_units] = unit = (struct function_unit *) unit_num[num_units] = unit = xmalloc (sizeof (struct function_unit));
xmalloc (sizeof (struct function_unit));
unit->num = num_units; unit->num = num_units;
unit->num_opclasses = 0; unit->num_opclasses = 0;
@ -1889,7 +1884,7 @@ expand_units (void)
{ {
unit_num[num_units]->num_opclasses += unit->num_opclasses; unit_num[num_units]->num_opclasses += unit->num_opclasses;
unit_num[unit->num] = unit; 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 *)); xmalloc (unit->num_opclasses * sizeof (struct function_unit_op *));
for (op = unit->ops; op; op = op->next) for (op = unit->ops; op; op = op->next)
@ -1897,7 +1892,7 @@ expand_units (void)
} }
/* Compose the array of ops for the extra unit. */ /* 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 xmalloc (unit_num[num_units]->num_opclasses
* sizeof (struct function_unit_op *)); * sizeof (struct function_unit_op *));
@ -2253,7 +2248,7 @@ fill_attr (struct attr_desc *attr)
else else
av = get_attr_value (value, attr, id->insn_code); 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_code = id->insn_code;
ie->insn_index = id->insn_code; ie->insn_index = id->insn_code;
insert_insn_ent (av, ie); insert_insn_ent (av, ie);
@ -2379,7 +2374,7 @@ make_length_attrs (void)
no_address_fn[i], no_address_fn[i],
address_fn[i]), address_fn[i]),
new_attr, ie->insn_code); 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_code = ie->insn_code;
new_ie->insn_index = ie->insn_index; new_ie->insn_index = ie->insn_index;
insert_insn_ent (new_av, new_ie); insert_insn_ent (new_av, new_ie);
@ -2458,7 +2453,7 @@ simplify_cond (rtx exp, int insn_code, int insn_index)
rtx defval = XEXP (exp, 1); rtx defval = XEXP (exp, 1);
rtx new_defval = XEXP (exp, 1); rtx new_defval = XEXP (exp, 1);
int len = XVECLEN (exp, 0); int len = XVECLEN (exp, 0);
rtx *tests = (rtx *) xmalloc (len * sizeof (rtx)); rtx *tests = xmalloc (len * sizeof (rtx));
int allsame = 1; int allsame = 1;
rtx ret; rtx ret;
@ -3398,17 +3393,15 @@ optimize_attrs (void)
return; return;
/* Make 2 extra elements, for "code" values -2 and -1. */ /* Make 2 extra elements, for "code" values -2 and -1. */
insn_code_values insn_code_values = xmalloc ((insn_code_number + 2)
= (struct attr_value_list **) xmalloc ((insn_code_number + 2) * sizeof (struct attr_value_list *));
* sizeof (struct attr_value_list *)); memset (insn_code_values, 0,
memset ((char *) insn_code_values, 0, (insn_code_number + 2) * sizeof (struct attr_value_list *));
(insn_code_number + 2) * sizeof (struct attr_value_list *));
/* Offset the table address so we can index by -2 or -1. */ /* Offset the table address so we can index by -2 or -1. */
insn_code_values += 2; insn_code_values += 2;
iv = ivbuf = ((struct attr_value_list *) iv = ivbuf = xmalloc (num_insn_ents * sizeof (struct attr_value_list));
xmalloc (num_insn_ents * sizeof (struct attr_value_list)));
for (i = 0; i < MAX_ATTRS_INDEX; i++) for (i = 0; i < MAX_ATTRS_INDEX; i++)
for (attr = attrs[i]; attr; attr = attr->next) for (attr = attrs[i]; attr; attr = attr->next)
@ -3499,7 +3492,7 @@ simplify_by_exploding (rtx exp)
cover the domain of the attribute. This makes the expanded COND form cover the domain of the attribute. This makes the expanded COND form
order independent. */ order independent. */
space = (struct dimension *) xmalloc (ndim * sizeof (struct dimension)); space = xmalloc (ndim * sizeof (struct dimension));
total = 1; total = 1;
for (ndim = 0; list; ndim++) for (ndim = 0; list; ndim++)
@ -3554,8 +3547,8 @@ simplify_by_exploding (rtx exp)
for (i = 0; i < ndim; i++) for (i = 0; i < ndim; i++)
space[i].current_value = space[i].values; space[i].current_value = space[i].values;
condtest = (rtx *) xmalloc (total * sizeof (rtx)); condtest = xmalloc (total * sizeof (rtx));
condval = (rtx *) xmalloc (total * sizeof (rtx)); condval = xmalloc (total * sizeof (rtx));
/* Expand the tests and values by iterating over all values in the /* Expand the tests and values by iterating over all values in the
attribute space. */ attribute space. */
@ -4052,7 +4045,7 @@ gen_attr (rtx exp, int lineno)
name_ptr = XSTR (exp, 1); name_ptr = XSTR (exp, 1);
while ((p = next_comma_elt (&name_ptr)) != NULL) 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->value = attr_rtx (CONST_STRING, p);
av->next = attr->first_value; av->next = attr->first_value;
attr->first_value = av; attr->first_value = av;
@ -4196,7 +4189,7 @@ gen_insn (rtx exp, int lineno)
{ {
struct insn_def *id; struct insn_def *id;
id = (struct insn_def *) oballoc (sizeof (struct insn_def)); id = oballoc (sizeof (struct insn_def));
id->next = defs; id->next = defs;
defs = id; defs = id;
id->def = exp; id->def = exp;
@ -4260,7 +4253,7 @@ gen_delay (rtx def, int lineno)
have_annul_false = 1; have_annul_false = 1;
} }
delay = (struct delay_desc *) oballoc (sizeof (struct delay_desc)); delay = oballoc (sizeof (struct delay_desc));
delay->def = def; delay->def = def;
delay->num = ++num_delays; delay->num = ++num_delays;
delay->next = delays; delay->next = delays;
@ -4307,7 +4300,7 @@ gen_unit (rtx def, int lineno)
if (unit == 0) if (unit == 0)
{ {
unit = (struct function_unit *) oballoc (sizeof (struct function_unit)); unit = oballoc (sizeof (struct function_unit));
unit->name = name; unit->name = name;
unit->multiplicity = multiplicity; unit->multiplicity = multiplicity;
unit->simultaneity = simultaneity; unit->simultaneity = simultaneity;
@ -4322,7 +4315,7 @@ gen_unit (rtx def, int lineno)
} }
/* Make a new operation class structure entry and initialize it. */ /* 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->condexp = condexp;
op->num = unit->num_opclasses++; op->num = unit->num_opclasses++;
op->ready = ready_cost; op->ready = ready_cost;
@ -5579,7 +5572,7 @@ find_attr (const char *name, int create)
if (! create) if (! create)
return NULL; 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->name = attr_string (name, strlen (name));
attr->first_value = attr->default_val = NULL; attr->first_value = attr->default_val = NULL;
attr->is_numeric = attr->negative_ok = attr->is_const = attr->is_special = 0; attr->is_numeric = attr->negative_ok = attr->is_const = attr->is_special = 0;
@ -5896,13 +5889,13 @@ from the machine description file `md'. */\n\n");
printf ("#define operands recog_data.operand\n\n"); printf ("#define operands recog_data.operand\n\n");
/* Make `insn_alternatives'. */ /* 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) for (id = defs; id; id = id->next)
if (id->insn_code >= 0) if (id->insn_code >= 0)
insn_alternatives[id->insn_code] = (1 << id->num_alternatives) - 1; insn_alternatives[id->insn_code] = (1 << id->num_alternatives) - 1;
/* Make `insn_n_alternatives'. */ /* 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) for (id = defs; id; id = id->next)
if (id->insn_code >= 0) if (id->insn_code >= 0)
insn_n_alternatives[id->insn_code] = id->num_alternatives; insn_n_alternatives[id->insn_code] = id->num_alternatives;

View File

@ -1922,15 +1922,15 @@ gen_automaton (rtx def)
void void
gen_automata_option (rtx def) 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; 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; 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; 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; 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; ndfa_flag = 1;
else else
fatal ("invalid option `%s' in automata_option", XSTR (def, 0)); fatal ("invalid option `%s' in automata_option", XSTR (def, 0));
@ -8842,8 +8842,7 @@ output_get_cpu_unit_code_func (void)
LOW_VARIABLE_NAME, MIDDLE_VARIABLE_NAME, HIGH_VARIABLE_NAME); LOW_VARIABLE_NAME, MIDDLE_VARIABLE_NAME, HIGH_VARIABLE_NAME);
fprintf (output_file, " static struct %s %s [] =\n {\n", fprintf (output_file, " static struct %s %s [] =\n {\n",
NAME_CODE_STRUCT_NAME, NAME_CODE_TABLE_NAME); NAME_CODE_STRUCT_NAME, NAME_CODE_TABLE_NAME);
units = (unit_decl_t *) xmalloc (sizeof (unit_decl_t) units = xmalloc (sizeof (unit_decl_t) * description->units_num);
* description->units_num);
memcpy (units, units_array, 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); qsort (units, description->units_num, sizeof (unit_decl_t), units_cmp);
for (i = 0; i < description->units_num; i++) for (i = 0; i < description->units_num; i++)
@ -8927,7 +8926,7 @@ output_dfa_start_func (void)
fprintf (output_file, fprintf (output_file,
"void\n%s (void)\n{\n %s = get_max_uid ();\n", "void\n%s (void)\n{\n %s = get_max_uid ();\n",
DFA_START_FUNC_NAME, DFA_INSN_CODES_LENGTH_VARIABLE_NAME); 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); DFA_INSN_CODES_VARIABLE_NAME, DFA_INSN_CODES_LENGTH_VARIABLE_NAME);
fprintf (output_file, " %s ();\n}\n\n", DFA_CLEAN_INSN_CACHE_FUNC_NAME); fprintf (output_file, " %s ();\n}\n\n", DFA_CLEAN_INSN_CACHE_FUNC_NAME);
} }

View File

@ -57,7 +57,7 @@ add_condition (const char *expr)
if (expr[0] == 0) if (expr[0] == 0)
return; return;
test = (struct c_test *) xmalloc (sizeof (struct c_test)); test = xmalloc (sizeof (struct c_test));
test->expr = expr; test->expr = expr;
*(htab_find_slot (condition_table, test, INSERT)) = test; *(htab_find_slot (condition_table, test, INSERT)) = test;

View File

@ -317,8 +317,7 @@ gen_insn (rtx insn, int lineno)
if (i != XVECLEN (insn, 1) - 1) if (i != XVECLEN (insn, 1) - 1)
{ {
struct clobber_pat *p; struct clobber_pat *p;
struct clobber_ent *link struct clobber_ent *link = xmalloc (sizeof (struct clobber_ent));
= (struct clobber_ent *) xmalloc (sizeof (struct clobber_ent));
int j; int j;
link->code_number = insn_code_number; link->code_number = insn_code_number;
@ -354,7 +353,7 @@ gen_insn (rtx insn, int lineno)
if (p == 0) if (p == 0)
{ {
p = (struct clobber_pat *) xmalloc (sizeof (struct clobber_pat)); p = xmalloc (sizeof (struct clobber_pat));
p->insns = 0; p->insns = 0;
p->pattern = insn; p->pattern = insn;

View File

@ -129,7 +129,7 @@ gen_insn (rtx insn)
walk_rtx (XVECEXP (insn, 1, i), path); 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; link->insn_code = insn_code_number;
/* See if we find something that already had this extraction method. */ /* See if we find something that already had this extraction method. */
@ -164,7 +164,7 @@ gen_insn (rtx insn)
/* Otherwise, make a new 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->op_count = op_count;
p->dup_count = dup_count; p->dup_count = dup_count;
p->next = extractions; p->next = extractions;
@ -220,7 +220,7 @@ walk_rtx (rtx x, const char *path)
dupnums[dup_count] = XINT (x, 0); dupnums[dup_count] = XINT (x, 0);
dup_count++; dup_count++;
newpath = (char *) xmalloc (depth + 2); newpath = xmalloc (depth + 2);
strcpy (newpath, path); strcpy (newpath, path);
newpath[depth + 1] = 0; newpath[depth + 1] = 0;
@ -236,7 +236,7 @@ walk_rtx (rtx x, const char *path)
oplocs[XINT (x, 0)] = xstrdup (path); oplocs[XINT (x, 0)] = xstrdup (path);
op_count = MAX (op_count, XINT (x, 0) + 1); op_count = MAX (op_count, XINT (x, 0) + 1);
newpath = (char *) xmalloc (depth + 2); newpath = xmalloc (depth + 2);
strcpy (newpath, path); strcpy (newpath, path);
newpath[depth + 1] = 0; newpath[depth + 1] = 0;
@ -252,7 +252,7 @@ walk_rtx (rtx x, const char *path)
oplocs[XINT (x, 0)] = xstrdup (path); oplocs[XINT (x, 0)] = xstrdup (path);
op_count = MAX (op_count, XINT (x, 0) + 1); op_count = MAX (op_count, XINT (x, 0) + 1);
newpath = (char *) xmalloc (depth + 2); newpath = xmalloc (depth + 2);
strcpy (newpath, path); strcpy (newpath, path);
newpath[depth + 1] = 0; newpath[depth + 1] = 0;
@ -272,7 +272,7 @@ walk_rtx (rtx x, const char *path)
break; break;
} }
newpath = (char *) xmalloc (depth + 2); newpath = xmalloc (depth + 2);
strcpy (newpath, path); strcpy (newpath, path);
newpath[depth + 1] = 0; newpath[depth + 1] = 0;
@ -412,8 +412,7 @@ from the machine description file `md'. */\n\n");
else if (GET_CODE (desc) == DEFINE_PEEPHOLE) else if (GET_CODE (desc) == DEFINE_PEEPHOLE)
{ {
struct code_ptr *link struct code_ptr *link = xmalloc (sizeof (struct code_ptr));
= (struct code_ptr *) xmalloc (sizeof (struct code_ptr));
link->insn_code = insn_code_number; link->insn_code = insn_code_number;
link->next = peepholes; link->next = peepholes;
@ -509,8 +508,7 @@ record_insn_name (int code, const char *name)
{ {
int new_size; int new_size;
new_size = (insn_name_ptr_size ? insn_name_ptr_size * 2 : 512); new_size = (insn_name_ptr_size ? insn_name_ptr_size * 2 : 512);
insn_name_ptr = insn_name_ptr = xrealloc (insn_name_ptr, sizeof(char *) * new_size);
(char **) xrealloc (insn_name_ptr, sizeof(char *) * new_size);
memset (insn_name_ptr + insn_name_ptr_size, 0, memset (insn_name_ptr + insn_name_ptr_size, 0,
sizeof(char *) * (new_size - insn_name_ptr_size)); sizeof(char *) * (new_size - insn_name_ptr_size));
insn_name_ptr_size = new_size; insn_name_ptr_size = new_size;

View File

@ -782,7 +782,7 @@ validate_insn_operands (struct data *d)
static void static void
gen_insn (rtx insn, int lineno) gen_insn (rtx insn, int lineno)
{ {
struct data *d = (struct data *) xmalloc (sizeof (struct data)); struct data *d = xmalloc (sizeof (struct data));
int i; int i;
d->code_number = next_code_number; d->code_number = next_code_number;
@ -823,7 +823,7 @@ gen_insn (rtx insn, int lineno)
static void static void
gen_peephole (rtx peep, int lineno) gen_peephole (rtx peep, int lineno)
{ {
struct data *d = (struct data *) xmalloc (sizeof (struct data)); struct data *d = xmalloc (sizeof (struct data));
int i; int i;
d->code_number = next_code_number; d->code_number = next_code_number;
@ -861,7 +861,7 @@ gen_peephole (rtx peep, int lineno)
static void static void
gen_expand (rtx insn, int lineno) gen_expand (rtx insn, int lineno)
{ {
struct data *d = (struct data *) xmalloc (sizeof (struct data)); struct data *d = xmalloc (sizeof (struct data));
int i; int i;
d->code_number = next_code_number; d->code_number = next_code_number;
@ -904,7 +904,7 @@ gen_expand (rtx insn, int lineno)
static void static void
gen_split (rtx split, int lineno) gen_split (rtx split, int lineno)
{ {
struct data *d = (struct data *) xmalloc (sizeof (struct data)); struct data *d = xmalloc (sizeof (struct data));
int i; int i;
d->code_number = next_code_number; d->code_number = next_code_number;

View File

@ -316,8 +316,7 @@ extern void debug_decision_list
static struct decision * static struct decision *
new_decision (const char *position, struct decision_head *last) new_decision (const char *position, struct decision_head *last)
{ {
struct decision *new struct decision *new = xmalloc (sizeof (struct decision));
= (struct decision *) xmalloc (sizeof (struct decision));
memset (new, 0, sizeof (*new)); memset (new, 0, sizeof (*new));
new->success = *last; new->success = *last;
@ -336,7 +335,7 @@ new_decision_test (enum decision_type type, struct decision_test ***pplace)
struct decision_test **place = *pplace; struct decision_test **place = *pplace;
struct decision_test *test; struct decision_test *test;
test = (struct decision_test *) xmalloc (sizeof (*test)); test = xmalloc (sizeof (*test));
test->next = *place; test->next = *place;
test->type = type; test->type = type;
*place = test; *place = test;
@ -770,7 +769,7 @@ add_to_sequence (rtx pattern, struct decision_head *last, const char *position,
if (depth > max_depth) if (depth > max_depth)
max_depth = depth; max_depth = depth;
subpos = (char *) xmalloc (depth + 2); subpos = xmalloc (depth + 2);
strcpy (subpos, position); strcpy (subpos, position);
subpos[depth + 1] = 0; subpos[depth + 1] = 0;
@ -2667,8 +2666,7 @@ record_insn_name (int code, const char *name)
{ {
int new_size; int new_size;
new_size = (insn_name_ptr_size ? insn_name_ptr_size * 2 : 512); new_size = (insn_name_ptr_size ? insn_name_ptr_size * 2 : 512);
insn_name_ptr = insn_name_ptr = xrealloc (insn_name_ptr, sizeof(char *) * new_size);
(char **) xrealloc (insn_name_ptr, sizeof(char *) * new_size);
memset (insn_name_ptr + insn_name_ptr_size, 0, memset (insn_name_ptr + insn_name_ptr_size, 0,
sizeof(char *) * (new_size - insn_name_ptr_size)); sizeof(char *) * (new_size - insn_name_ptr_size));
insn_name_ptr_size = new_size; insn_name_ptr_size = new_size;

View File

@ -140,7 +140,7 @@ static void
queue_pattern (rtx pattern, struct queue_elem ***list_tail, queue_pattern (rtx pattern, struct queue_elem ***list_tail,
const char *filename, int lineno) 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->data = pattern;
e->filename = filename; e->filename = filename;
e->lineno = lineno; e->lineno = lineno;
@ -583,7 +583,7 @@ alter_predicate_for_insn (rtx pattern, int alt, int max_op, int lineno)
{ {
size_t c_len = strlen (c); size_t c_len = strlen (c);
size_t len = alt * (c_len + 1); size_t len = alt * (c_len + 1);
char *new_c = (char *) xmalloc (len); char *new_c = xmalloc (len);
memcpy (new_c, c, c_len); memcpy (new_c, c, c_len);
for (i = 1; i < alt; ++i) for (i = 1; i < alt; ++i)
@ -876,8 +876,7 @@ init_md_reader_args (int argc, char **argv)
{ {
struct file_name_list *dirtmp; struct file_name_list *dirtmp;
dirtmp = (struct file_name_list *) dirtmp = xmalloc (sizeof (struct file_name_list));
xmalloc (sizeof (struct file_name_list));
dirtmp->next = 0; /* New one goes on the end */ dirtmp->next = 0; /* New one goes on the end */
if (first_dir_md_include == 0) if (first_dir_md_include == 0)
first_dir_md_include = dirtmp; first_dir_md_include = dirtmp;
@ -1078,7 +1077,7 @@ maybe_eval_c_test (const char *expr)
return -1; return -1;
dummy.expr = expr; dummy.expr = expr;
test = (const struct c_test *) htab_find (condition_table, &dummy); test = htab_find (condition_table, &dummy);
if (!test) if (!test)
abort (); abort ();

View File

@ -478,8 +478,7 @@ push_depth (unsigned int i)
if (G.depth_in_use >= G.depth_max) if (G.depth_in_use >= G.depth_max)
{ {
G.depth_max *= 2; G.depth_max *= 2;
G.depth = (unsigned int *) xrealloc ((char *) G.depth, G.depth = xrealloc (G.depth, G.depth_max * sizeof (unsigned int));
G.depth_max * sizeof (unsigned int));
} }
G.depth[G.depth_in_use++] = i; G.depth[G.depth_in_use++] = i;
} }
@ -492,10 +491,10 @@ push_by_depth (page_entry *p, unsigned long *s)
if (G.by_depth_in_use >= G.by_depth_max) if (G.by_depth_in_use >= G.by_depth_max)
{ {
G.by_depth_max *= 2; G.by_depth_max *= 2;
G.by_depth = (page_entry **) xrealloc ((char *) G.by_depth, G.by_depth = xrealloc (G.by_depth,
G.by_depth_max * sizeof (page_entry *)); G.by_depth_max * sizeof (page_entry *));
G.save_in_use = (unsigned long **) xrealloc ((char *) G.save_in_use, G.save_in_use = xrealloc (G.save_in_use,
G.by_depth_max * sizeof (unsigned long *)); G.by_depth_max * sizeof (unsigned long *));
} }
G.by_depth[G.by_depth_in_use] = p; G.by_depth[G.by_depth_in_use] = p;
G.save_in_use[G.by_depth_in_use++] = s; G.save_in_use[G.by_depth_in_use++] = s;
@ -587,7 +586,7 @@ set_page_table_entry (void *p, page_entry *entry)
goto found; goto found;
/* Not found -- allocate a new table. */ /* Not found -- allocate a new table. */
table = (page_table) xcalloc (1, sizeof(*table)); table = xcalloc (1, sizeof(*table));
table->next = G.lookup; table->next = G.lookup;
table->high_bits = high_bits; table->high_bits = high_bits;
G.lookup = table; G.lookup = table;
@ -600,7 +599,7 @@ found:
L2 = LOOKUP_L2 (p); L2 = LOOKUP_L2 (p);
if (base[L1] == NULL) 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; base[L1][L2] = entry;
} }
@ -748,7 +747,7 @@ alloc_page (unsigned order)
memory order. */ memory order. */
for (i = GGC_QUIRE_SIZE - 1; i >= 1; i--) for (i = GGC_QUIRE_SIZE - 1; i >= 1; i--)
{ {
e = (struct page_entry *) xcalloc (1, page_entry_size); e = xcalloc (1, page_entry_size);
e->order = order; e->order = order;
e->bytes = G.pagesize; e->bytes = G.pagesize;
e->page = page + (i << G.lg_pagesize); e->page = page + (i << G.lg_pagesize);
@ -820,7 +819,7 @@ alloc_page (unsigned order)
struct page_entry *e, *f = G.free_pages; struct page_entry *e, *f = G.free_pages;
for (a = enda - G.pagesize; a != page; a -= G.pagesize) 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->order = order;
e->bytes = G.pagesize; e->bytes = G.pagesize;
e->page = a; e->page = a;
@ -834,7 +833,7 @@ alloc_page (unsigned order)
#endif #endif
if (entry == NULL) if (entry == NULL)
entry = (struct page_entry *) xcalloc (1, page_entry_size); entry = xcalloc (1, page_entry_size);
entry->bytes = entry_size; entry->bytes = entry_size;
entry->page = page; entry->page = page;
@ -1327,7 +1326,7 @@ init_ggc (void)
} }
/* We have a good page, might as well hold onto it... */ /* 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->bytes = G.pagesize;
e->page = p; e->page = p;
e->next = G.free_pages; e->next = G.free_pages;
@ -1373,12 +1372,12 @@ init_ggc (void)
G.depth_in_use = 0; G.depth_in_use = 0;
G.depth_max = 10; 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_in_use = 0;
G.by_depth_max = INITIAL_PTE_COUNT; G.by_depth_max = INITIAL_PTE_COUNT;
G.by_depth = (page_entry **) xmalloc (G.by_depth_max * sizeof (page_entry *)); G.by_depth = xmalloc (G.by_depth_max * sizeof (page_entry *));
G.save_in_use = (unsigned long **) xmalloc (G.by_depth_max * sizeof (unsigned long *)); G.save_in_use = xmalloc (G.by_depth_max * sizeof (unsigned long *));
} }
/* Increment the `GC context'. Objects allocated in an outer context /* Increment the `GC context'. Objects allocated in an outer context
@ -2017,8 +2016,8 @@ move_ptes_to_front (int count_old_page_tables, int count_new_page_tables)
page_entry **new_by_depth; page_entry **new_by_depth;
unsigned long **new_save_in_use; unsigned long **new_save_in_use;
new_by_depth = (page_entry **) xmalloc (G.by_depth_max * sizeof (page_entry *)); new_by_depth = xmalloc (G.by_depth_max * sizeof (page_entry *));
new_save_in_use = (unsigned long **) xmalloc (G.by_depth_max * sizeof (unsigned long *)); new_save_in_use = xmalloc (G.by_depth_max * sizeof (unsigned long *));
memcpy (&new_by_depth[0], memcpy (&new_by_depth[0],
&G.by_depth[count_old_page_tables], &G.by_depth[count_old_page_tables],

View File

@ -166,7 +166,7 @@ ggc_alloc (size_t size)
{ {
struct ggc_mem *x; 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[0] = NULL;
x->sub[1] = NULL; x->sub[1] = NULL;
x->mark = 0; x->mark = 0;

View File

@ -398,14 +398,14 @@ global_alloc (FILE *file)
/* Establish mappings from register number to allocation number /* Establish mappings from register number to allocation number
and vice versa. In the process, count the allocnos. */ 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++) for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
reg_allocno[i] = -1; reg_allocno[i] = -1;
/* Initialize the shared-hard-reg mapping /* Initialize the shared-hard-reg mapping
from the list of pairs that may share. */ 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)) for (x = regs_may_share; x; x = XEXP (XEXP (x, 1), 1))
{ {
int r1 = REGNO (XEXP (x, 0)); int r1 = REGNO (XEXP (x, 0));
@ -436,7 +436,7 @@ global_alloc (FILE *file)
else else
reg_allocno[i] = -1; 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++) for (i = FIRST_PSEUDO_REGISTER; i < (size_t) max_regno; i++)
if (reg_allocno[i] >= 0) if (reg_allocno[i] >= 0)
@ -454,9 +454,9 @@ global_alloc (FILE *file)
/* Calculate amount of usage of each hard reg by pseudos /* Calculate amount of usage of each hard reg by pseudos
allocated by local-alloc. This is to see if we want to allocated by local-alloc. This is to see if we want to
override it. */ override it. */
memset ((char *) local_reg_live_length, 0, sizeof local_reg_live_length); memset (local_reg_live_length, 0, sizeof local_reg_live_length);
memset ((char *) local_reg_n_refs, 0, sizeof local_reg_n_refs); memset (local_reg_n_refs, 0, sizeof local_reg_n_refs);
memset ((char *) local_reg_freq, 0, sizeof local_reg_freq); memset (local_reg_freq, 0, sizeof local_reg_freq);
for (i = FIRST_PSEUDO_REGISTER; i < (size_t) max_regno; i++) for (i = FIRST_PSEUDO_REGISTER; i < (size_t) max_regno; i++)
if (reg_renumber[i] >= 0) if (reg_renumber[i] >= 0)
{ {
@ -482,10 +482,9 @@ global_alloc (FILE *file)
/* We used to use alloca here, but the size of what it would try to /* 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 allocate would occasionally cause it to exceed the stack limit and
cause unpredictable core dumps. Some examples were > 2Mb in size. */ cause unpredictable core dumps. Some examples were > 2Mb in size. */
conflicts = (INT_TYPE *) xcalloc (max_allocno * allocno_row_words, conflicts = xcalloc (max_allocno * allocno_row_words, sizeof (INT_TYPE));
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), /* If there is work to be done (at least one reg to allocate),
perform global conflict analysis and allocate the regs. */ perform global conflict analysis and allocate the regs. */
@ -522,7 +521,7 @@ global_alloc (FILE *file)
/* Determine the order to allocate the remaining pseudo registers. */ /* 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++) for (i = 0; i < (size_t) max_allocno; i++)
allocno_order[i] = i; allocno_order[i] = i;
@ -633,13 +632,13 @@ global_conflicts (void)
int *block_start_allocnos; int *block_start_allocnos;
/* Make a vector that mark_reg_{store,clobber} will store in. */ /* 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) 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 /* Initialize table of registers currently live
to the state at the beginning of this basic block. to the state at the beginning of this basic block.
@ -903,7 +902,7 @@ prune_preferences (void)
{ {
int i; int i;
int num; 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. /* Scan least most important to most important.
For each allocno, remove from preferences registers that cannot be used, For each allocno, remove from preferences registers that cannot be used,

View File

@ -225,7 +225,7 @@ print_rtl_graph_with_bb (const char *base, const char *suffix, rtx rtx_first)
size_t namelen = strlen (base); size_t namelen = strlen (base);
size_t suffixlen = strlen (suffix); size_t suffixlen = strlen (suffix);
size_t extlen = strlen (graph_ext[graph_dump_format]) + 1; 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; FILE *fp;
if (basic_block_info == NULL) if (basic_block_info == NULL)
@ -245,10 +245,9 @@ print_rtl_graph_with_bb (const char *base, const char *suffix, rtx rtx_first)
{ {
enum bb_state { NOT_IN_BB, IN_ONE_BB, IN_MULTIPLE_BB }; enum bb_state { NOT_IN_BB, IN_ONE_BB, IN_MULTIPLE_BB };
int max_uid = get_max_uid (); int max_uid = get_max_uid ();
int *start = (int *) xmalloc (max_uid * sizeof (int)); int *start = xmalloc (max_uid * sizeof (int));
int *end = (int *) xmalloc (max_uid * sizeof (int)); int *end = xmalloc (max_uid * sizeof (int));
enum bb_state *in_bb_p = (enum bb_state *) enum bb_state *in_bb_p = xmalloc (max_uid * sizeof (enum bb_state));
xmalloc (max_uid * sizeof (enum bb_state));
basic_block bb; basic_block bb;
int i; int i;
@ -390,7 +389,7 @@ clean_graph_dump_file (const char *base, const char *suffix)
size_t namelen = strlen (base); size_t namelen = strlen (base);
size_t suffixlen = strlen (suffix); size_t suffixlen = strlen (suffix);
size_t extlen = strlen (graph_ext[graph_dump_format]) + 1; 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; FILE *fp;
memcpy (buf, base, namelen); memcpy (buf, base, namelen);
@ -422,7 +421,7 @@ finish_graph_dump_file (const char *base, const char *suffix)
size_t namelen = strlen (base); size_t namelen = strlen (base);
size_t suffixlen = strlen (suffix); size_t suffixlen = strlen (suffix);
size_t extlen = strlen (graph_ext[graph_dump_format]) + 1; 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; FILE *fp;
memcpy (buf, base, namelen); memcpy (buf, base, namelen);

View File

@ -658,9 +658,9 @@ get_unit_last_insn (int instance)
static void static void
clear_units (void) clear_units (void)
{ {
memset ((char *) unit_last_insn, 0, sizeof (unit_last_insn)); memset (unit_last_insn, 0, sizeof (unit_last_insn));
memset ((char *) unit_tick, 0, sizeof (unit_tick)); memset (unit_tick, 0, sizeof (unit_tick));
memset ((char *) unit_n_insns, 0, sizeof (unit_n_insns)); memset (unit_n_insns, 0, sizeof (unit_n_insns));
} }
/* Return the issue-delay of an insn. The scheduler using only DFA /* Return the issue-delay of an insn. The scheduler using only DFA
@ -2130,7 +2130,7 @@ schedule_block (int b, int rgn_n_insns)
/* Allocate the ready list. */ /* Allocate the ready list. */
ready.veclen = rgn_n_insns + 1 + issue_rate; ready.veclen = rgn_n_insns + 1 + issue_rate;
ready.first = ready.veclen - 1; ready.first = ready.veclen - 1;
ready.vec = (rtx *) xmalloc (ready.veclen * sizeof (rtx)); ready.vec = xmalloc (ready.veclen * sizeof (rtx));
ready.n_ready = 0; ready.n_ready = 0;
if (targetm.sched.use_dfa_pipeline_interface if (targetm.sched.use_dfa_pipeline_interface
@ -2138,13 +2138,12 @@ schedule_block (int b, int rgn_n_insns)
{ {
/* It is used for first cycle multipass scheduling. */ /* It is used for first cycle multipass scheduling. */
temp_state = alloca (dfa_state_size); 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)); memset (ready_try, 0, (rgn_n_insns + 1) * sizeof (char));
choice_stack choice_stack = xmalloc ((rgn_n_insns + 1)
= (struct choice_entry *) xmalloc ((rgn_n_insns + 1) * sizeof (struct choice_entry));
* sizeof (struct choice_entry));
for (i = 0; i <= rgn_n_insns; i++) 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); (*current_sched_info->init_ready_list) (&ready);
@ -2166,8 +2165,8 @@ schedule_block (int b, int rgn_n_insns)
else else
max_insn_queue_index_macro_value = max_insn_queue_index; max_insn_queue_index_macro_value = max_insn_queue_index;
insn_queue = (rtx *) alloca ((MAX_INSN_QUEUE_INDEX + 1) * sizeof (rtx)); insn_queue = alloca ((MAX_INSN_QUEUE_INDEX + 1) * sizeof (rtx));
memset ((char *) insn_queue, 0, (MAX_INSN_QUEUE_INDEX + 1) * sizeof (rtx)); memset (insn_queue, 0, (MAX_INSN_QUEUE_INDEX + 1) * sizeof (rtx));
last_clock_var = -1; last_clock_var = -1;
/* Start just before the beginning of time. */ /* Start just before the beginning of time. */
@ -2582,7 +2581,7 @@ sched_init (FILE *dump_file)
pseudos which do not cross calls. */ pseudos which do not cross calls. */
old_max_uid = get_max_uid () + 1; 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++) for (i = 0; i < old_max_uid; i++)
h_i_d [i].cost = -1; h_i_d [i].cost = -1;
@ -2632,7 +2631,7 @@ sched_init (FILE *dump_file)
{ {
rtx line; 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: /* Save-line-note-head:
Determine the line-number at the start of each basic block. Determine the line-number at the start of each basic block.

View File

@ -57,7 +57,7 @@ ht_create (unsigned int order)
unsigned int nslots = 1 << order; unsigned int nslots = 1 << order;
hash_table *table; hash_table *table;
table = (hash_table *) xmalloc (sizeof (hash_table)); table = xmalloc (sizeof (hash_table));
memset (table, 0, sizeof (hash_table)); memset (table, 0, sizeof (hash_table));
/* Strings need no alignment. */ /* Strings need no alignment. */
@ -67,7 +67,7 @@ ht_create (unsigned int order)
obstack_alignment_mask (&table->stack) = 0; obstack_alignment_mask (&table->stack) = 0;
table->entries = (hashnode *) xcalloc (nslots, sizeof (hashnode)); table->entries = xcalloc (nslots, sizeof (hashnode));
table->nslots = nslots; table->nslots = nslots;
return table; return table;
} }
@ -158,7 +158,7 @@ ht_expand (hash_table *table)
unsigned int size, sizemask; unsigned int size, sizemask;
size = table->nslots * 2; size = table->nslots * 2;
nentries = (hashnode *) xcalloc (size, sizeof (hashnode)); nentries = xcalloc (size, sizeof (hashnode));
sizemask = size - 1; sizemask = size - 1;
p = table->entries; p = table->entries;

View File

@ -283,7 +283,7 @@ initialize_for_inline (tree fndecl)
tree parms; tree parms;
/* Clear out PARMDECL_MAP. It was allocated in the caller's frame. */ /* 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))); arg_vector = rtvec_alloc (list_length (DECL_ARGUMENTS (fndecl)));
for (parms = DECL_ARGUMENTS (fndecl), i = 0; for (parms = DECL_ARGUMENTS (fndecl), i = 0;
@ -442,7 +442,7 @@ save_for_inline (tree fndecl)
for the parms, prior to elimination of virtual registers. for the parms, prior to elimination of virtual registers.
These values are needed for substituting parms properly. */ These values are needed for substituting parms properly. */
if (! flag_no_inline) 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. */ /* Make and emit a return-label if we have not already done so. */
@ -724,8 +724,8 @@ expand_inline_function (tree fndecl, tree parms, rtx target, int ignore,
/* Expand the function arguments. Do this first so that any /* Expand the function arguments. Do this first so that any
new registers get created before we allocate the maps. */ new registers get created before we allocate the maps. */
arg_vals = (rtx *) xmalloc (nargs * sizeof (rtx)); arg_vals = xmalloc (nargs * sizeof (rtx));
arg_trees = (tree *) xmalloc (nargs * sizeof (tree)); arg_trees = xmalloc (nargs * sizeof (tree));
for (formal = DECL_ARGUMENTS (fndecl), actual = parms, i = 0; for (formal = DECL_ARGUMENTS (fndecl), actual = parms, i = 0;
formal; formal;
@ -820,22 +820,21 @@ expand_inline_function (tree fndecl, tree parms, rtx target, int ignore,
/* Allocate the structures we use to remap things. */ /* 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; map->fndecl = fndecl;
VARRAY_TREE_INIT (map->block_map, 10, "block_map"); 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 /* 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 allocate would occasionally cause it to exceed the stack limit and
cause unpredictable core dumps. */ cause unpredictable core dumps. */
real_label_map real_label_map = xmalloc ((max_labelno) * sizeof (rtx));
= (rtx *) xmalloc ((max_labelno) * sizeof (rtx));
map->label_map = real_label_map; map->label_map = real_label_map;
map->local_return_label = NULL_RTX; map->local_return_label = NULL_RTX;
inl_max_uid = (inl_f->emit->x_cur_insn_uid + 1); 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->min_insnno = 0;
map->max_insnno = inl_max_uid; map->max_insnno = inl_max_uid;
@ -1185,8 +1184,8 @@ expand_inline_function (tree fndecl, tree parms, rtx target, int ignore,
/* Initialize label_map. get_label_from_map will actually make /* Initialize label_map. get_label_from_map will actually make
the labels. */ the labels. */
memset ((char *) &map->label_map[min_labelno], 0, memset (&map->label_map[min_labelno], 0,
(max_labelno - min_labelno) * sizeof (rtx)); (max_labelno - min_labelno) * sizeof (rtx));
/* Make copies of the decls of the symbols in the inline function, so that /* 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 the copies of the variables get declared in the current function. Set
@ -3051,20 +3050,19 @@ get_func_hard_reg_initial_val (struct function *fun, rtx reg)
if (ivs == 0) 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 = fun->hard_reg_initial_vals;
ivs->num_entries = 0; ivs->num_entries = 0;
ivs->max_entries = 5; 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) if (ivs->num_entries >= ivs->max_entries)
{ {
ivs->max_entries += 5; ivs->max_entries += 5;
ivs->entries = ivs->entries = ggc_realloc (ivs->entries,
(initial_value_pair *) ggc_realloc (ivs->entries, ivs->max_entries
ivs->max_entries * sizeof (initial_value_pair));
* sizeof (initial_value_pair));
} }
ivs->entries[ivs->num_entries].hard_reg = reg; ivs->entries[ivs->num_entries].hard_reg = reg;

View File

@ -386,7 +386,7 @@ duplicate_loop_exit_test (rtx loop_start)
/* We can do the replacement. Allocate reg_map if this is the /* We can do the replacement. Allocate reg_map if this is the
first replacement we found. */ first replacement we found. */
if (reg_map == 0) 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; REG_LOOP_TEST_P (reg) = 1;

View File

@ -461,7 +461,7 @@ write_global_declarations (void)
tree globals = (*lang_hooks.decls.getdecls) (); tree globals = (*lang_hooks.decls.getdecls) ();
int len = list_length (globals); int len = list_length (globals);
tree *vec = (tree *) xmalloc (sizeof (tree) * len); tree *vec = xmalloc (sizeof (tree) * len);
int i; int i;
tree decl; tree decl;

View File

@ -106,8 +106,7 @@ compute_antinout_edge (sbitmap *antloc, sbitmap *transp, sbitmap *antin,
/* Allocate a worklist array/queue. Entries are only added to the /* Allocate a worklist array/queue. Entries are only added to the
list if they were not already on the list. So the size is list if they were not already on the list. So the size is
bounded by the number of basic blocks. */ bounded by the number of basic blocks. */
qin = qout = worklist qin = qout = worklist = xmalloc (sizeof (basic_block) * n_basic_blocks);
= (basic_block *) xmalloc (sizeof (basic_block) * n_basic_blocks);
/* We want a maximal solution, so make an optimistic initialization of /* We want a maximal solution, so make an optimistic initialization of
ANTIN. */ ANTIN. */
@ -259,7 +258,7 @@ compute_laterin (struct edge_list *edge_list, sbitmap *earliest,
list if they were not already on the list. So the size is list if they were not already on the list. So the size is
bounded by the number of basic blocks. */ bounded by the number of basic blocks. */
qin = qout = worklist 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. */ /* Initialize a mapping from each edge to its index. */
for (i = 0; i < num_edges; i++) for (i = 0; i < num_edges; i++)
@ -480,8 +479,7 @@ compute_available (sbitmap *avloc, sbitmap *kill, sbitmap *avout,
/* Allocate a worklist array/queue. Entries are only added to the /* Allocate a worklist array/queue. Entries are only added to the
list if they were not already on the list. So the size is list if they were not already on the list. So the size is
bounded by the number of basic blocks. */ bounded by the number of basic blocks. */
qin = qout = worklist qin = qout = worklist = xmalloc (sizeof (basic_block) * n_basic_blocks);
= (basic_block *) xmalloc (sizeof (basic_block) * n_basic_blocks);
/* We want a maximal solution. */ /* We want a maximal solution. */
sbitmap_vector_ones (avout, last_basic_block); sbitmap_vector_ones (avout, last_basic_block);
@ -608,8 +606,7 @@ compute_nearerout (struct edge_list *edge_list, sbitmap *farthest,
/* Allocate a worklist array/queue. Entries are only added to the /* Allocate a worklist array/queue. Entries are only added to the
list if they were not already on the list. So the size is list if they were not already on the list. So the size is
bounded by the number of basic blocks. */ bounded by the number of basic blocks. */
tos = worklist tos = worklist = xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
= (basic_block *) xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
/* Initialize NEARER for each edge and build a mapping from an edge to /* Initialize NEARER for each edge and build a mapping from an edge to
its index. */ its index. */
@ -717,8 +714,8 @@ pre_edge_rev_lcm (FILE *file ATTRIBUTE_UNUSED, int n_exprs, sbitmap *transp,
edge_list = create_edge_list (); edge_list = create_edge_list ();
num_edges = NUM_EDGES (edge_list); num_edges = NUM_EDGES (edge_list);
st_antin = (sbitmap *) sbitmap_vector_alloc (last_basic_block, n_exprs); st_antin = sbitmap_vector_alloc (last_basic_block, n_exprs);
st_antout = (sbitmap *) 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_antin, last_basic_block);
sbitmap_vector_zero (st_antout, last_basic_block); sbitmap_vector_zero (st_antout, last_basic_block);
compute_antinout_edge (st_antloc, transp, st_antin, st_antout); compute_antinout_edge (st_antloc, transp, st_antin, st_antout);
@ -997,8 +994,7 @@ optimize_mode_switching (FILE *file)
entry_exit_extra = 2; entry_exit_extra = 2;
#endif #endif
bb_info[n_entities] bb_info[n_entities]
= (struct bb_info *) xcalloc (last_basic_block + entry_exit_extra, = xcalloc (last_basic_block + entry_exit_extra, sizeof **bb_info);
sizeof **bb_info);
entity_map[n_entities++] = e; entity_map[n_entities++] = e;
if (num_modes[e] > max_num_modes) if (num_modes[e] > max_num_modes)
max_num_modes = num_modes[e]; max_num_modes = num_modes[e];

View File

@ -80,8 +80,7 @@ add_line_map (struct line_maps *set, enum lc_reason reason,
if (set->used == set->allocated) if (set->used == set->allocated)
{ {
set->allocated = 2 * set->allocated + 256; set->allocated = 2 * set->allocated + 256;
set->maps = (struct line_map *) set->maps = xrealloc (set->maps, set->allocated * sizeof (struct line_map));
xrealloc (set->maps, set->allocated * sizeof (struct line_map));
} }
map = &set->maps[set->used++]; map = &set->maps[set->used++];

View File

@ -356,16 +356,15 @@ local_alloc (void)
See the declarations of these variables, above, See the declarations of these variables, above,
for what they mean. */ for what they mean. */
qty = (struct qty *) xmalloc (max_qty * sizeof (struct qty)); qty = xmalloc (max_qty * sizeof (struct qty));
qty_phys_copy_sugg qty_phys_copy_sugg = xmalloc (max_qty * sizeof (HARD_REG_SET));
= (HARD_REG_SET *) xmalloc (max_qty * sizeof (HARD_REG_SET)); qty_phys_num_copy_sugg = xmalloc (max_qty * sizeof (short));
qty_phys_num_copy_sugg = (short *) xmalloc (max_qty * sizeof (short)); qty_phys_sugg = xmalloc (max_qty * sizeof (HARD_REG_SET));
qty_phys_sugg = (HARD_REG_SET *) xmalloc (max_qty * sizeof (HARD_REG_SET)); qty_phys_num_sugg = xmalloc (max_qty * sizeof (short));
qty_phys_num_sugg = (short *) xmalloc (max_qty * sizeof (short));
reg_qty = (int *) xmalloc (max_regno * sizeof (int)); reg_qty = xmalloc (max_regno * sizeof (int));
reg_offset = (char *) xmalloc (max_regno * sizeof (char)); reg_offset = xmalloc (max_regno * sizeof (char));
reg_next_in_qty = (int *) xmalloc (max_regno * sizeof (int)); reg_next_in_qty = xmalloc (max_regno * sizeof (int));
/* Determine which pseudo-registers can be allocated by local-alloc. /* Determine which pseudo-registers can be allocated by local-alloc.
In general, these are the registers used only in a single block and In general, these are the registers used only in a single block and
@ -409,7 +408,7 @@ local_alloc (void)
else else
{ {
#define CLEAR(vector) \ #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_copy_sugg);
CLEAR (qty_phys_num_copy_sugg); CLEAR (qty_phys_num_copy_sugg);
@ -798,7 +797,7 @@ update_equiv_regs (void)
regset_head cleared_regs; regset_head cleared_regs;
int clear_regnos = 0; 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_REG_SET (&cleared_regs);
init_alias_analysis (); init_alias_analysis ();
@ -1218,8 +1217,7 @@ block_alloc (int b)
/* +2 to leave room for a post_mark_life at the last insn and for /* +2 to leave room for a post_mark_life at the last insn and for
the birth of a CLOBBER in the first insn. */ the birth of a CLOBBER in the first insn. */
regs_live_at = (HARD_REG_SET *) xcalloc ((2 * insn_count + 2), regs_live_at = xcalloc ((2 * insn_count + 2), sizeof (HARD_REG_SET));
sizeof (HARD_REG_SET));
/* Initialize table of hardware registers currently live. */ /* Initialize table of hardware registers currently live. */
@ -1475,7 +1473,7 @@ block_alloc (int b)
number of suggested registers they need so we allocate those with number of suggested registers they need so we allocate those with
the most restrictive needs first. */ 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++) for (i = 0; i < next_qty; i++)
qty_order[i] = i; qty_order[i] = i;

View File

@ -460,13 +460,11 @@ loop_optimize (rtx f, FILE *dumpfile, int flags)
Leave some space for labels allocated by find_and_verify_loops. */ Leave some space for labels allocated by find_and_verify_loops. */
max_uid_for_loop = get_max_uid () + 1 + max_loop_num * 32; max_uid_for_loop = get_max_uid () + 1 + max_loop_num * 32;
uid_luid = (int *) xcalloc (max_uid_for_loop, sizeof (int)); uid_luid = xcalloc (max_uid_for_loop, sizeof (int));
uid_loop = (struct loop **) xcalloc (max_uid_for_loop, uid_loop = xcalloc (max_uid_for_loop, sizeof (struct loop *));
sizeof (struct loop *));
/* Allocate storage for array of loops. */ /* Allocate storage for array of loops. */
loops->array = (struct loop *) loops->array = xcalloc (loops->num, sizeof (struct loop));
xcalloc (loops->num, sizeof (struct loop));
/* Find and process each loop. /* Find and process each loop.
First, find them, and record them in order of their beginnings. */ First, find them, and record them in order of their beginnings. */
@ -908,7 +906,7 @@ scan_loop (struct loop *loop, int flags)
continue; continue;
} }
m = (struct movable *) xmalloc (sizeof (struct movable)); m = xmalloc (sizeof (struct movable));
m->next = 0; m->next = 0;
m->insn = p; m->insn = p;
m->set_src = src; m->set_src = src;
@ -996,7 +994,7 @@ scan_loop (struct loop *loop, int flags)
if (regs->array[regno].set_in_loop == 2) if (regs->array[regno].set_in_loop == 2)
{ {
struct movable *m; struct movable *m;
m = (struct movable *) xmalloc (sizeof (struct movable)); m = xmalloc (sizeof (struct movable));
m->next = 0; m->next = 0;
m->insn = p; m->insn = p;
m->set_dest = SET_DEST (set); m->set_dest = SET_DEST (set);
@ -1440,7 +1438,7 @@ static void
combine_movables (struct loop_movables *movables, struct loop_regs *regs) combine_movables (struct loop_movables *movables, struct loop_regs *regs)
{ {
struct movable *m; struct movable *m;
char *matched_regs = (char *) xmalloc (regs->num); char *matched_regs = xmalloc (regs->num);
enum machine_mode mode; enum machine_mode mode;
/* Regs that are set more than once are not allowed to match /* Regs that are set more than once are not allowed to match
@ -1775,8 +1773,8 @@ move_movables (struct loop *loop, struct loop_movables *movables,
/* Map of pseudo-register replacements to handle combining /* Map of pseudo-register replacements to handle combining
when we move several insns that load the same value when we move several insns that load the same value
into different pseudo-registers. */ into different pseudo-registers. */
rtx *reg_map = (rtx *) xcalloc (nregs, sizeof (rtx)); rtx *reg_map = xcalloc (nregs, sizeof (rtx));
char *already_moved = (char *) xcalloc (nregs, sizeof (char)); char *already_moved = xcalloc (nregs, sizeof (char));
for (m = movables->head; m; m = m->next) for (m = movables->head; m; m = m->next)
{ {
@ -2120,8 +2118,8 @@ move_movables (struct loop *loop, struct loop_movables *movables,
} }
else if (m->insert_temp) else if (m->insert_temp)
{ {
rtx *reg_map2 = (rtx *) xcalloc (REGNO (newreg), rtx *reg_map2 = xcalloc (REGNO (newreg),
sizeof(rtx)); sizeof(rtx));
reg_map2 [m->regno] = newreg; reg_map2 [m->regno] = newreg;
i1 = loop_insn_hoist (loop, copy_rtx (PATTERN (p))); i1 = loop_insn_hoist (loop, copy_rtx (PATTERN (p)));
@ -5068,7 +5066,7 @@ strength_reduce (struct loop *loop, int flags)
addr_placeholder = gen_reg_rtx (Pmode); addr_placeholder = gen_reg_rtx (Pmode);
ivs->n_regs = max_reg_before_loop; 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. */ /* Find all BIVs in loop. */
loop_bivs_find (loop); loop_bivs_find (loop);
@ -5122,7 +5120,7 @@ strength_reduce (struct loop *loop, int flags)
Some givs might have been made from biv increments, so look at Some givs might have been made from biv increments, so look at
ivs->reg_iv_type for a suitable size. */ ivs->reg_iv_type for a suitable size. */
reg_map_size = ivs->n_regs; 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 /* Examine each iv class for feasibility of strength reduction/induction
variable elimination. */ variable elimination. */
@ -5385,8 +5383,7 @@ check_insn_for_bivs (struct loop *loop, rtx p, int not_every_iteration,
/* It is a possible basic induction variable. /* It is a possible basic induction variable.
Create and initialize an induction structure for it. */ Create and initialize an induction structure for it. */
struct induction *v struct induction *v = xmalloc (sizeof (struct induction));
= (struct induction *) xmalloc (sizeof (struct induction));
record_biv (loop, v, p, dest_reg, inc_val, mult_val, location, record_biv (loop, v, p, dest_reg, inc_val, mult_val, location,
not_every_iteration, maybe_multiple); not_every_iteration, maybe_multiple);
@ -5449,8 +5446,7 @@ check_insn_for_givs (struct loop *loop, rtx p, int not_every_iteration,
&add_val, &mult_val, &ext_val, &add_val, &mult_val, &ext_val,
&last_consec_insn)))) &last_consec_insn))))
{ {
struct induction *v struct induction *v = xmalloc (sizeof (struct induction));
= (struct induction *) xmalloc (sizeof (struct induction));
/* If this is a library call, increase benefit. */ /* If this is a library call, increase benefit. */
if (find_reg_note (p, REG_RETVAL, NULL_RTX)) if (find_reg_note (p, REG_RETVAL, NULL_RTX))
@ -5567,8 +5563,7 @@ find_mem_givs (const struct loop *loop, rtx x, rtx insn,
GET_MODE (x))) GET_MODE (x)))
{ {
/* Found one; record it. */ /* Found one; record it. */
struct induction *v struct induction *v = xmalloc (sizeof (struct induction));
= (struct induction *) xmalloc (sizeof (struct induction));
record_giv (loop, v, insn, src_reg, addr_placeholder, mult_val, record_giv (loop, v, insn, src_reg, addr_placeholder, mult_val,
add_val, ext_val, benefit, DEST_ADDR, add_val, ext_val, benefit, DEST_ADDR,
@ -5641,7 +5636,7 @@ record_biv (struct loop *loop, struct induction *v, rtx insn, rtx dest_reg,
{ {
/* Create and initialize new iv_class. */ /* 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->regno = REGNO (dest_reg);
bl->biv = 0; bl->biv = 0;
@ -7008,7 +7003,7 @@ consec_sets_giv (const struct loop *loop, int first_benefit, rtx p,
if (REG_IV_TYPE (ivs, REGNO (dest_reg)) != UNKNOWN_INDUCT) if (REG_IV_TYPE (ivs, REGNO (dest_reg)) != UNKNOWN_INDUCT)
return 0; return 0;
v = (struct induction *) alloca (sizeof (struct induction)); v = alloca (sizeof (struct induction));
v->src_reg = src_reg; v->src_reg = src_reg;
v->mult_val = *mult_val; v->mult_val = *mult_val;
v->add_val = *add_val; v->add_val = *add_val;
@ -7564,15 +7559,14 @@ combine_givs (struct loop_regs *regs, struct iv_class *bl)
if (!g1->ignore) if (!g1->ignore)
giv_count++; giv_count++;
giv_array giv_array = alloca (giv_count * sizeof (struct induction *));
= (struct induction **) alloca (giv_count * sizeof (struct induction *));
i = 0; i = 0;
for (g1 = bl->giv; g1; g1 = g1->next_iv) for (g1 = bl->giv; g1; g1 = g1->next_iv)
if (!g1->ignore) if (!g1->ignore)
giv_array[i++] = g1; giv_array[i++] = g1;
stats = (struct combine_givs_stats *) xcalloc (giv_count, sizeof (*stats)); stats = xcalloc (giv_count, sizeof (*stats));
can_combine = (rtx *) xcalloc (giv_count, giv_count * sizeof (rtx)); can_combine = xcalloc (giv_count, giv_count * sizeof (rtx));
for (i = 0; i < giv_count; i++) for (i = 0; i < giv_count; i++)
{ {
@ -9520,9 +9514,8 @@ insert_loop_mem (rtx *mem, void *data ATTRIBUTE_UNUSED)
else else
loop_info->mems_allocated = 32; loop_info->mems_allocated = 32;
loop_info->mems = (loop_mem_info *) loop_info->mems = xrealloc (loop_info->mems,
xrealloc (loop_info->mems, loop_info->mems_allocated * sizeof (loop_mem_info));
loop_info->mems_allocated * sizeof (loop_mem_info));
} }
/* Actually insert the MEM. */ /* Actually insert the MEM. */
@ -9573,8 +9566,7 @@ loop_regs_scan (const struct loop *loop, int extra_size)
{ {
regs->size = regs->num + extra_size; regs->size = regs->num + extra_size;
regs->array = (struct loop_reg *) regs->array = xrealloc (regs->array, regs->size * sizeof (*regs->array));
xrealloc (regs->array, regs->size * sizeof (*regs->array));
/* Zero the new elements. */ /* Zero the new elements. */
memset (regs->array + old_nregs, 0, memset (regs->array + old_nregs, 0,
@ -9589,7 +9581,7 @@ loop_regs_scan (const struct loop *loop, int extra_size)
regs->array[i].single_usage = NULL_RTX; 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. */ /* Scan the loop, recording register usage. */
for (insn = loop->top ? loop->top : loop->start; insn != loop->end; for (insn = loop->top ? loop->top : loop->start; insn != loop->end;

View File

@ -884,7 +884,7 @@ print_symbol (SYMR *sym_ptr, int number, const char *strbase, AUXU *aux_base,
if (want_scope) if (want_scope)
{ {
if (free_scope == (scope_t *) 0) if (free_scope == (scope_t *) 0)
scope_ptr = (scope_t *) xmalloc (sizeof (scope_t)); scope_ptr = xmalloc (sizeof (scope_t));
else else
{ {
scope_ptr = free_scope; scope_ptr = free_scope;
@ -938,7 +938,7 @@ print_symbol (SYMR *sym_ptr, int number, const char *strbase, AUXU *aux_base,
if (want_scope) if (want_scope)
{ {
if (free_scope == (scope_t *) 0) if (free_scope == (scope_t *) 0)
scope_ptr = (scope_t *) xmalloc (sizeof (scope_t)); scope_ptr = xmalloc (sizeof (scope_t));
else else
{ {
scope_ptr = free_scope; scope_ptr = free_scope;
@ -1324,13 +1324,12 @@ read_tfile (void)
short magic; short magic;
off_t sym_hdr_offset = 0; 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) if (!tfile)
{ {
/* Print out the global header, since this is not a T-file. */ /* Print out the global header, since this is not a T-file. */
(void) read_seek (&global_hdr, sizeof (global_hdr), (off_t) 0, read_seek (&global_hdr, sizeof (global_hdr), 0, "Global file header");
"Global file header");
print_global_hdr (&global_hdr); print_global_hdr (&global_hdr);
@ -1343,70 +1342,45 @@ read_tfile (void)
sym_hdr_offset = global_hdr.f_symptr; sym_hdr_offset = global_hdr.f_symptr;
} }
(void) read_seek (&sym_hdr, read_seek (&sym_hdr, sizeof (sym_hdr), sym_hdr_offset, "Symbolic header");
sizeof (sym_hdr),
sym_hdr_offset,
"Symbolic header");
print_sym_hdr (&sym_hdr); print_sym_hdr (&sym_hdr);
lines = (LINER *) read_seek (NULL, lines = read_seek (NULL, sym_hdr.cbLine, sym_hdr.cbLineOffset,
sym_hdr.cbLine, "Line numbers");
sym_hdr.cbLineOffset,
"Line numbers");
dense_nums = (DNR *) read_seek (NULL, dense_nums = read_seek (NULL, sym_hdr.idnMax * sizeof (DNR),
sym_hdr.idnMax * sizeof (DNR), sym_hdr.cbDnOffset, "Dense numbers");
sym_hdr.cbDnOffset,
"Dense numbers");
proc_desc = (PDR *) read_seek (NULL, proc_desc = read_seek (NULL, sym_hdr.ipdMax * sizeof (PDR),
sym_hdr.ipdMax * sizeof (PDR), sym_hdr.cbPdOffset, "Procedure tables");
sym_hdr.cbPdOffset,
"Procedure tables");
l_symbols = (SYMR *) read_seek (NULL, l_symbols = read_seek (NULL, sym_hdr.isymMax * sizeof (SYMR),
sym_hdr.isymMax * sizeof (SYMR), sym_hdr.cbSymOffset, "Local symbols");
sym_hdr.cbSymOffset,
"Local symbols");
opt_symbols = (OPTR *) read_seek (NULL, opt_symbols = read_seek (NULL, sym_hdr.ioptMax * sizeof (OPTR),
sym_hdr.ioptMax * sizeof (OPTR), sym_hdr.cbOptOffset, "Optimization symbols");
sym_hdr.cbOptOffset,
"Optimization symbols");
aux_symbols = (AUXU *) read_seek (NULL, aux_symbols = read_seek (NULL, sym_hdr.iauxMax * sizeof (AUXU),
sym_hdr.iauxMax * sizeof (AUXU), sym_hdr.cbAuxOffset, "Auxiliary symbols");
sym_hdr.cbAuxOffset,
"Auxiliary symbols");
if (sym_hdr.iauxMax > 0) if (sym_hdr.iauxMax > 0)
aux_used = xcalloc (sym_hdr.iauxMax, 1); aux_used = xcalloc (sym_hdr.iauxMax, 1);
l_strings = (char *) read_seek (NULL, l_strings = read_seek (NULL, sym_hdr.issMax,
sym_hdr.issMax, sym_hdr.cbSsOffset, "Local string table");
sym_hdr.cbSsOffset,
"Local string table");
e_strings = (char *) read_seek (NULL, e_strings = read_seek (NULL, sym_hdr.issExtMax,
sym_hdr.issExtMax, sym_hdr.cbSsExtOffset, "External string table");
sym_hdr.cbSsExtOffset,
"External string table");
file_desc = (FDR *) read_seek (NULL, file_desc = read_seek (NULL, sym_hdr.ifdMax * sizeof (FDR),
sym_hdr.ifdMax * sizeof (FDR), sym_hdr.cbFdOffset, "File tables");
sym_hdr.cbFdOffset,
"File tables");
rfile_desc = (ulong *) read_seek (NULL, rfile_desc = read_seek (NULL, sym_hdr.crfd * sizeof (ulong),
sym_hdr.crfd * sizeof (ulong), sym_hdr.cbRfdOffset, "Relative file tables");
sym_hdr.cbRfdOffset,
"Relative file tables");
e_symbols = (EXTR *) read_seek (NULL, e_symbols = read_seek (NULL, sym_hdr.iextMax * sizeof (EXTR),
sym_hdr.iextMax * sizeof (EXTR), sym_hdr.cbExtOffset, "External symbols");
sym_hdr.cbExtOffset,
"External symbols");
} }

View File

@ -1637,7 +1637,7 @@ add_varray_page (varray_t *vp)
#ifdef MALLOC_CHECK #ifdef MALLOC_CHECK
if (vp->object_size > 1) if (vp->object_size > 1)
new_links->datum = (page_t *) xcalloc (1, vp->object_size); new_links->datum = xcalloc (1, vp->object_size);
else else
#endif #endif
new_links->datum = allocate_page (); new_links->datum = allocate_page ();
@ -2353,7 +2353,7 @@ add_procedure (const char *func_start, /* 1st byte of func name */
STATIC void STATIC void
initialize_init_file (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.lang = langC;
init_file.fdr.fMerge = 1; init_file.fdr.fMerge = 1;
@ -4257,7 +4257,7 @@ read_seek (Size_t size, /* # bytes to read */
#ifndef MALLOC_CHECK #ifndef MALLOC_CHECK
ptr = allocate_multiple_pages ((size + PAGE_USIZE - 1) / PAGE_USIZE); ptr = allocate_multiple_pages ((size + PAGE_USIZE - 1) / PAGE_USIZE);
#else #else
ptr = (page_t *) xcalloc (1, size); ptr = xcalloc (1, size);
#endif #endif
/* If we need to seek, and the distance is nearby, just do some reads, /* If we need to seek, and the distance is nearby, just do some reads,
@ -4379,61 +4379,61 @@ copy_object (void)
file_offset = orig_file_header.f_symptr + sizeof (struct filehdr); file_offset = orig_file_header.f_symptr + sizeof (struct filehdr);
if (orig_sym_hdr.cbLine > 0) /* line numbers */ 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, orig_sym_hdr.cbLineOffset,
"Line numbers"); "Line numbers");
if (orig_sym_hdr.ipdMax > 0) /* procedure tables */ 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, orig_sym_hdr.cbPdOffset,
"Procedure tables"); "Procedure tables");
if (orig_sym_hdr.isymMax > 0) /* local symbols */ 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, orig_sym_hdr.cbSymOffset,
"Local symbols"); "Local symbols");
if (orig_sym_hdr.iauxMax > 0) /* aux 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, orig_sym_hdr.cbAuxOffset,
"Aux. symbols"); "Aux. symbols");
if (orig_sym_hdr.issMax > 0) /* local strings */ 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, orig_sym_hdr.cbSsOffset,
"Local strings"); "Local strings");
if (orig_sym_hdr.issExtMax > 0) /* external 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, orig_sym_hdr.cbSsExtOffset,
"External strings"); "External strings");
if (orig_sym_hdr.ifdMax > 0) /* file tables */ 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, orig_sym_hdr.cbFdOffset,
"File tables"); "File tables");
if (orig_sym_hdr.crfd > 0) /* relative file descriptors */ 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, orig_sym_hdr.cbRfdOffset,
"Relative file descriptors"); "Relative file descriptors");
if (orig_sym_hdr.issExtMax > 0) /* external symbols */ 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, orig_sym_hdr.cbExtOffset,
"External symbols"); "External symbols");
if (orig_sym_hdr.idnMax > 0) /* dense numbers */ 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, orig_sym_hdr.cbDnOffset,
"Dense numbers"); "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 */ 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, orig_sym_hdr.cbOptOffset,
"Optimizer symbols"); "Optimizer symbols");
@ -4464,7 +4464,7 @@ copy_object (void)
(in case there are duplicate filenames, we collapse them into one (in case there are duplicate filenames, we collapse them into one
file section, the MIPS assembler may or may not collapse them). */ 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++) for (fd = delete_ifd; fd < orig_sym_hdr.ifdMax; fd++)
{ {
@ -4972,7 +4972,7 @@ out_of_bounds (symint_t indx, /* index that is out of bounds */
STATIC page_t * STATIC page_t *
allocate_cluster (Size_t npages) allocate_cluster (Size_t npages)
{ {
page_t *value = (page_t *) xcalloc (npages, PAGE_USIZE); page_t *value = xcalloc (npages, PAGE_USIZE);
if (debug > 3) if (debug > 3)
fprintf (stderr, "\talloc\tnpages = %d, value = 0x%.8x\n", npages, value); fprintf (stderr, "\talloc\tnpages = %d, value = 0x%.8x\n", npages, value);
@ -5038,7 +5038,7 @@ allocate_multiple_pages (Size_t npages)
return allocate_cluster (npages); return allocate_cluster (npages);
#else /* MALLOC_CHECK */ #else /* MALLOC_CHECK */
return (page_t *) xcalloc (npages, PAGE_SIZE); return xcalloc (npages, PAGE_SIZE);
#endif /* MALLOC_CHECK */ #endif /* MALLOC_CHECK */
} }
@ -5089,7 +5089,7 @@ allocate_page (void)
return cluster_ptr++; return cluster_ptr++;
#else /* MALLOC_CHECK */ #else /* MALLOC_CHECK */
return (page_t *) xcalloc (1, PAGE_SIZE); return xcalloc (1, PAGE_SIZE);
#endif /* MALLOC_CHECK */ #endif /* MALLOC_CHECK */
} }
@ -5125,7 +5125,7 @@ allocate_scope (void)
} }
#else #else
ptr = (scope_t *) xmalloc (sizeof (scope_t)); ptr = xmalloc (sizeof (scope_t));
#endif #endif
@ -5175,7 +5175,7 @@ allocate_vlinks (void)
alloc_counts[ (int) alloc_type_vlinks ].unallocated = unallocated; alloc_counts[ (int) alloc_type_vlinks ].unallocated = unallocated;
#else #else
ptr = (vlinks_t *) xmalloc (sizeof (vlinks_t)); ptr = xmalloc (sizeof (vlinks_t));
#endif #endif
@ -5208,7 +5208,7 @@ allocate_shash (void)
alloc_counts[ (int) alloc_type_shash ].unallocated = unallocated; alloc_counts[ (int) alloc_type_shash ].unallocated = unallocated;
#else #else
ptr = (shash_t *) xmalloc (sizeof (shash_t)); ptr = xmalloc (sizeof (shash_t));
#endif #endif
@ -5241,7 +5241,7 @@ allocate_thash (void)
alloc_counts[ (int) alloc_type_thash ].unallocated = unallocated; alloc_counts[ (int) alloc_type_thash ].unallocated = unallocated;
#else #else
ptr = (thash_t *) xmalloc (sizeof (thash_t)); ptr = xmalloc (sizeof (thash_t));
#endif #endif
@ -5281,7 +5281,7 @@ allocate_tag (void)
} }
#else #else
ptr = (tag_t *) xmalloc (sizeof (tag_t)); ptr = xmalloc (sizeof (tag_t));
#endif #endif
@ -5338,7 +5338,7 @@ allocate_forward (void)
} }
#else #else
ptr = (forward_t *) xmalloc (sizeof (forward_t)); ptr = xmalloc (sizeof (forward_t));
#endif #endif
@ -5395,7 +5395,7 @@ allocate_thead (void)
} }
#else #else
ptr = (thead_t *) xmalloc (sizeof (thead_t)); ptr = xmalloc (sizeof (thead_t));
#endif #endif

View File

@ -110,7 +110,7 @@ munge (const char *filename)
struct deps * struct deps *
deps_init (void) 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. */ /* Allocate space for the vectors only if we need it. */
@ -155,7 +155,7 @@ deps_add_target (struct deps *d, const char *t, int quote)
if (d->ntargets == d->targets_size) if (d->ntargets == d->targets_size)
{ {
d->targets_size = d->targets_size * 2 + 4; 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 *)); d->targets_size * sizeof (const char *));
} }
@ -185,7 +185,7 @@ deps_add_default_target (struct deps *d, const char *tgt)
# define TARGET_OBJECT_SUFFIX ".o" # define TARGET_OBJECT_SUFFIX ".o"
#endif #endif
const char *start = lbasename (tgt); 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; char *suffix;
strcpy (o, start); strcpy (o, start);
@ -207,8 +207,7 @@ deps_add_dep (struct deps *d, const char *t)
if (d->ndeps == d->deps_size) if (d->ndeps == d->deps_size)
{ {
d->deps_size = d->deps_size * 2 + 8; d->deps_size = d->deps_size * 2 + 8;
d->depv = (const char **) d->depv = xrealloc (d->depv, d->deps_size * sizeof (const char *));
xrealloc (d->depv, d->deps_size * sizeof (const char *));
} }
d->depv[d->ndeps++] = t; d->depv[d->ndeps++] = t;
} }
@ -315,7 +314,7 @@ deps_restore (struct deps *deps, FILE *fd, const char *self)
unsigned int i, count; unsigned int i, count;
size_t num_to_read; size_t num_to_read;
size_t buf_size = 512; size_t buf_size = 512;
char *buf = (char *) xmalloc (buf_size); char *buf = xmalloc (buf_size);
/* Number of dependences. */ /* Number of dependences. */
if (fread (&count, 1, sizeof (count), fd) != sizeof (count)) if (fread (&count, 1, sizeof (count), fd) != sizeof (count))

View File

@ -5201,7 +5201,7 @@ static optab
new_optab (void) new_optab (void)
{ {
int i; 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++) for (i = 0; i < NUM_MACHINE_MODES; i++)
{ {
op->handlers[i].insn_code = CODE_FOR_nothing; op->handlers[i].insn_code = CODE_FOR_nothing;

View File

@ -43,10 +43,8 @@ void
add_params (const param_info params[], size_t n) add_params (const param_info params[], size_t n)
{ {
/* Allocate enough space for the new parameters. */ /* Allocate enough space for the new parameters. */
compiler_params = compiler_params = xrealloc (compiler_params,
((param_info *) (num_compiler_params + n) * sizeof (param_info));
xrealloc (compiler_params,
(num_compiler_params + n) * sizeof (param_info)));
/* Copy them into the table. */ /* Copy them into the table. */
memcpy (compiler_params + num_compiler_params, memcpy (compiler_params + num_compiler_params,
params, params,

View File

@ -377,11 +377,11 @@ reload_cse_simplify_operands (rtx insn, rtx testreg)
if (! constrain_operands (1)) if (! constrain_operands (1))
fatal_insn_not_found (insn); fatal_insn_not_found (insn);
alternative_reject = (int *) alloca (recog_data.n_alternatives * sizeof (int)); alternative_reject = alloca (recog_data.n_alternatives * sizeof (int));
alternative_nregs = (int *) alloca (recog_data.n_alternatives * sizeof (int)); alternative_nregs = alloca (recog_data.n_alternatives * sizeof (int));
alternative_order = (int *) alloca (recog_data.n_alternatives * sizeof (int)); alternative_order = alloca (recog_data.n_alternatives * sizeof (int));
memset ((char *) alternative_reject, 0, recog_data.n_alternatives * sizeof (int)); memset (alternative_reject, 0, recog_data.n_alternatives * sizeof (int));
memset ((char *) alternative_nregs, 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 each operand, find out which regs are equivalent. */
for (i = 0; i < recog_data.n_operands; i++) for (i = 0; i < recog_data.n_operands; i++)
@ -414,7 +414,7 @@ reload_cse_simplify_operands (rtx insn, rtx testreg)
int regno; int regno;
const char *p; 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++) for (j = 0; j < recog_data.n_alternatives; j++)
op_alt_regno[i][j] = -1; op_alt_regno[i][j] = -1;
@ -659,7 +659,7 @@ reload_combine (void)
destination. */ destination. */
min_labelno = get_first_label_num (); min_labelno = get_first_label_num ();
n_labels = max_label_num () - min_labelno; 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); CLEAR_HARD_REG_SET (ever_live_at_start);
FOR_EACH_BB_REVERSE (bb) FOR_EACH_BB_REVERSE (bb)

View File

@ -155,12 +155,12 @@ lookup_key (char *key)
} }
size = 32; size = 32;
dst = (char *) xmalloc (size); dst = xmalloc (size);
res = RegQueryValueExA (reg_key, key, 0, &type, dst, &size); res = RegQueryValueExA (reg_key, key, 0, &type, dst, &size);
if (res == ERROR_MORE_DATA && type == REG_SZ) 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); res = RegQueryValueExA (reg_key, key, 0, &type, dst, &size);
} }
@ -197,7 +197,7 @@ translate_name (char *name)
keylen++) keylen++)
; ;
key = (char *) alloca (keylen + 1); key = alloca (keylen + 1);
strncpy (key, &name[1], keylen); strncpy (key, &name[1], keylen);
key[keylen] = 0; key[keylen] = 0;

View File

@ -49,7 +49,7 @@ static struct bucket **table;
void void
debug_tree (tree node) 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); print_node (stderr, "", node, 0);
free (table); free (table);
table = 0; table = 0;
@ -200,7 +200,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
} }
/* Add this node to the table. */ /* Add this node to the table. */
b = (struct bucket *) xmalloc (sizeof (struct bucket)); b = xmalloc (sizeof (struct bucket));
b->node = node; b->node = node;
b->next = table[hash]; b->next = table[hash];
table[hash] = b; table[hash] = b;

View File

@ -521,7 +521,7 @@ notice (const char *msgid, ...)
static char * static char *
savestring (const char *input, unsigned int size) savestring (const char *input, unsigned int size)
{ {
char *output = (char *) xmalloc (size + 1); char *output = xmalloc (size + 1);
strcpy (output, input); strcpy (output, input);
return output; return output;
} }
@ -542,7 +542,7 @@ fancy_abort (void)
static char * static char *
dupnstr (const char *s, size_t n) 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); strncpy (ret_val, s, n);
ret_val[n] = '\0'; ret_val[n] = '\0';
@ -692,7 +692,7 @@ in_system_include_dir (const char *path)
static int static int
file_could_be_converted (const char *path) 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)) if (access (path, R_OK))
return 0; return 0;
@ -898,8 +898,7 @@ file_excluded_p (const char *name)
static struct string_list * static struct string_list *
string_list_cons (const char *string, struct string_list *rest) string_list_cons (const char *string, struct string_list *rest)
{ {
struct string_list *temp struct string_list *temp = xmalloc (sizeof (struct string_list));
= (struct string_list *) xmalloc (sizeof (struct string_list));
temp->next = rest; temp->next = rest;
temp->name = string; temp->name = string;
@ -973,7 +972,7 @@ lookup (hash_table_entry *hash_tab_p, const char *search_symbol)
if (!strcmp (p->symbol, search_symbol)) if (!strcmp (p->symbol, search_symbol))
return p; 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; p = p->hash_next;
return add_symbol (p, search_symbol); return add_symbol (p, search_symbol);
} }
@ -1022,7 +1021,7 @@ unexpand_if_needed (const char *aux_info_line)
if (line_buf == 0) if (line_buf == 0)
{ {
line_buf_size = 1024; line_buf_size = 1024;
line_buf = (char *) xmalloc (line_buf_size); line_buf = xmalloc (line_buf_size);
} }
copy_p = line_buf; copy_p = line_buf;
@ -1045,7 +1044,7 @@ unexpand_if_needed (const char *aux_info_line)
int offset = copy_p - line_buf; int offset = copy_p - line_buf;
line_buf_size *= 2; line_buf_size *= 2;
line_buf_size += size; 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; copy_p = line_buf + offset;
} }
strcpy (copy_p, unexp_p->contracted); strcpy (copy_p, unexp_p->contracted);
@ -1062,7 +1061,7 @@ unexpand_if_needed (const char *aux_info_line)
{ {
int offset = copy_p - line_buf; int offset = copy_p - line_buf;
line_buf_size *= 2; 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 = line_buf + offset;
} }
*copy_p++ = *s++; *copy_p++ = *s++;
@ -1072,7 +1071,7 @@ continue_outer: ;
{ {
int offset = copy_p - line_buf; int offset = copy_p - line_buf;
line_buf_size *= 2; 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 = line_buf + offset;
} }
*copy_p++ = '\n'; *copy_p++ = '\n';
@ -1096,8 +1095,7 @@ abspath (const char *cwd, const char *rel_filename)
{ {
/* Setup the current working directory as needed. */ /* Setup the current working directory as needed. */
const char *const cwd2 = (cwd) ? cwd : cwd_buffer; const char *const cwd2 = (cwd) ? cwd : cwd_buffer;
char *const abs_buffer char *const abs_buffer = alloca (strlen (cwd2) + strlen (rel_filename) + 2);
= (char *) alloca (strlen (cwd2) + strlen (rel_filename) + 2);
char *endp = abs_buffer; char *endp = abs_buffer;
char *outp, *inp; char *outp, *inp;
@ -1219,7 +1217,7 @@ shortpath (const char *cwd, const char *filename)
size_t filename_len = strlen (filename); size_t filename_len = strlen (filename);
path_p = abspath (cwd, 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)) while (*cwd_p && IS_SAME_PATH_CHAR (*cwd_p, *path_p))
{ {
@ -1306,7 +1304,7 @@ find_file (const char *filename, int do_not_stat)
else else
{ {
struct stat stat_buf; 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 /* If we cannot get status on any given source file, give a warning
and then just set its time of last modification to infinity. */ and then just set its time of last modification to infinity. */
@ -1404,7 +1402,7 @@ referenced_file_is_newer (const char *l, time_t aux_info_mtime)
#endif #endif
) )
p++; 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)); strncpy (filename, filename_start, (size_t) (p - filename_start));
filename[p-filename_start] = '\0'; filename[p-filename_start] = '\0';
} }
@ -1439,7 +1437,7 @@ save_def_or_dec (const char *l, int is_syscalls)
{ {
const char *p; const char *p;
const char *semicolon_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 #ifndef UNPROTOIZE
def_dec_p->written = 0; def_dec_p->written = 0;
@ -1464,7 +1462,7 @@ save_def_or_dec (const char *l, int is_syscalls)
#endif #endif
) )
p++; 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)); strncpy (filename, filename_start, (size_t) (p - filename_start));
filename[p-filename_start] = '\0'; filename[p-filename_start] = '\0';
@ -1594,8 +1592,7 @@ save_def_or_dec (const char *l, int is_syscalls)
const char *left_paren_p = find_corresponding_lparen (p); const char *left_paren_p = find_corresponding_lparen (p);
#ifndef UNPROTOIZE #ifndef UNPROTOIZE
{ {
f_list_chain_item *cip f_list_chain_item *cip = xmalloc (sizeof (f_list_chain_item));
= (f_list_chain_item *) xmalloc (sizeof (f_list_chain_item));
cip->formals_list cip->formals_list
= dupnstr (left_paren_p + 1, (size_t) (p - (left_paren_p+1))); = dupnstr (left_paren_p + 1, (size_t) (p - (left_paren_p+1)));
@ -1637,7 +1634,7 @@ save_def_or_dec (const char *l, int is_syscalls)
/* p now points to the leftmost character of the function name. */ /* 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)); strncpy (fn_string, p, (size_t) (past_fn - p));
fn_string[past_fn-p] = '\0'; fn_string[past_fn-p] = '\0';
@ -1833,7 +1830,7 @@ munge_compile_params (const char *params_list)
/* Build up the contents in a temporary vector /* Build up the contents in a temporary vector
that is so big that to has to be big enough. */ that is so big that to has to be big enough. */
const char **temp_params const char **temp_params
= (const char **) alloca ((strlen (params_list) + 8) * sizeof (char *)); = alloca ((strlen (params_list) + 8) * sizeof (char *));
int param_count = 0; int param_count = 0;
const char *param; const char *param;
struct stat st; struct stat st;
@ -1902,8 +1899,7 @@ munge_compile_params (const char *params_list)
/* Make a copy of the compile_params in heap space. */ /* Make a copy of the compile_params in heap space. */
compile_params compile_params = xmalloc (sizeof (char *) * (param_count+1));
= (const char **) xmalloc (sizeof (char *) * (param_count+1));
memcpy (compile_params, temp_params, sizeof (char *) * param_count); memcpy (compile_params, temp_params, sizeof (char *) * param_count);
} }
@ -1979,8 +1975,7 @@ process_aux_info_file (const char *base_source_filename, int keep_it,
int is_syscalls) int is_syscalls)
{ {
size_t base_len = strlen (base_source_filename); size_t base_len = strlen (base_source_filename);
char * aux_info_filename char * aux_info_filename = alloca (base_len + strlen (aux_info_suffix) + 1);
= (char *) alloca (base_len + strlen (aux_info_suffix) + 1);
char *aux_info_base; char *aux_info_base;
char *aux_info_limit; char *aux_info_limit;
char *aux_info_relocated_name; char *aux_info_relocated_name;
@ -2309,8 +2304,8 @@ rename_c_file (const hash_table_entry *hp)
{ {
const char *filename = hp->symbol; const char *filename = hp->symbol;
int last_char_index = strlen (filename) - 1; int last_char_index = strlen (filename) - 1;
char *const new_filename = (char *) alloca (strlen (filename) char *const new_filename = alloca (strlen (filename)
+ strlen (cplus_suffix) + 1); + strlen (cplus_suffix) + 1);
/* Note that we don't care here if the given file was converted or not. It /* 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 is possible that the given file was *not* converted, simply because there
@ -2517,7 +2512,7 @@ find_extern_def (const def_dec_info *head, const def_dec_info *user)
{ {
/* Why copy this string into `needed' at all? /* Why copy this string into `needed' at all?
Why not just use user->ansi_decl without copying? */ 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; char *p;
strcpy (needed, user->ansi_decl); strcpy (needed, user->ansi_decl);
@ -2815,7 +2810,7 @@ output_bytes (const char *str, size_t len)
if ((repl_write_ptr + 1) + len >= repl_text_limit) if ((repl_write_ptr + 1) + len >= repl_text_limit)
{ {
size_t new_size = (repl_text_limit - repl_text_base) << 1; 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_write_ptr = new_buf + (repl_write_ptr - repl_text_base);
repl_text_base = new_buf; repl_text_base = new_buf;
@ -3887,7 +3882,7 @@ scan_for_missed_items (const file_info *file_p)
goto not_missed; goto not_missed;
{ {
char *func_name = (char *) alloca (id_length + 1); char *func_name = alloca (id_length + 1);
static const char * const stmt_keywords[] static const char * const stmt_keywords[]
= { "if", "else", "do", "while", "for", "switch", "case", "return", 0 }; = { "if", "else", "do", "while", "for", "switch", "case", "return", 0 };
const char * const *stmt_keyword; const char * const *stmt_keyword;
@ -4010,12 +4005,12 @@ edit_file (const hash_table_entry *hp)
/* Allocate a buffer to hold the original text. */ /* 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; 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. */ /* 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_text_limit = new_clean_text_limit = new_clean_text_base + orig_size;
clean_read_ptr = clean_text_base - 1; clean_read_ptr = clean_text_base - 1;
@ -4025,7 +4020,7 @@ edit_file (const hash_table_entry *hp)
buffer can be expanded later as needed. */ buffer can be expanded later as needed. */
repl_size = orig_size + (orig_size >> 2) + 4096; 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_text_limit = repl_text_base + repl_size - 1;
repl_write_ptr = repl_text_base - 1; repl_write_ptr = repl_text_base - 1;
@ -4083,7 +4078,7 @@ edit_file (const hash_table_entry *hp)
{ {
int clean_file; int clean_file;
size_t clean_size = orig_text_limit - orig_text_base; 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. */ /* Open (and create) the clean file. */
@ -4183,7 +4178,7 @@ edit_file (const hash_table_entry *hp)
if (!nosave_flag) if (!nosave_flag)
{ {
char *new_filename 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); strcpy (new_filename, convert_filename);
#ifdef __MSDOS__ #ifdef __MSDOS__
@ -4310,8 +4305,8 @@ do_processing (void)
if (nondefault_syscalls_dir) if (nondefault_syscalls_dir)
{ {
syscalls_absolute_filename syscalls_absolute_filename
= (char *) xmalloc (strlen (nondefault_syscalls_dir) + 1 = xmalloc (strlen (nondefault_syscalls_dir) + 1
+ sizeof (syscalls_filename)); + sizeof (syscalls_filename));
strcpy (syscalls_absolute_filename, nondefault_syscalls_dir); strcpy (syscalls_absolute_filename, nondefault_syscalls_dir);
} }
else else
@ -4322,10 +4317,10 @@ do_processing (void)
default_syscalls_dir = standard_exec_prefix; default_syscalls_dir = standard_exec_prefix;
} }
syscalls_absolute_filename syscalls_absolute_filename
= (char *) xmalloc (strlen (default_syscalls_dir) + 0 = xmalloc (strlen (default_syscalls_dir) + 0
+ strlen (target_machine) + 1 + strlen (target_machine) + 1
+ strlen (target_version) + 1 + strlen (target_version) + 1
+ sizeof (syscalls_filename)); + sizeof (syscalls_filename));
strcpy (syscalls_absolute_filename, default_syscalls_dir); strcpy (syscalls_absolute_filename, default_syscalls_dir);
strcat (syscalls_absolute_filename, target_machine); strcat (syscalls_absolute_filename, target_machine);
strcat (syscalls_absolute_filename, "/"); strcat (syscalls_absolute_filename, "/");
@ -4528,7 +4523,7 @@ main (int argc, char **const argv)
/* Now actually make a list of the base source filenames. */ /* Now actually make a list of the base source filenames. */
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; n_base_source_files = 0;
for (; optind < argc; optind++) for (; optind < argc; optind++)
{ {

View File

@ -331,8 +331,7 @@ get_sub_conflicts (wp, size_word)
bitmap b = find_sub_conflicts (wp, size_word); bitmap b = find_sub_conflicts (wp, size_word);
if (!b) if (!b)
{ {
struct tagged_conflict *cl = struct tagged_conflict *cl = ra_alloc (sizeof *cl);
(struct tagged_conflict *) ra_alloc (sizeof *cl);
cl->conflicts = BITMAP_XMALLOC (); cl->conflicts = BITMAP_XMALLOC ();
cl->size_word = size_word; cl->size_word = size_word;
cl->next = wp->sub_conflicts; cl->next = wp->sub_conflicts;
@ -583,10 +582,10 @@ remember_move (insn)
subwebs could be source and target of coalescing). */ subwebs could be source and target of coalescing). */
if (GET_CODE (s) == REG && GET_CODE (d) == REG) 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; struct move_list *ml;
m->insn = insn; m->insn = insn;
ml = (struct move_list *) ra_alloc (sizeof (struct move_list)); ml = ra_alloc (sizeof (struct move_list));
ml->move = m; ml->move = m;
ml->next = wl_moves; ml->next = wl_moves;
wl_moves = ml; wl_moves = ml;
@ -1112,8 +1111,7 @@ init_bb_info ()
basic_block bb; basic_block bb;
FOR_ALL_BB (bb) FOR_ALL_BB (bb)
{ {
struct ra_bb_info *info = struct ra_bb_info *info = xcalloc (1, sizeof *info);
(struct ra_bb_info *) xcalloc (1, sizeof *info);
info->regnos_mentioned = BITMAP_XMALLOC (); info->regnos_mentioned = BITMAP_XMALLOC ();
info->live_throughout = BITMAP_XMALLOC (); info->live_throughout = BITMAP_XMALLOC ();
info->old_aux = bb->aux; info->old_aux = bb->aux;
@ -1149,9 +1147,8 @@ build_web_parts_and_conflicts (df)
struct curr_use use; struct curr_use use;
basic_block bb; basic_block bb;
number_seen = (int *) xcalloc (get_max_uid (), sizeof (int)); number_seen = xcalloc (get_max_uid (), sizeof (int));
visit_trace = (struct visit_trace *) xcalloc (get_max_uid (), visit_trace = xcalloc (get_max_uid (), sizeof (visit_trace[0]));
sizeof (visit_trace[0]));
update_regnos_mentioned (); update_regnos_mentioned ();
/* Here's the main loop. /* Here's the main loop.
@ -1252,7 +1249,7 @@ init_one_web_common (web, reg)
web->orig_x = reg; web->orig_x = reg;
if (!web->dlink) if (!web->dlink)
{ {
web->dlink = (struct dlist *) ra_calloc (sizeof (struct dlist)); web->dlink = ra_calloc (sizeof (struct dlist));
DLIST_WEB (web->dlink) = web; DLIST_WEB (web->dlink) = web;
} }
/* XXX /* XXX
@ -1384,7 +1381,7 @@ add_subweb (web, reg)
struct web *w; struct web *w;
if (GET_CODE (reg) != SUBREG) if (GET_CODE (reg) != SUBREG)
abort (); abort ();
w = (struct web *) xmalloc (sizeof (struct web)); w = xmalloc (sizeof (struct web));
/* Copy most content from parent-web. */ /* Copy most content from parent-web. */
*w = *web; *w = *web;
/* And initialize the private stuff. */ /* And initialize the private stuff. */
@ -1519,7 +1516,7 @@ copy_conflict_list (web)
for (cl = web->conflict_list; cl; cl = cl->next) for (cl = web->conflict_list; cl; cl = cl->next)
{ {
struct conflict_link *ncl; struct conflict_link *ncl;
ncl = (struct conflict_link *) ra_alloc (sizeof *ncl); ncl = ra_alloc (sizeof *ncl);
ncl->t = cl->t; ncl->t = cl->t;
ncl->sub = NULL; ncl->sub = NULL;
ncl->next = web->orig_conflict_list; ncl->next = web->orig_conflict_list;
@ -1529,7 +1526,7 @@ copy_conflict_list (web)
struct sub_conflict *sl, *nsl; struct sub_conflict *sl, *nsl;
for (sl = cl->sub; sl; sl = sl->next) 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->s = sl->s;
nsl->t = sl->t; nsl->t = sl->t;
nsl->next = ncl->sub; nsl->next = ncl->sub;
@ -1571,7 +1568,7 @@ add_conflict_edge (from, to)
copy_conflict_list (pfrom); copy_conflict_list (pfrom);
if (!TEST_BIT (sup_igraph, (pfrom->id * num_webs + pto->id))) 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->t = pto;
cl->sub = NULL; cl->sub = NULL;
cl->next = pfrom->conflict_list; cl->next = pfrom->conflict_list;
@ -1596,7 +1593,7 @@ add_conflict_edge (from, to)
means we are not interested in this subconflict. */ means we are not interested in this subconflict. */
if (!may_delete || cl->sub != NULL) if (!may_delete || cl->sub != NULL)
{ {
sl = (struct sub_conflict *) ra_alloc (sizeof (*sl)); sl = ra_alloc (sizeof (*sl));
sl->s = from; sl->s = from;
sl->t = to; sl->t = to;
sl->next = cl->sub; sl->next = cl->sub;
@ -1698,8 +1695,8 @@ copy_web (web, wl)
struct web *web; struct web *web;
struct web_link **wl; struct web_link **wl;
{ {
struct web *cweb = (struct web *) xmalloc (sizeof *cweb); struct web *cweb = xmalloc (sizeof *cweb);
struct web_link *link = (struct web_link *) ra_alloc (sizeof *link); struct web_link *link = ra_alloc (sizeof *link);
link->next = *wl; link->next = *wl;
*wl = link; *wl = link;
link->web = cweb; link->web = cweb;
@ -1776,11 +1773,9 @@ init_webs_defs_uses ()
continue; continue;
} }
if (web->num_defs) if (web->num_defs)
web->defs = (struct ref **) xmalloc (web->num_defs * web->defs = xmalloc (web->num_defs * sizeof (web->defs[0]));
sizeof (web->defs[0]));
if (web->num_uses) if (web->num_uses)
web->uses = (struct ref **) xmalloc (web->num_uses * web->uses = xmalloc (web->num_uses * sizeof (web->uses[0]));
sizeof (web->uses[0]));
def_i = use_i = 0; def_i = use_i = 0;
for (link = web->temp_refs; link; link = link->next) for (link = web->temp_refs; link; link = link->next)
{ {
@ -1840,7 +1835,7 @@ parts_to_webs_1 (df, copy_webs, all_refs)
allocate a new one. */ allocate a new one. */
if (ra_pass == 1) if (ra_pass == 1)
{ {
web = (struct web *) xmalloc (sizeof (struct web)); web = xmalloc (sizeof (struct web));
newid = last_num_webs++; newid = last_num_webs++;
init_one_web (web, GET_CODE (reg) == SUBREG init_one_web (web, GET_CODE (reg) == SUBREG
? SUBREG_REG (reg) : reg); ? SUBREG_REG (reg) : reg);
@ -1873,7 +1868,7 @@ parts_to_webs_1 (df, copy_webs, all_refs)
else else
{ {
/* Else allocate a new one. */ /* Else allocate a new one. */
web = (struct web *) xmalloc (sizeof (struct web)); web = xmalloc (sizeof (struct web));
newid = last_num_webs++; newid = last_num_webs++;
} }
} }
@ -2032,8 +2027,7 @@ parts_to_webs (df)
num_subwebs = 0; num_subwebs = 0;
/* First build webs and ordinary subwebs. */ /* First build webs and ordinary subwebs. */
all_refs = (struct df_link *) xcalloc (df->def_id + df->use_id, all_refs = xcalloc (df->def_id + df->use_id, sizeof (all_refs[0]));
sizeof (all_refs[0]));
webnum = parts_to_webs_1 (df, &copy_webs, all_refs); webnum = parts_to_webs_1 (df, &copy_webs, all_refs);
/* Setup the webs for hardregs which are still missing (weren't /* Setup the webs for hardregs which are still missing (weren't
@ -2041,7 +2035,7 @@ parts_to_webs (df)
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (!hardreg2web[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)); init_one_web (web, gen_rtx_REG (reg_raw_mode[i], i));
web->id = last_num_webs++; web->id = last_num_webs++;
hardreg2web[web->regno] = web; hardreg2web[web->regno] = web;
@ -2089,7 +2083,7 @@ parts_to_webs (df)
} }
/* Now that everyone has an ID, we can setup the id2web array. */ /* 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) for (d = WEBS(INITIAL); d; d = d->next)
{ {
struct web *web = DLIST_WEB (d); struct web *web = DLIST_WEB (d);
@ -2243,7 +2237,7 @@ conflicts_between_webs (df)
#endif #endif
bitmap ignore_defs = BITMAP_XMALLOC (); bitmap ignore_defs = BITMAP_XMALLOC ();
unsigned int have_ignored; 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; unsigned int pass = 0;
if (ra_pass > 1) if (ra_pass > 1)
@ -2831,8 +2825,7 @@ moves_to_webs (df)
for (; test && test->move != m; test = test->next); for (; test && test->move != m; test = test->next);
if (! test) if (! test)
{ {
newml = (struct move_list*) newml = ra_alloc (sizeof (struct move_list));
ra_alloc (sizeof (struct move_list));
newml->move = m; newml->move = m;
newml->next = m->source_web->moves; newml->next = m->source_web->moves;
m->source_web->moves = newml; m->source_web->moves = newml;
@ -2841,8 +2834,7 @@ moves_to_webs (df)
for (; test && test->move != m; test = test->next); for (; test && test->move != m; test = test->next);
if (! test) if (! test)
{ {
newml = (struct move_list*) newml = ra_alloc (sizeof (struct move_list));
ra_alloc (sizeof (struct move_list));
newml->move = m; newml->move = m;
newml->next = m->target_web->moves; newml->next = m->target_web->moves;
m->target_web->moves = newml; m->target_web->moves = newml;
@ -3079,10 +3071,8 @@ ra_build_realloc (df)
unsigned int i; unsigned int i;
struct dlist *d; struct dlist *d;
move_handled = sbitmap_alloc (get_max_uid () ); move_handled = sbitmap_alloc (get_max_uid () );
web_parts = (struct web_part *) xcalloc (df->def_id + df->use_id, web_parts = xcalloc (df->def_id + df->use_id, sizeof web_parts[0]);
sizeof web_parts[0]); def2web = xcalloc (df->def_id + df->use_id, sizeof def2web[0]);
def2web = (struct web **) xcalloc (df->def_id + df->use_id,
sizeof def2web[0]);
use2web = &def2web[df->def_id]; use2web = &def2web[df->def_id];
live_over_abnormal = sbitmap_alloc (df->use_id); live_over_abnormal = sbitmap_alloc (df->use_id);
sbitmap_zero (live_over_abnormal); sbitmap_zero (live_over_abnormal);
@ -3172,14 +3162,12 @@ ra_build_realloc (df)
if (!last_max_uid) if (!last_max_uid)
{ {
/* Setup copy cache, for copy_insn_p (). */ /* Setup copy cache, for copy_insn_p (). */
copy_cache = (struct copy_p_cache *) copy_cache = xcalloc (get_max_uid (), sizeof (copy_cache[0]));
xcalloc (get_max_uid (), sizeof (copy_cache[0]));
init_bb_info (); init_bb_info ();
} }
else else
{ {
copy_cache = (struct copy_p_cache *) copy_cache = xrealloc (copy_cache, get_max_uid () * sizeof (copy_cache[0]));
xrealloc (copy_cache, get_max_uid () * sizeof (copy_cache[0]));
memset (&copy_cache[last_max_uid], 0, memset (&copy_cache[last_max_uid], 0,
(get_max_uid () - last_max_uid) * sizeof (copy_cache[0])); (get_max_uid () - last_max_uid) * sizeof (copy_cache[0]));
} }

View File

@ -348,7 +348,7 @@ build_worklists (df)
unsigned int i, num, max_num; unsigned int i, num, max_num;
struct web **order2web; struct web **order2web;
max_num = num_webs - num_subwebs; 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++) for (i = 0, num = 0; i < max_num; i++)
if (id2web[i]->regno >= max_normal_pseudo) if (id2web[i]->regno >= max_normal_pseudo)
order2web[num++] = id2web[i]; order2web[num++] = id2web[i];
@ -397,7 +397,7 @@ build_worklists (df)
if (ml->move) if (ml->move)
{ {
struct move *m = 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; DLIST_MOVE (d) = m;
m->dlink = d; m->dlink = d;
put_move (m, WORKLIST); put_move (m, WORKLIST);
@ -1702,11 +1702,10 @@ try_recolor_web (web)
int newcol, c; int newcol, c;
HARD_REG_SET precolored_neighbors, spill_temps; HARD_REG_SET precolored_neighbors, spill_temps;
HARD_REG_SET possible_begin, wide_seen; HARD_REG_SET possible_begin, wide_seen;
cost_neighbors = (unsigned HOST_WIDE_INT *) cost_neighbors = xcalloc (FIRST_PSEUDO_REGISTER, sizeof (cost_neighbors[0]));
xcalloc (FIRST_PSEUDO_REGISTER, sizeof (cost_neighbors[0]));
/* For each hard-regs count the number of preceding hardregs, which /* For each hard-regs count the number of preceding hardregs, which
would overlap this color, if used in WEB's mode. */ 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); CLEAR_HARD_REG_SET (possible_begin);
for (c = 0; c < FIRST_PSEUDO_REGISTER; c++) for (c = 0; c < FIRST_PSEUDO_REGISTER; c++)
{ {
@ -1805,7 +1804,7 @@ try_recolor_web (web)
remove_list (web->dlink, &WEBS(SPILLED)); remove_list (web->dlink, &WEBS(SPILLED));
put_web (web, COLORED); put_web (web, COLORED);
web->color = newcol; 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) for (wl = web->conflict_list; wl; wl = wl_next)
{ {
struct web *web2 = alias (wl->t); struct web *web2 = alias (wl->t);
@ -1972,7 +1971,7 @@ recolor_spills ()
unsigned int i, num; unsigned int i, num;
struct web **order2web; struct web **order2web;
num = num_webs - num_subwebs; 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++) for (i = 0; i < num; i++)
{ {
order2web[i] = id2web[i]; order2web[i] = id2web[i];
@ -2431,7 +2430,7 @@ add_web_pair_cost (web1, web2, cost, conflicts)
p->conflicts += conflicts; p->conflicts += conflicts;
return; return;
} }
p = (struct web_pair *) ra_alloc (sizeof *p); p = ra_alloc (sizeof *p);
p->next_hash = web_pair_hash[hash]; p->next_hash = web_pair_hash[hash];
p->next_list = web_pair_list; p->next_list = web_pair_list;
p->smaller = web1; p->smaller = web1;
@ -2477,7 +2476,7 @@ sort_and_combine_web_pairs (for_move)
struct web_pair *p; struct web_pair *p;
if (!num_web_pairs) if (!num_web_pairs)
return; 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) for (p = web_pair_list, i = 0; p; p = p->next_list)
sorted[i++] = p; sorted[i++] = p;
if (i != num_web_pairs) if (i != num_web_pairs)

View File

@ -329,8 +329,7 @@ static void
choose_spill_colors () choose_spill_colors ()
{ {
struct dlist *d; struct dlist *d;
unsigned HOST_WIDE_INT *costs = (unsigned HOST_WIDE_INT *) unsigned HOST_WIDE_INT *costs = xmalloc (FIRST_PSEUDO_REGISTER * sizeof (costs[0]));
xmalloc (FIRST_PSEUDO_REGISTER * sizeof (costs[0]));
for (d = WEBS(SPILLED); d; d = d->next) for (d = WEBS(SPILLED); d; d = d->next)
{ {
struct web *web = DLIST_WEB (d); struct web *web = DLIST_WEB (d);
@ -545,7 +544,7 @@ remember_slot (list, x)
{ {
struct rtx_list *l; struct rtx_list *l;
/* PRE: X is not already in LIST. */ /* PRE: X is not already in LIST. */
l = (struct rtx_list *) ra_alloc (sizeof (*l)); l = ra_alloc (sizeof (*l));
l->next = *list; l->next = *list;
l->x = x; l->x = x;
*list = l; *list = l;
@ -1089,7 +1088,7 @@ rewrite_program2 (new_deaths)
int nl_first_reload; int nl_first_reload;
struct rewrite_info ri; struct rewrite_info ri;
rtx insn; 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.need_reload = BITMAP_XMALLOC ();
ri.scratch = BITMAP_XMALLOC (); ri.scratch = BITMAP_XMALLOC ();
ri.live = sbitmap_alloc (num_webs); ri.live = sbitmap_alloc (num_webs);
@ -1750,7 +1749,7 @@ emit_colors (df)
} }
ra_max_regno = max_regno = max_reg_num (); ra_max_regno = max_regno = max_reg_num ();
allocate_reg_info (max_regno, FALSE, FALSE); 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++) for (si = 0; si < max_regno; si++)
ra_reg_renumber[si] = -1; ra_reg_renumber[si] = -1;

View File

@ -375,8 +375,7 @@ alloc_mem (df)
ra_build_realloc (df); ra_build_realloc (df);
if (!live_at_end) if (!live_at_end)
{ {
live_at_end = (bitmap *) xmalloc ((last_basic_block + 2) live_at_end = xmalloc ((last_basic_block + 2) * sizeof (bitmap));
* sizeof (bitmap));
for (i = 0; i < last_basic_block + 2; i++) for (i = 0; i < last_basic_block + 2; i++)
live_at_end[i] = BITMAP_XMALLOC (); live_at_end[i] = BITMAP_XMALLOC ();
live_at_end += 2; live_at_end += 2;
@ -907,7 +906,7 @@ reg_alloc ()
"after allocation/spilling, before reload", NULL); "after allocation/spilling, before reload", NULL);
/* Allocate the reg_equiv_memory_loc array for reload. */ /* 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. */ /* And possibly initialize it. */
allocate_initial_values (reg_equiv_memory_loc); allocate_initial_values (reg_equiv_memory_loc);
/* And one last regclass pass just before reload. */ /* And one last regclass pass just before reload. */

View File

@ -150,8 +150,8 @@ check_asm_operands (rtx x)
if (noperands == 0) if (noperands == 0)
return 1; return 1;
operands = (rtx *) alloca (noperands * sizeof (rtx)); operands = alloca (noperands * sizeof (rtx));
constraints = (const char **) alloca (noperands * sizeof (char *)); constraints = alloca (noperands * sizeof (char *));
decode_asm_operands (x, operands, NULL, constraints, NULL); decode_asm_operands (x, operands, NULL, constraints, NULL);
@ -226,9 +226,7 @@ validate_change (rtx object, rtx *loc, rtx new, int in_group)
else else
changes_allocated *= 2; changes_allocated *= 2;
changes = changes = xrealloc (changes, sizeof (change_t) * changes_allocated);
(change_t*) xrealloc (changes,
sizeof (change_t) * changes_allocated);
} }
changes[num_changes].object = object; changes[num_changes].object = object;

View File

@ -630,7 +630,7 @@ check_asm_stack_operands (rtx insn)
if (GET_CODE (body) == PARALLEL) 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++) for (i = 0; i < XVECLEN (body, 0); i++)
if (GET_CODE (XVECEXP (body, 0, i)) == CLOBBER) if (GET_CODE (XVECEXP (body, 0, i)) == CLOBBER)
@ -1946,9 +1946,9 @@ subst_asm_stack_regs (rtx insn, stack regstack)
for (i = 0, note = REG_NOTES (insn); note; note = XEXP (note, 1)) for (i = 0, note = REG_NOTES (insn); note; note = XEXP (note, 1))
i++; i++;
note_reg = (rtx *) alloca (i * sizeof (rtx)); note_reg = alloca (i * sizeof (rtx));
note_loc = (rtx **) alloca (i * sizeof (rtx *)); note_loc = alloca (i * sizeof (rtx *));
note_kind = (enum reg_note *) alloca (i * sizeof (enum reg_note)); note_kind = alloca (i * sizeof (enum reg_note));
n_notes = 0; n_notes = 0;
for (note = REG_NOTES (insn); note; note = XEXP (note, 1)) for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
@ -1979,8 +1979,8 @@ subst_asm_stack_regs (rtx insn, stack regstack)
if (GET_CODE (body) == PARALLEL) if (GET_CODE (body) == PARALLEL)
{ {
clobber_reg = (rtx *) alloca (XVECLEN (body, 0) * sizeof (rtx)); clobber_reg = alloca (XVECLEN (body, 0) * sizeof (rtx));
clobber_loc = (rtx **) alloca (XVECLEN (body, 0) * sizeof (rtx *)); clobber_loc = alloca (XVECLEN (body, 0) * sizeof (rtx *));
for (i = 0; i < XVECLEN (body, 0); i++) for (i = 0; i < XVECLEN (body, 0); i++)
if (GET_CODE (XVECEXP (body, 0, i)) == CLOBBER) if (GET_CODE (XVECEXP (body, 0, i)) == CLOBBER)
@ -2800,7 +2800,7 @@ convert_regs_2 (FILE *file, basic_block block)
basic_block *stack, *sp; basic_block *stack, *sp;
int inserted; int inserted;
stack = (basic_block *) xmalloc (sizeof (*stack) * n_basic_blocks); stack = xmalloc (sizeof (*stack) * n_basic_blocks);
sp = stack; sp = stack;
*sp++ = block; *sp++ = block;

View File

@ -311,7 +311,7 @@ init_reg_sets_1 (void)
/* Compute number of hard regs in each class. */ /* 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 (i = 0; i < N_REG_CLASSES; i++)
for (j = 0; j < FIRST_PSEUDO_REGISTER; j++) for (j = 0; j < FIRST_PSEUDO_REGISTER; j++)
if (TEST_HARD_REG_BIT (reg_class_contents[i], j)) if (TEST_HARD_REG_BIT (reg_class_contents[i], j))
@ -1202,11 +1202,11 @@ regclass (rtx f, int nregs, FILE *dump)
init_recog (); init_recog ();
costs = (struct costs *) xmalloc (nregs * sizeof (struct costs)); costs = xmalloc (nregs * sizeof (struct costs));
#ifdef FORBIDDEN_INC_DEC_CLASSES #ifdef FORBIDDEN_INC_DEC_CLASSES
in_inc_dec = (char *) xmalloc (nregs); in_inc_dec = xmalloc (nregs);
#endif /* FORBIDDEN_INC_DEC_CLASSES */ #endif /* FORBIDDEN_INC_DEC_CLASSES */
@ -1223,7 +1223,7 @@ regclass (rtx f, int nregs, FILE *dump)
fprintf (dump, "\n\nPass %i\n\n",pass); fprintf (dump, "\n\nPass %i\n\n",pass);
/* Zero out our accumulation of the cost of each class for each reg. */ /* 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 #ifdef FORBIDDEN_INC_DEC_CLASSES
memset (in_inc_dec, 0, nregs); memset (in_inc_dec, 0, nregs);
@ -1423,7 +1423,7 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops,
if (*p == 0) if (*p == 0)
{ {
if (GET_CODE (op) == REG && REGNO (op) >= FIRST_PSEUDO_REGISTER) 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; continue;
} }
@ -2162,9 +2162,9 @@ allocate_reg_info (size_t num_regs, int new_p, int renumber_p)
if (!reg_n_info) if (!reg_n_info)
{ {
VARRAY_REG_INIT (reg_n_info, regno_allocated, "reg_n_info"); VARRAY_REG_INIT (reg_n_info, regno_allocated, "reg_n_info");
renumber = (short *) xmalloc (size_renumber); renumber = xmalloc (size_renumber);
reg_pref_buffer = (struct reg_pref *) xmalloc (regno_allocated reg_pref_buffer = xmalloc (regno_allocated
* sizeof (struct reg_pref)); * sizeof (struct reg_pref));
} }
else else
@ -2175,23 +2175,23 @@ allocate_reg_info (size_t num_regs, int new_p, int renumber_p)
{ {
free ((char *) renumber); free ((char *) renumber);
free ((char *) reg_pref); free ((char *) reg_pref);
renumber = (short *) xmalloc (size_renumber); renumber = xmalloc (size_renumber);
reg_pref_buffer = (struct reg_pref *) xmalloc (regno_allocated reg_pref_buffer = xmalloc (regno_allocated
* sizeof (struct reg_pref)); * sizeof (struct reg_pref));
} }
else else
{ {
renumber = (short *) xrealloc ((char *) renumber, size_renumber); renumber = xrealloc (renumber, size_renumber);
reg_pref_buffer = (struct reg_pref *) xrealloc ((char *) reg_pref_buffer, reg_pref_buffer = xrealloc (reg_pref_buffer,
regno_allocated regno_allocated
* sizeof (struct reg_pref)); * sizeof (struct reg_pref));
} }
} }
size_info = (regno_allocated - old_allocated) * sizeof (reg_info) size_info = (regno_allocated - old_allocated) * sizeof (reg_info)
+ sizeof (struct reg_info_data) - 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->min_index = old_allocated;
reg_data->max_index = regno_allocated - 1; reg_data->max_index = regno_allocated - 1;
reg_data->next = reg_info_head; reg_data->next = reg_info_head;
@ -2221,8 +2221,8 @@ allocate_reg_info (size_t num_regs, int new_p, int renumber_p)
if (!reg_data->used_p) /* page just allocated with calloc */ if (!reg_data->used_p) /* page just allocated with calloc */
reg_data->used_p = 1; /* no need to zero */ reg_data->used_p = 1; /* no need to zero */
else else
memset ((char *) &reg_data->data[local_min], 0, memset (&reg_data->data[local_min], 0,
sizeof (reg_info) * (max - min_index - local_min + 1)); sizeof (reg_info) * (max - min_index - local_min + 1));
for (i = min_index+local_min; i <= max; i++) for (i = min_index+local_min; i <= max; i++)
{ {

View File

@ -1055,10 +1055,10 @@ regmove_optimize (rtx f, int nregs, FILE *regmove_dump_file)
can suppress some optimizations in those zones. */ can suppress some optimizations in those zones. */
mark_flags_life_zones (discover_flags_reg ()); 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; 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 (i = old_max_uid; i >= 0; i--) regmove_bb_head[i] = -1;
FOR_EACH_BB (bb) FOR_EACH_BB (bb)
regmove_bb_head[INSN_UID (bb->head)] = bb->index; regmove_bb_head[INSN_UID (bb->head)] = bb->index;
@ -2198,7 +2198,7 @@ record_one_stack_memref (rtx insn, rtx *mem, struct csa_memlist *next_memlist)
{ {
struct csa_memlist *ml; struct csa_memlist *ml;
ml = (struct csa_memlist *) xmalloc (sizeof (*ml)); ml = xmalloc (sizeof (*ml));
if (XEXP (*mem, 0) == stack_pointer_rtx) if (XEXP (*mem, 0) == stack_pointer_rtx)
ml->sp_offset = 0; ml->sp_offset = 0;

View File

@ -194,7 +194,7 @@ regrename_optimize (void)
memset (tick, 0, sizeof tick); memset (tick, 0, sizeof tick);
gcc_obstack_init (&rename_obstack); gcc_obstack_init (&rename_obstack);
first_obj = (char *) obstack_alloc (&rename_obstack, 0); first_obj = obstack_alloc (&rename_obstack, 0);
FOR_EACH_BB (bb) FOR_EACH_BB (bb)
{ {
@ -395,8 +395,8 @@ scan_rtx_reg (rtx insn, rtx *loc, enum reg_class class,
{ {
if (type == OP_OUT) if (type == OP_OUT)
{ {
struct du_chain *this = (struct du_chain *) struct du_chain *this
obstack_alloc (&rename_obstack, sizeof (struct du_chain)); = obstack_alloc (&rename_obstack, sizeof (struct du_chain));
this->next_use = 0; this->next_use = 0;
this->next_chain = open_chains; this->next_chain = open_chains;
this->loc = loc; this->loc = loc;
@ -450,8 +450,7 @@ scan_rtx_reg (rtx insn, rtx *loc, enum reg_class class,
be replaced with, terminate the chain. */ be replaced with, terminate the chain. */
if (class != NO_REGS) if (class != NO_REGS)
{ {
this = (struct du_chain *) this = obstack_alloc (&rename_obstack, sizeof (struct du_chain));
obstack_alloc (&rename_obstack, sizeof (struct du_chain));
this->next_use = 0; this->next_use = 0;
this->next_chain = (*p)->next_chain; this->next_chain = (*p)->next_chain;
this->loc = loc; this->loc = loc;

View File

@ -651,7 +651,7 @@ get_secondary_mem (rtx x ATTRIBUTE_UNUSED, enum machine_mode mode,
void void
clear_secondary_mem (void) clear_secondary_mem (void)
{ {
memset ((char *) secondary_memlocs, 0, sizeof secondary_memlocs); memset (secondary_memlocs, 0, sizeof secondary_memlocs);
} }
#endif /* SECONDARY_MEMORY_NEEDED */ #endif /* SECONDARY_MEMORY_NEEDED */
@ -2539,7 +2539,7 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
/* The eliminated forms of any secondary memory locations are per-insn, so /* The eliminated forms of any secondary memory locations are per-insn, so
clear them out here. */ clear them out here. */
memset ((char *) secondary_memlocs_elim, 0, sizeof secondary_memlocs_elim); memset (secondary_memlocs_elim, 0, sizeof secondary_memlocs_elim);
#endif #endif
/* Dispose quickly of (set (reg..) (reg..)) if both have hard regs and it /* Dispose quickly of (set (reg..) (reg..)) if both have hard regs and it

View File

@ -475,7 +475,7 @@ init_reload (void)
/* Initialize obstack for our rtl allocation. */ /* Initialize obstack for our rtl allocation. */
gcc_obstack_init (&reload_obstack); 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 (&spilled_pseudos);
INIT_REG_SET (&pseudos_counted); INIT_REG_SET (&pseudos_counted);
@ -492,8 +492,7 @@ new_insn_chain (void)
if (unused_insn_chains == 0) if (unused_insn_chains == 0)
{ {
c = (struct insn_chain *) c = obstack_alloc (&reload_obstack, sizeof (struct insn_chain));
obstack_alloc (&reload_obstack, sizeof (struct insn_chain));
INIT_REG_SET (&c->live_throughout); INIT_REG_SET (&c->live_throughout);
INIT_REG_SET (&c->dead_or_set); INIT_REG_SET (&c->dead_or_set);
} }
@ -638,7 +637,7 @@ reload (rtx first, int global)
failure = 0; 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 /* Make sure that the last insn in the chain
is not something that needs reloading. */ is not something that needs reloading. */
@ -653,8 +652,8 @@ reload (rtx first, int global)
#endif #endif
/* We don't have a stack slot for any spill reg yet. */ /* We don't have a stack slot for any spill reg yet. */
memset ((char *) spill_stack_slot, 0, sizeof spill_stack_slot); memset (spill_stack_slot, 0, sizeof spill_stack_slot);
memset ((char *) spill_stack_slot_width, 0, sizeof spill_stack_slot_width); memset (spill_stack_slot_width, 0, sizeof spill_stack_slot_width);
/* Initialize the save area information for caller-save, in case some /* Initialize the save area information for caller-save, in case some
are needed. */ are needed. */
@ -684,17 +683,15 @@ reload (rtx first, int global)
Record memory equivalents in reg_mem_equiv so they can Record memory equivalents in reg_mem_equiv so they can
be substituted eventually by altering the REG-rtx's. */ be substituted eventually by altering the REG-rtx's. */
reg_equiv_constant = (rtx *) xcalloc (max_regno, sizeof (rtx)); reg_equiv_constant = xcalloc (max_regno, sizeof (rtx));
reg_equiv_mem = (rtx *) xcalloc (max_regno, sizeof (rtx)); reg_equiv_mem = xcalloc (max_regno, sizeof (rtx));
reg_equiv_init = (rtx *) xcalloc (max_regno, sizeof (rtx)); reg_equiv_init = xcalloc (max_regno, sizeof (rtx));
reg_equiv_address = (rtx *) xcalloc (max_regno, sizeof (rtx)); reg_equiv_address = xcalloc (max_regno, sizeof (rtx));
reg_max_ref_width = (unsigned int *) xcalloc (max_regno, sizeof (int)); reg_max_ref_width = xcalloc (max_regno, sizeof (int));
reg_old_renumber = (short *) xcalloc (max_regno, sizeof (short)); reg_old_renumber = xcalloc (max_regno, sizeof (short));
memcpy (reg_old_renumber, reg_renumber, max_regno * sizeof (short)); memcpy (reg_old_renumber, reg_renumber, max_regno * sizeof (short));
pseudo_forbidden_regs pseudo_forbidden_regs = xmalloc (max_regno * sizeof (HARD_REG_SET));
= (HARD_REG_SET *) xmalloc (max_regno * sizeof (HARD_REG_SET)); pseudo_previous_regs = xcalloc (max_regno, sizeof (HARD_REG_SET));
pseudo_previous_regs
= (HARD_REG_SET *) xcalloc (max_regno, sizeof (HARD_REG_SET));
CLEAR_HARD_REG_SET (bad_spill_regs_global); CLEAR_HARD_REG_SET (bad_spill_regs_global);
@ -819,9 +816,7 @@ reload (rtx first, int global)
allocate would occasionally cause it to exceed the stack limit and allocate would occasionally cause it to exceed the stack limit and
cause a core dump. */ cause a core dump. */
offsets_known_at = xmalloc (num_labels); offsets_known_at = xmalloc (num_labels);
offsets_at offsets_at = xmalloc (num_labels * NUM_ELIMINABLE_REGS * sizeof (int));
= (int (*)[NUM_ELIMINABLE_REGS])
xmalloc (num_labels * NUM_ELIMINABLE_REGS * sizeof (int));
/* Alter each pseudo-reg rtx to contain its hard reg number. /* Alter each pseudo-reg rtx to contain its hard reg number.
Assign stack slots to the pseudos that lack hard regs or equivalents. Assign stack slots to the pseudos that lack hard regs or equivalents.
@ -953,7 +948,7 @@ reload (rtx first, int global)
{ {
save_call_clobbered_regs (); save_call_clobbered_regs ();
/* That might have allocated new insn_chain structures. */ /* 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); calculate_needs_all_insns (global);
@ -1381,11 +1376,10 @@ static void
copy_reloads (struct insn_chain *chain) copy_reloads (struct insn_chain *chain)
{ {
chain->n_reloads = n_reloads; chain->n_reloads = n_reloads;
chain->rld chain->rld = obstack_alloc (&reload_obstack,
= (struct reload *) obstack_alloc (&reload_obstack, n_reloads * sizeof (struct reload));
n_reloads * sizeof (struct reload));
memcpy (chain->rld, rld, 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 /* Walk the chain of insns, and determine for each whether it needs reloads
@ -1399,7 +1393,7 @@ calculate_needs_all_insns (int global)
something_needs_elimination = 0; 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) for (chain = reload_insn_chain; chain != 0; chain = next)
{ {
rtx insn = chain->insn; rtx insn = chain->insn;
@ -3442,8 +3436,7 @@ init_elim_table (void)
#endif #endif
if (!reg_eliminate) if (!reg_eliminate)
reg_eliminate = (struct elim_table *) reg_eliminate = xcalloc (sizeof (struct elim_table), NUM_ELIMINABLE_REGS);
xcalloc (sizeof (struct elim_table), NUM_ELIMINABLE_REGS);
/* Does this function require a frame pointer? */ /* Does this function require a frame pointer? */
@ -3589,7 +3582,7 @@ finish_spills (int global)
/* Retry global register allocation if possible. */ /* Retry global register allocation if possible. */
if (global) 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 /* For every insn that needs reloads, set the registers used as spill
regs in pseudo_forbidden_regs for every pseudo live across the regs in pseudo_forbidden_regs for every pseudo live across the
insn. */ insn. */
@ -3759,10 +3752,10 @@ reload_as_needed (int live_known)
#endif #endif
rtx x; rtx x;
memset ((char *) spill_reg_rtx, 0, sizeof spill_reg_rtx); memset (spill_reg_rtx, 0, sizeof spill_reg_rtx);
memset ((char *) spill_reg_store, 0, sizeof spill_reg_store); memset (spill_reg_store, 0, sizeof spill_reg_store);
reg_last_reload_reg = (rtx *) xcalloc (max_regno, sizeof (rtx)); reg_last_reload_reg = xcalloc (max_regno, sizeof (rtx));
reg_has_output_reload = (char *) xmalloc (max_regno); reg_has_output_reload = xmalloc (max_regno);
CLEAR_HARD_REG_SET (reg_reloaded_valid); CLEAR_HARD_REG_SET (reg_reloaded_valid);
set_initial_elim_offsets (); set_initial_elim_offsets ();
@ -5156,8 +5149,8 @@ choose_reload_regs_init (struct insn_chain *chain, rtx *save_reload_reg_rtx)
rld[i].reg_rtx = save_reload_reg_rtx[i]; rld[i].reg_rtx = save_reload_reg_rtx[i];
memset (reload_inherited, 0, MAX_RELOADS); memset (reload_inherited, 0, MAX_RELOADS);
memset ((char *) reload_inheritance_insn, 0, MAX_RELOADS * sizeof (rtx)); memset (reload_inheritance_insn, 0, MAX_RELOADS * sizeof (rtx));
memset ((char *) reload_override_in, 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);
CLEAR_HARD_REG_SET (reload_reg_used_at_all); CLEAR_HARD_REG_SET (reload_reg_used_at_all);

View File

@ -3587,7 +3587,7 @@ dbr_schedule (rtx first, FILE *file)
epilogue_insn = insn; 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)) for (i = 0, insn = first; insn; i++, insn = NEXT_INSN (insn))
uid_to_ruid[INSN_UID (insn)] = i; uid_to_ruid[INSN_UID (insn)] = i;
@ -3595,7 +3595,7 @@ dbr_schedule (rtx first, FILE *file)
if (unfilled_firstobj == 0) if (unfilled_firstobj == 0)
{ {
gcc_obstack_init (&unfilled_slots_obstack); 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)) for (insn = next_active_insn (first); insn; insn = next_active_insn (insn))
@ -3629,8 +3629,8 @@ dbr_schedule (rtx first, FILE *file)
end_of_function_label = 0; end_of_function_label = 0;
/* Initialize the statistics for this function. */ /* Initialize the statistics for this function. */
memset ((char *) num_insns_needing_delays, 0, sizeof num_insns_needing_delays); memset (num_insns_needing_delays, 0, sizeof num_insns_needing_delays);
memset ((char *) num_filled_delays, 0, sizeof num_filled_delays); memset (num_filled_delays, 0, sizeof num_filled_delays);
/* Now do the delay slot filling. Try everything twice in case earlier /* Now do the delay slot filling. Try everything twice in case earlier
changes make more slots fillable. */ changes make more slots fillable. */
@ -3670,7 +3670,7 @@ dbr_schedule (rtx first, FILE *file)
obstack_free (&unfilled_slots_obstack, unfilled_firstobj); obstack_free (&unfilled_slots_obstack, unfilled_firstobj);
/* It is not clear why the line below is needed, but it does seem to be. */ /* 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) if (file)
{ {
@ -3703,8 +3703,8 @@ dbr_schedule (rtx first, FILE *file)
fprintf (file, "\n"); fprintf (file, "\n");
} }
} }
memset ((char *) total_delay_slots, 0, sizeof total_delay_slots); memset (total_delay_slots, 0, sizeof total_delay_slots);
memset ((char *) total_annul_slots, 0, sizeof total_annul_slots); memset (total_annul_slots, 0, sizeof total_annul_slots);
for (insn = first; insn; insn = NEXT_INSN (insn)) for (insn = first; insn; insn = NEXT_INSN (insn))
{ {
if (! INSN_DELETED_P (insn) if (! INSN_DELETED_P (insn)

View File

@ -947,7 +947,7 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res)
{ {
/* Allocate a place to put our results and chain it into the /* Allocate a place to put our results and chain it into the
hash table. */ hash table. */
tinfo = (struct target_info *) xmalloc (sizeof (struct target_info)); tinfo = xmalloc (sizeof (struct target_info));
tinfo->uid = INSN_UID (target); tinfo->uid = INSN_UID (target);
tinfo->block = b; tinfo->block = b;
tinfo->next tinfo->next
@ -1223,9 +1223,8 @@ init_resource_info (rtx epilogue_insn)
MARK_SRC_DEST_CALL); MARK_SRC_DEST_CALL);
/* Allocate and initialize the tables used by mark_target_live_regs. */ /* Allocate and initialize the tables used by mark_target_live_regs. */
target_hash_table = (struct target_info **) target_hash_table = xcalloc (TARGET_HASH_PRIME, sizeof (struct target_info *));
xcalloc (TARGET_HASH_PRIME, sizeof (struct target_info *)); bb_ticks = xcalloc (last_basic_block, sizeof (int));
bb_ticks = (int *) xcalloc (last_basic_block, sizeof (int));
} }
/* Free up the resources allocated to mark_target_live_regs (). This /* Free up the resources allocated to mark_target_live_regs (). This

View File

@ -41,7 +41,7 @@ sbitmap_alloc (unsigned int n_elms)
bytes = size * sizeof (SBITMAP_ELT_TYPE); bytes = size * sizeof (SBITMAP_ELT_TYPE);
amt = (sizeof (struct simple_bitmap_def) amt = (sizeof (struct simple_bitmap_def)
+ bytes - sizeof (SBITMAP_ELT_TYPE)); + bytes - sizeof (SBITMAP_ELT_TYPE));
bmap = (sbitmap) xmalloc (amt); bmap = xmalloc (amt);
bmap->n_bits = n_elms; bmap->n_bits = n_elms;
bmap->size = size; bmap->size = size;
bmap->bytes = bytes; bmap->bytes = bytes;
@ -64,7 +64,7 @@ sbitmap_resize (sbitmap bmap, unsigned int n_elms, int def)
{ {
amt = (sizeof (struct simple_bitmap_def) amt = (sizeof (struct simple_bitmap_def)
+ bytes - sizeof (SBITMAP_ELT_TYPE)); + bytes - sizeof (SBITMAP_ELT_TYPE));
bmap = (sbitmap) xrealloc (bmap, amt); bmap = xrealloc (bmap, amt);
} }
if (n_elms > bmap->n_bits) if (n_elms > bmap->n_bits)
@ -130,7 +130,7 @@ sbitmap_vector_alloc (unsigned int n_vecs, unsigned int n_elms)
} }
amt = vector_bytes + (n_vecs * elm_bytes); 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) for (i = 0, offset = vector_bytes; i < n_vecs; i++, offset += elm_bytes)
{ {

View File

@ -1390,8 +1390,7 @@ init_deps (struct deps *deps)
int max_reg = (reload_completed ? FIRST_PSEUDO_REGISTER : max_reg_num ()); int max_reg = (reload_completed ? FIRST_PSEUDO_REGISTER : max_reg_num ());
deps->max_reg = max_reg; deps->max_reg = max_reg;
deps->reg_last = (struct deps_reg *) deps->reg_last = xcalloc (max_reg, sizeof (struct deps_reg));
xcalloc (max_reg, sizeof (struct deps_reg));
INIT_REG_SET (&deps->reg_last_in_use); INIT_REG_SET (&deps->reg_last_in_use);
INIT_REG_SET (&deps->reg_conditional_sets); INIT_REG_SET (&deps->reg_conditional_sets);

Some files were not shown because too many files have changed in this diff Show More