This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch installed to remove unnecessary casts [part 1/3]
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 19 Jul 2003 10:55:38 -0400 (EDT)
- Subject: Patch installed to remove unnecessary casts [part 1/3]
Now that we're requiring ISO C, we can rely on the fact that the
various allocator function return types and the various mem* function
parameter types are void *. This allows us to stop sprinkling the
code with pointer casts.
This patch removes as many of these casts as I could find in the gcc
directrory. Bootstrapped on sparc-sun-solaris2.7 (minus java), no
testsuite regressions.
Installed as pre-approved ISO C conversion.
--Kaveh
PS: this message contains the Changelog for all 3 parts.
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.
diff -rup orig/egcc-CVS20030716/gcc/alias.c egcc-CVS20030716/gcc/alias.c
--- orig/egcc-CVS20030716/gcc/alias.c 2003-07-07 11:45:36.000000000 -0400
+++ egcc-CVS20030716/gcc/alias.c 2003-07-17 11:48:49.297948000 -0400
@@ -632,8 +632,7 @@ record_alias_subset (HOST_WIDE_INT super
{
/* Create an entry for the SUPERSET, so that we have a place to
attach the SUBSET. */
- superset_entry
- = (alias_set_entry) xmalloc (sizeof (struct alias_set_entry));
+ superset_entry = xmalloc (sizeof (struct alias_set_entry));
superset_entry->alias_set = superset;
superset_entry->children
= splay_tree_new (splay_tree_compare_ints, 0, 0);
@@ -2717,17 +2716,16 @@ init_alias_analysis (void)
optimization. Loop unrolling can create a large number of
registers. */
reg_base_value_size = maxreg * 2;
- reg_base_value = (rtx *) ggc_alloc_cleared (reg_base_value_size
- * sizeof (rtx));
+ reg_base_value = ggc_alloc_cleared (reg_base_value_size * sizeof (rtx));
- new_reg_base_value = (rtx *) xmalloc (reg_base_value_size * sizeof (rtx));
- reg_seen = (char *) xmalloc (reg_base_value_size);
+ new_reg_base_value = xmalloc (reg_base_value_size * sizeof (rtx));
+ reg_seen = xmalloc (reg_base_value_size);
if (! reload_completed && flag_old_unroll_loops)
{
/* ??? Why are we realloc'ing if we're just going to zero it? */
- alias_invariant = (rtx *)xrealloc (alias_invariant,
- reg_base_value_size * sizeof (rtx));
- memset ((char *)alias_invariant, 0, reg_base_value_size * sizeof (rtx));
+ alias_invariant = xrealloc (alias_invariant,
+ reg_base_value_size * sizeof (rtx));
+ memset (alias_invariant, 0, reg_base_value_size * sizeof (rtx));
}
/* The basic idea is that each pass through this loop will use the
@@ -2764,10 +2762,10 @@ init_alias_analysis (void)
copying_arguments = true;
/* Wipe the potential alias information clean for this pass. */
- memset ((char *) new_reg_base_value, 0, reg_base_value_size * sizeof (rtx));
+ memset (new_reg_base_value, 0, reg_base_value_size * sizeof (rtx));
/* Wipe the reg_seen array clean. */
- memset ((char *) reg_seen, 0, reg_base_value_size);
+ memset (reg_seen, 0, reg_base_value_size);
/* Mark all hard registers which may contain an address.
The stack, frame and argument pointers may contain an address.
diff -rup orig/egcc-CVS20030716/gcc/alloc-pool.c egcc-CVS20030716/gcc/alloc-pool.c
--- orig/egcc-CVS20030716/gcc/alloc-pool.c 2003-06-29 20:00:58.000000000 -0400
+++ egcc-CVS20030716/gcc/alloc-pool.c 2003-07-16 23:14:44.579836000 -0400
@@ -105,7 +105,7 @@ create_alloc_pool (const char *name, siz
pool_size = sizeof (struct alloc_pool_def);
/* and allocate that much memory. */
- pool = (alloc_pool) xmalloc (pool_size);
+ pool = xmalloc (pool_size);
/* Now init the various pieces of our pool structure. */
pool->name = xstrdup (name);
@@ -176,7 +176,7 @@ pool_alloc (alloc_pool pool)
alloc_pool_list block_header;
/* Make the block. */
- block = (char *) xmalloc (pool->block_size);
+ block = xmalloc (pool->block_size);
block_header = (alloc_pool_list) block;
block += align_eight (sizeof (struct alloc_pool_list_def));
diff -rup orig/egcc-CVS20030716/gcc/bitmap.c egcc-CVS20030716/gcc/bitmap.c
--- orig/egcc-CVS20030716/gcc/bitmap.c 2003-07-07 20:26:58.000000000 -0400
+++ egcc-CVS20030716/gcc/bitmap.c 2003-07-17 11:42:32.712403000 -0400
@@ -131,8 +131,7 @@ bitmap_element_allocate (bitmap head)
obstack_chunk_free);
}
- element = (bitmap_element *) obstack_alloc (&bitmap_obstack,
- sizeof (bitmap_element));
+ element = obstack_alloc (&bitmap_obstack, sizeof (bitmap_element));
}
}
else
diff -rup orig/egcc-CVS20030716/gcc/bitmap.h egcc-CVS20030716/gcc/bitmap.h
--- orig/egcc-CVS20030716/gcc/bitmap.h 2003-06-29 20:00:59.000000000 -0400
+++ egcc-CVS20030716/gcc/bitmap.h 2003-07-17 11:42:55.360241000 -0400
@@ -128,7 +128,7 @@ extern int bitmap_last_set_bit (bitmap);
/* Allocate a bitmap with oballoc. */
#define BITMAP_OBSTACK_ALLOC(OBSTACK) \
- bitmap_initialize ((bitmap) obstack_alloc (OBSTACK, sizeof (bitmap_head)), 1)
+ bitmap_initialize (obstack_alloc (OBSTACK, sizeof (bitmap_head)), 1)
/* Allocate a bitmap with ggc_alloc. */
#define BITMAP_GGC_ALLOC() \
@@ -136,7 +136,7 @@ extern int bitmap_last_set_bit (bitmap);
/* Allocate a bitmap with xmalloc. */
#define BITMAP_XMALLOC() \
- bitmap_initialize ((bitmap) xmalloc (sizeof (bitmap_head)), 1)
+ bitmap_initialize (xmalloc (sizeof (bitmap_head)), 1)
/* Do any cleanup needed on a bitmap when it is no longer used. */
#define BITMAP_FREE(BITMAP) \
diff -rup orig/egcc-CVS20030716/gcc/bt-load.c egcc-CVS20030716/gcc/bt-load.c
--- orig/egcc-CVS20030716/gcc/bt-load.c 2003-07-05 16:01:32.000000000 -0400
+++ egcc-CVS20030716/gcc/bt-load.c 2003-07-17 11:34:07.599295000 -0400
@@ -277,9 +277,8 @@ find_btr_def_group (btr_def_group *all_b
if (!this_group)
{
- this_group = (btr_def_group)
- obstack_alloc (&migrate_btrl_obstack,
- sizeof (struct btr_def_group_s));
+ this_group = obstack_alloc (&migrate_btrl_obstack,
+ sizeof (struct btr_def_group_s));
this_group->src = def_src;
this_group->members = NULL;
this_group->next = *all_btr_def_groups;
@@ -301,8 +300,8 @@ add_btr_def (fibheap_t all_btr_defs, bas
unsigned int dest_reg, int other_btr_uses_before_def,
btr_def_group *all_btr_def_groups)
{
- btr_def this = (btr_def)
- obstack_alloc (&migrate_btrl_obstack, sizeof (struct btr_def_s));
+ btr_def this
+ = obstack_alloc (&migrate_btrl_obstack, sizeof (struct btr_def_s));
this->bb = bb;
this->luid = insn_luid;
this->insn = insn;
@@ -353,8 +352,7 @@ new_btr_user (basic_block bb, int insn_l
usep = NULL;
}
use = usep ? *usep : NULL_RTX;
- user = (btr_user)
- obstack_alloc (&migrate_btrl_obstack, sizeof (struct btr_user_s));
+ user = obstack_alloc (&migrate_btrl_obstack, sizeof (struct btr_user_s));
user->bb = bb;
user->luid = insn_luid;
user->insn = insn;
@@ -736,8 +734,7 @@ build_btr_def_use_webs (fibheap_t all_bt
sbitmap *btr_defset = sbitmap_vector_alloc (
(last_btr - first_btr) + 1, max_uid);
sbitmap *bb_gen = sbitmap_vector_alloc (n_basic_blocks, max_uid);
- HARD_REG_SET *btrs_written = (HARD_REG_SET *) xcalloc (
- n_basic_blocks, sizeof (HARD_REG_SET));
+ HARD_REG_SET *btrs_written = xcalloc (n_basic_blocks, sizeof (HARD_REG_SET));
sbitmap *bb_kill;
sbitmap *bb_out;
@@ -841,8 +838,7 @@ augment_live_range (bitmap live_range, H
{
basic_block *worklist, *tos;
- tos = worklist =
- (basic_block *) xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
+ tos = worklist = xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
if (dominated_by_p (dom, new_bb, head_bb))
*tos++ = new_bb;
@@ -1318,8 +1314,7 @@ migrate_btr_defs (enum reg_class btr_cla
first_btr = reg;
}
- btrs_live =
- (HARD_REG_SET *) xcalloc (n_basic_blocks, sizeof (HARD_REG_SET));
+ btrs_live = xcalloc (n_basic_blocks, sizeof (HARD_REG_SET));
build_btr_def_use_webs (all_btr_defs);
diff -rup orig/egcc-CVS20030716/gcc/builtins.c egcc-CVS20030716/gcc/builtins.c
--- orig/egcc-CVS20030716/gcc/builtins.c 2003-07-11 20:01:07.000000000 -0400
+++ egcc-CVS20030716/gcc/builtins.c 2003-07-16 23:16:12.861851000 -0400
@@ -1082,7 +1082,7 @@ result_vector (int savep, rtx result)
int regno, size, align, nelts;
enum machine_mode mode;
rtx reg, mem;
- rtx *savevec = (rtx *) alloca (FIRST_PSEUDO_REGISTER * sizeof (rtx));
+ rtx *savevec = alloca (FIRST_PSEUDO_REGISTER * sizeof (rtx));
size = nelts = 0;
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
diff -rup orig/egcc-CVS20030716/gcc/c-common.c egcc-CVS20030716/gcc/c-common.c
--- orig/egcc-CVS20030716/gcc/c-common.c 2003-07-16 20:01:24.000000000 -0400
+++ egcc-CVS20030716/gcc/c-common.c 2003-07-17 11:43:12.548681000 -0400
@@ -879,12 +879,12 @@ c_expand_start_cond (tree cond, int comp
if (if_stack_space == 0)
{
if_stack_space = 10;
- if_stack = (if_elt *) xmalloc (10 * sizeof (if_elt));
+ if_stack = xmalloc (10 * sizeof (if_elt));
}
else if (if_stack_space == if_stack_pointer)
{
if_stack_space += 10;
- if_stack = (if_elt *) xrealloc (if_stack, if_stack_space * sizeof (if_elt));
+ if_stack = xrealloc (if_stack, if_stack_space * sizeof (if_elt));
}
IF_COND (if_stmt) = cond;
@@ -1357,7 +1357,7 @@ static struct tlist *
new_tlist (struct tlist *next, tree t, tree writer)
{
struct tlist *l;
- l = (struct tlist *) obstack_alloc (&tlist_obstack, sizeof *l);
+ l = obstack_alloc (&tlist_obstack, sizeof *l);
l->next = next;
l->expr = t;
l->writer = writer;
@@ -1627,8 +1627,7 @@ verify_tree (tree x, struct tlist **pbef
if (! t)
{
- t = (struct tlist_cache *) obstack_alloc (&tlist_obstack,
- sizeof *t);
+ t = obstack_alloc (&tlist_obstack, sizeof *t);
t->next = save_expr_cache;
t->expr = x;
save_expr_cache = t;
@@ -4315,7 +4314,7 @@ c_expand_builtin_printf (tree arglist, r
/* Create a NULL-terminated string that's one char shorter
than the original, stripping off the trailing '\n'. */
const int newlen = TREE_STRING_LENGTH (stripped_string) - 1;
- char *newstr = (char *) alloca (newlen);
+ char *newstr = alloca (newlen);
memcpy (newstr, TREE_STRING_POINTER (stripped_string), newlen - 1);
newstr[newlen - 1] = 0;
@@ -4879,7 +4878,7 @@ handle_mode_attribute (tree *node, tree
if (len > 4 && p[0] == '_' && p[1] == '_'
&& p[len - 1] == '_' && p[len - 2] == '_')
{
- char *newp = (char *) alloca (len - 1);
+ char *newp = alloca (len - 1);
strcpy (newp, &p[2]);
newp[len - 4] = '\0';
diff -rup orig/egcc-CVS20030716/gcc/c-decl.c egcc-CVS20030716/gcc/c-decl.c
--- orig/egcc-CVS20030716/gcc/c-decl.c 2003-07-16 20:01:24.000000000 -0400
+++ egcc-CVS20030716/gcc/c-decl.c 2003-07-17 11:02:23.991628000 -0400
@@ -356,8 +356,7 @@ make_binding_level (void)
memset (result, 0, sizeof(struct binding_level));
}
else
- result = (struct binding_level *)
- ggc_alloc_cleared (sizeof (struct binding_level));
+ result = ggc_alloc_cleared (sizeof (struct binding_level));
return result;
}
@@ -1705,8 +1704,7 @@ pushdecl (tree x)
/* Functions need the lang_decl data. */
if (TREE_CODE (x) == FUNCTION_DECL && ! DECL_LANG_SPECIFIC (x))
- DECL_LANG_SPECIFIC (x) = (struct lang_decl *)
- ggc_alloc_cleared (sizeof (struct lang_decl));
+ DECL_LANG_SPECIFIC (x) = ggc_alloc_cleared (sizeof (struct lang_decl));
/* A local extern declaration for a function doesn't constitute nesting.
A local auto declaration does, since it's a forward decl
@@ -4342,8 +4340,8 @@ grokdeclarator (tree declarator, tree de
decl = build_decl (FUNCTION_DECL, declarator, type);
decl = build_decl_attribute_variant (decl, decl_attr);
- DECL_LANG_SPECIFIC (decl) = (struct lang_decl *)
- ggc_alloc_cleared (sizeof (struct lang_decl));
+ DECL_LANG_SPECIFIC (decl)
+ = ggc_alloc_cleared (sizeof (struct lang_decl));
if (pedantic && type_quals && ! DECL_IN_SYSTEM_HEADER (decl))
pedwarn ("ISO C forbids qualified function types");
@@ -6629,8 +6627,7 @@ void
c_push_function_context (struct function *f)
{
struct language_function *p;
- p = ((struct language_function *)
- ggc_alloc (sizeof (struct language_function)));
+ p = ggc_alloc (sizeof (struct language_function));
f->language = p;
p->base.x_stmt_tree = c_stmt_tree;
@@ -6693,9 +6690,8 @@ c_dup_lang_specific_decl (tree decl)
if (!DECL_LANG_SPECIFIC (decl))
return;
- ld = (struct lang_decl *) ggc_alloc (sizeof (struct lang_decl));
- memcpy ((char *) ld, (char *) DECL_LANG_SPECIFIC (decl),
- sizeof (struct lang_decl));
+ ld = ggc_alloc (sizeof (struct lang_decl));
+ memcpy (ld, DECL_LANG_SPECIFIC (decl), sizeof (struct lang_decl));
DECL_LANG_SPECIFIC (decl) = ld;
}
@@ -6940,7 +6936,7 @@ merge_translation_unit_decls (void)
if (TREE_PUBLIC (decl) && DECL_EXTERNAL (decl))
{
tree global_decl;
- global_decl = (tree) htab_find (link_hash_table, decl);
+ global_decl = htab_find (link_hash_table, decl);
if (! global_decl)
continue;
@@ -6964,7 +6960,7 @@ c_write_global_declarations(void)
{
tree globals = BLOCK_VARS (DECL_INITIAL (link));
int len = list_length (globals);
- tree *vec = (tree *) xmalloc (sizeof (tree) * len);
+ tree *vec = xmalloc (sizeof (tree) * len);
int i;
tree decl;
diff -rup orig/egcc-CVS20030716/gcc/c-incpath.c egcc-CVS20030716/gcc/c-incpath.c
--- orig/egcc-CVS20030716/gcc/c-incpath.c 2003-07-05 16:01:32.000000000 -0400
+++ egcc-CVS20030716/gcc/c-incpath.c 2003-07-16 23:19:34.435787000 -0400
@@ -306,7 +306,7 @@ add_path (char *path, int chain, int cxx
{
struct cpp_path *p;
- p = (struct cpp_path *) xmalloc (sizeof (struct cpp_path));
+ p = xmalloc (sizeof (struct cpp_path));
p->next = NULL;
p->name = path;
if (chain == SYSTEM || chain == AFTER)
diff -rup orig/egcc-CVS20030716/gcc/c-lex.c egcc-CVS20030716/gcc/c-lex.c
--- orig/egcc-CVS20030716/gcc/c-lex.c 2003-07-09 17:57:16.000000000 -0400
+++ egcc-CVS20030716/gcc/c-lex.c 2003-07-16 23:19:49.375112000 -0400
@@ -123,7 +123,7 @@ get_fileinfo (const char *name)
if (n)
return (struct c_fileinfo *) n->value;
- fi = (struct c_fileinfo *) xmalloc (sizeof (struct c_fileinfo));
+ fi = xmalloc (sizeof (struct c_fileinfo));
fi->time = 0;
fi->interface_only = 0;
fi->interface_unknown = 1;
diff -rup orig/egcc-CVS20030716/gcc/c-opts.c egcc-CVS20030716/gcc/c-opts.c
--- orig/egcc-CVS20030716/gcc/c-opts.c 2003-07-15 20:01:40.000000000 -0400
+++ egcc-CVS20030716/gcc/c-opts.c 2003-07-17 01:26:29.061849000 -0400
@@ -218,8 +218,7 @@ c_common_init_options (unsigned int argc
flag_exceptions = c_dialect_cxx ();
warn_pointer_arith = c_dialect_cxx ();
- deferred_opts = (struct deferred_opt *)
- xmalloc (argc * sizeof (struct deferred_opt));
+ deferred_opts = xmalloc (argc * sizeof (struct deferred_opt));
result = lang_flags[c_language];
diff -rup orig/egcc-CVS20030716/gcc/c-parse.in egcc-CVS20030716/gcc/c-parse.in
--- orig/egcc-CVS20030716/gcc/c-parse.in 2003-07-11 20:01:09.000000000 -0400
+++ egcc-CVS20030716/gcc/c-parse.in 2003-07-17 14:36:17.173696000 -0400
@@ -75,15 +75,13 @@ do { \
newsize = *(YYSSZ) *= 2; \
if (malloced_yyss) \
{ \
- newss = (short *) \
- really_call_realloc (*(SS), newsize * sizeof (short)); \
- newvs = (YYSTYPE *) \
- really_call_realloc (*(VS), newsize * sizeof (YYSTYPE)); \
+ newss = really_call_realloc (*(SS), newsize * sizeof (short)); \
+ newvs = really_call_realloc (*(VS), newsize * sizeof (YYSTYPE)); \
} \
else \
{ \
- newss = (short *) really_call_malloc (newsize * sizeof (short)); \
- newvs = (YYSTYPE *) really_call_malloc (newsize * sizeof (YYSTYPE)); \
+ newss = really_call_malloc (newsize * sizeof (short)); \
+ newvs = really_call_malloc (newsize * sizeof (YYSTYPE)); \
if (newss) \
memcpy (newss, *(SS), (SSSIZE)); \
if (newvs) \
@@ -3524,7 +3522,7 @@ init_reswords (void)
if (!c_dialect_objc ())
mask |= D_OBJC;
- ridpointers = (tree *) ggc_calloc ((int) RID_MAX, sizeof (tree));
+ ridpointers = ggc_calloc ((int) RID_MAX, sizeof (tree));
for (i = 0; i < N_reswords; i++)
{
/* If a keyword is disabled, do not enter it into the table
diff -rup orig/egcc-CVS20030716/gcc/c-pragma.c egcc-CVS20030716/gcc/c-pragma.c
--- orig/egcc-CVS20030716/gcc/c-pragma.c 2003-06-19 20:01:21.000000000 -0400
+++ egcc-CVS20030716/gcc/c-pragma.c 2003-07-17 10:46:48.047631000 -0400
@@ -74,7 +74,7 @@ push_alignment (int alignment, tree id)
{
align_stack * entry;
- entry = (align_stack *) ggc_alloc (sizeof (* entry));
+ entry = ggc_alloc (sizeof (* entry));
entry->alignment = alignment;
entry->num_pushes = 1;
diff -rup orig/egcc-CVS20030716/gcc/c-typeck.c egcc-CVS20030716/gcc/c-typeck.c
--- orig/egcc-CVS20030716/gcc/c-typeck.c 2003-07-16 20:01:25.000000000 -0400
+++ egcc-CVS20030716/gcc/c-typeck.c 2003-07-17 10:47:00.146532000 -0400
@@ -4382,9 +4382,8 @@ warn_for_assignment (const char *msgid,
{
/* Function name is known; supply it. */
const char *const argstring = _("passing arg of `%s'");
- new_opname = (char *) alloca (IDENTIFIER_LENGTH (function)
- + strlen (argstring) + 1
- + 1);
+ new_opname = alloca (IDENTIFIER_LENGTH (function)
+ + strlen (argstring) + 1 + 1);
sprintf (new_opname, argstring,
IDENTIFIER_POINTER (function));
}
@@ -4392,7 +4391,7 @@ warn_for_assignment (const char *msgid,
{
/* Function name unknown (call through ptr). */
const char *const argnofun = _("passing arg of pointer to function");
- new_opname = (char *) alloca (strlen (argnofun) + 1 + 1);
+ new_opname = alloca (strlen (argnofun) + 1 + 1);
sprintf (new_opname, argnofun);
}
}
@@ -4400,9 +4399,8 @@ warn_for_assignment (const char *msgid,
{
/* Function name is known; supply it. */
const char *const argstring = _("passing arg %d of `%s'");
- new_opname = (char *) alloca (IDENTIFIER_LENGTH (function)
- + strlen (argstring) + 1 + 25
- /*%d*/ + 1);
+ new_opname = alloca (IDENTIFIER_LENGTH (function)
+ + strlen (argstring) + 1 + 25 /*%d*/ + 1);
sprintf (new_opname, argstring, argnum,
IDENTIFIER_POINTER (function));
}
@@ -4410,7 +4408,7 @@ warn_for_assignment (const char *msgid,
{
/* Function name unknown (call through ptr); just give arg number. */
const char *const argnofun = _("passing arg %d of pointer to function");
- new_opname = (char *) alloca (strlen (argnofun) + 1 + 25 /*%d*/ + 1);
+ new_opname = alloca (strlen (argnofun) + 1 + 25 /*%d*/ + 1);
sprintf (new_opname, argnofun, argnum);
}
opname = new_opname;
@@ -4542,12 +4540,10 @@ static int spelling_size; /* Size of th
{ \
spelling_size += 10; \
if (spelling_base == 0) \
- spelling_base \
- = (struct spelling *) xmalloc (spelling_size * sizeof (struct spelling)); \
+ spelling_base = xmalloc (spelling_size * sizeof (struct spelling)); \
else \
- spelling_base \
- = (struct spelling *) xrealloc (spelling_base, \
- spelling_size * sizeof (struct spelling)); \
+ spelling_base = xrealloc (spelling_base, \
+ spelling_size * sizeof (struct spelling)); \
RESTORE_SPELLING_DEPTH (depth); \
} \
\
@@ -4637,7 +4633,7 @@ error_init (const char *msgid)
char *ofwhat;
error ("%s", _(msgid));
- ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
+ ofwhat = print_spelling (alloca (spelling_length () + 1));
if (*ofwhat)
error ("(near initialization for `%s')", ofwhat);
}
@@ -4652,7 +4648,7 @@ pedwarn_init (const char *msgid)
char *ofwhat;
pedwarn ("%s", _(msgid));
- ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
+ ofwhat = print_spelling (alloca (spelling_length () + 1));
if (*ofwhat)
pedwarn ("(near initialization for `%s')", ofwhat);
}
@@ -4667,7 +4663,7 @@ warning_init (const char *msgid)
char *ofwhat;
warning ("%s", _(msgid));
- ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
+ ofwhat = print_spelling (alloca (spelling_length () + 1));
if (*ofwhat)
warning ("(near initialization for `%s')", ofwhat);
}
@@ -5051,8 +5047,7 @@ void
start_init (tree decl, tree asmspec_tree, int top_level)
{
const char *locus;
- struct initializer_stack *p
- = (struct initializer_stack *) xmalloc (sizeof (struct initializer_stack));
+ struct initializer_stack *p = xmalloc (sizeof (struct initializer_stack));
const char *asmspec = 0;
if (asmspec_tree)
@@ -5152,8 +5147,7 @@ finish_init (void)
void
really_start_incremental_init (tree type)
{
- struct constructor_stack *p
- = (struct constructor_stack *) xmalloc (sizeof (struct constructor_stack));
+ struct constructor_stack *p = xmalloc (sizeof (struct constructor_stack));
if (type == 0)
type = TREE_TYPE (constructor_decl);
@@ -5289,7 +5283,7 @@ push_init_level (int implicit)
value = find_init_member (constructor_index);
}
- p = (struct constructor_stack *) xmalloc (sizeof (struct constructor_stack));
+ p = xmalloc (sizeof (struct constructor_stack));
p->type = constructor_type;
p->fields = constructor_fields;
p->index = constructor_index;
@@ -5673,8 +5667,7 @@ push_range_stack (tree range_end)
{
struct constructor_range_stack *p;
- p = (struct constructor_range_stack *)
- ggc_alloc (sizeof (struct constructor_range_stack));
+ p = ggc_alloc (sizeof (struct constructor_range_stack));
p->prev = constructor_range_stack;
p->next = 0;
p->fields = constructor_fields;
@@ -5846,7 +5839,7 @@ add_pending_init (tree purpose, tree val
}
}
- r = (struct init_node *) ggc_alloc (sizeof (struct init_node));
+ r = ggc_alloc (sizeof (struct init_node));
r->purpose = purpose;
r->value = value;
@@ -6948,7 +6941,7 @@ c_expand_asm_operands (tree string, tree
int noutputs = list_length (outputs);
int i;
/* o[I] is the place that output number I should be written. */
- tree *o = (tree *) alloca (noutputs * sizeof (tree));
+ tree *o = alloca (noutputs * sizeof (tree));
tree tail;
/* Record the contents of OUTPUTS before it is modified. */
@@ -7146,7 +7139,7 @@ c_start_case (tree exp)
}
/* Add this new SWITCH_STMT to the stack. */
- cs = (struct c_switch *) xmalloc (sizeof (*cs));
+ cs = xmalloc (sizeof (*cs));
cs->switch_stmt = build_stmt (SWITCH_STMT, exp, NULL_TREE, orig_type);
cs->cases = splay_tree_new (case_compare, NULL, NULL);
cs->next = switch_stack;
diff -rup orig/egcc-CVS20030716/gcc/calls.c egcc-CVS20030716/gcc/calls.c
--- orig/egcc-CVS20030716/gcc/calls.c 2003-07-14 13:41:50.000000000 -0400
+++ egcc-CVS20030716/gcc/calls.c 2003-07-17 01:27:45.286967000 -0400
@@ -939,8 +939,7 @@ store_unaligned_arguments_into_pseudos (
int endian_correction = 0;
args[i].n_aligned_regs = args[i].partial ? args[i].partial : nregs;
- args[i].aligned_regs = (rtx *) xmalloc (sizeof (rtx)
- * args[i].n_aligned_regs);
+ args[i].aligned_regs = xmalloc (sizeof (rtx) * args[i].n_aligned_regs);
/* Structures smaller than a word are normally aligned to the
least significant byte. On a BYTES_BIG_ENDIAN machine,
@@ -2364,8 +2363,8 @@ expand_call (tree exp, rtx target, int i
INIT_CUMULATIVE_ARGS (args_so_far, funtype, NULL_RTX, fndecl);
/* Make a vector to hold all the information about each arg. */
- args = (struct arg_data *) alloca (num_actuals * sizeof (struct arg_data));
- memset ((char *) args, 0, num_actuals * sizeof (struct arg_data));
+ args = alloca (num_actuals * sizeof (struct arg_data));
+ memset (args, 0, num_actuals * sizeof (struct arg_data));
/* Build up entries in the ARGS array, compute the size of the
arguments into ARGS_SIZE, etc. */
@@ -2755,8 +2754,7 @@ expand_call (tree exp, rtx target, int i
highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use,
needed);
#endif
- stack_usage_map
- = (char *) alloca (highest_outgoing_arg_in_use);
+ stack_usage_map = alloca (highest_outgoing_arg_in_use);
if (initial_highest_arg_in_use)
memcpy (stack_usage_map, initial_stack_usage_map,
@@ -2861,8 +2859,7 @@ expand_call (tree exp, rtx target, int i
= stack_arg_under_construction;
stack_arg_under_construction = 0;
/* Make a new map for the new argument list. */
- stack_usage_map = (char *)
- alloca (highest_outgoing_arg_in_use);
+ stack_usage_map = alloca (highest_outgoing_arg_in_use);
memset (stack_usage_map, 0, highest_outgoing_arg_in_use);
highest_outgoing_arg_in_use = 0;
}
@@ -3656,8 +3653,8 @@ emit_library_call_value_1 (int retval, r
of the full argument passing conventions to limit complexity here since
library functions shouldn't have many args. */
- argvec = (struct arg *) alloca ((nargs + 1) * sizeof (struct arg));
- memset ((char *) argvec, 0, (nargs + 1) * sizeof (struct arg));
+ argvec = alloca ((nargs + 1) * sizeof (struct arg));
+ memset (argvec, 0, (nargs + 1) * sizeof (struct arg));
#ifdef INIT_CUMULATIVE_LIBCALL_ARGS
INIT_CUMULATIVE_LIBCALL_ARGS (args_so_far, outmode, fun);
@@ -3892,7 +3889,7 @@ emit_library_call_value_1 (int retval, r
highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use,
needed);
#endif
- stack_usage_map = (char *) alloca (highest_outgoing_arg_in_use);
+ stack_usage_map = alloca (highest_outgoing_arg_in_use);
if (initial_highest_arg_in_use)
memcpy (stack_usage_map, initial_stack_usage_map,
diff -rup orig/egcc-CVS20030716/gcc/cfg.c egcc-CVS20030716/gcc/cfg.c
--- orig/egcc-CVS20030716/gcc/cfg.c 2003-07-05 16:01:33.000000000 -0400
+++ egcc-CVS20030716/gcc/cfg.c 2003-07-17 11:59:05.431259000 -0400
@@ -155,7 +155,7 @@ init_flow (void)
if (!initialized)
{
gcc_obstack_init (&flow_obstack);
- flow_firstobj = (char *) obstack_alloc (&flow_obstack, 0);
+ flow_firstobj = obstack_alloc (&flow_obstack, 0);
initialized = 1;
}
else
@@ -163,7 +163,7 @@ init_flow (void)
free_alloc_pool (bb_pool);
free_alloc_pool (edge_pool);
obstack_free (&flow_obstack, flow_firstobj);
- flow_firstobj = (char *) obstack_alloc (&flow_obstack, 0);
+ flow_firstobj = obstack_alloc (&flow_obstack, 0);
}
bb_pool = create_alloc_pool ("Basic block pool",
sizeof (struct basic_block_def), 100);
@@ -697,7 +697,7 @@ alloc_aux_for_blocks (int size)
/* Check whether AUX data are still allocated. */
else if (first_block_aux_obj)
abort ();
- first_block_aux_obj = (char *) obstack_alloc (&block_aux_obstack, 0);
+ first_block_aux_obj = obstack_alloc (&block_aux_obstack, 0);
if (size)
{
basic_block bb;
@@ -763,7 +763,7 @@ alloc_aux_for_edges (int size)
else if (first_edge_aux_obj)
abort ();
- first_edge_aux_obj = (char *) obstack_alloc (&edge_aux_obstack, 0);
+ first_edge_aux_obj = obstack_alloc (&edge_aux_obstack, 0);
if (size)
{
basic_block bb;
@@ -819,9 +819,8 @@ verify_flow_info (void)
basic_block bb, last_bb_seen;
basic_block *last_visited;
- last_visited = (basic_block *) xcalloc (last_basic_block + 2,
- sizeof (basic_block));
- edge_checksum = (size_t *) xcalloc (last_basic_block + 2, sizeof (size_t));
+ last_visited = xcalloc (last_basic_block + 2, sizeof (basic_block));
+ edge_checksum = xcalloc (last_basic_block + 2, sizeof (size_t));
/* Check bb chain & numbers. */
last_bb_seen = ENTRY_BLOCK_PTR;
diff -rup orig/egcc-CVS20030716/gcc/cfganal.c egcc-CVS20030716/gcc/cfganal.c
--- orig/egcc-CVS20030716/gcc/cfganal.c 2003-07-03 14:40:46.000000000 -0400
+++ egcc-CVS20030716/gcc/cfganal.c 2003-07-17 00:47:00.314900000 -0400
@@ -139,11 +139,11 @@ mark_dfs_back_edges (void)
bool found = false;
/* Allocate the preorder and postorder number arrays. */
- pre = (int *) xcalloc (last_basic_block, sizeof (int));
- post = (int *) xcalloc (last_basic_block, sizeof (int));
+ pre = xcalloc (last_basic_block, sizeof (int));
+ post = xcalloc (last_basic_block, sizeof (int));
/* Allocate stack for back-tracking up CFG. */
- stack = (edge *) xmalloc ((n_basic_blocks + 1) * sizeof (edge));
+ stack = xmalloc ((n_basic_blocks + 1) * sizeof (edge));
sp = 0;
/* Allocate bitmap to track nodes that have been visited. */
@@ -402,8 +402,7 @@ find_unreachable_blocks (void)
edge e;
basic_block *tos, *worklist, bb;
- tos = worklist =
- (basic_block *) xmalloc (sizeof (basic_block) * n_basic_blocks);
+ tos = worklist = xmalloc (sizeof (basic_block) * n_basic_blocks);
/* Clear all the reachability flags. */
@@ -473,10 +472,10 @@ create_edge_list (void)
num_edges++;
}
- elist = (struct edge_list *) xmalloc (sizeof (struct edge_list));
+ elist = xmalloc (sizeof (struct edge_list));
elist->num_blocks = block_count;
elist->num_edges = num_edges;
- elist->index_to_edge = (edge *) xmalloc (sizeof (edge) * num_edges);
+ elist->index_to_edge = xmalloc (sizeof (edge) * num_edges);
num_edges = 0;
@@ -735,7 +734,7 @@ flow_reverse_top_sort_order_compute (int
sbitmap visited;
/* Allocate stack for back-tracking up CFG. */
- stack = (edge *) xmalloc ((n_basic_blocks + 1) * sizeof (edge));
+ stack = xmalloc ((n_basic_blocks + 1) * sizeof (edge));
sp = 0;
/* Allocate bitmap to track nodes that have been visited. */
@@ -804,7 +803,7 @@ flow_depth_first_order_compute (int *dfs
sbitmap visited;
/* Allocate stack for back-tracking up CFG. */
- stack = (edge *) xmalloc ((n_basic_blocks + 1) * sizeof (edge));
+ stack = xmalloc ((n_basic_blocks + 1) * sizeof (edge));
sp = 0;
/* Allocate bitmap to track nodes that have been visited. */
@@ -909,12 +908,11 @@ flow_preorder_transversal_compute (int *
basic_block bb;
/* Allocate stack for back-tracking up CFG. */
- stack = (edge *) xmalloc ((n_basic_blocks + 1) * sizeof (edge));
+ stack = xmalloc ((n_basic_blocks + 1) * sizeof (edge));
sp = 0;
/* Allocate the tree. */
- dfst = (struct dfst_node *) xcalloc (last_basic_block,
- sizeof (struct dfst_node));
+ dfst = xcalloc (last_basic_block, sizeof (struct dfst_node));
FOR_EACH_BB (bb)
{
@@ -924,9 +922,7 @@ flow_preorder_transversal_compute (int *
dfst[bb->index].node
= (max_successors
- ? (struct dfst_node **) xcalloc (max_successors,
- sizeof (struct dfst_node *))
- : NULL);
+ ? xcalloc (max_successors, sizeof (struct dfst_node *)) : NULL);
}
/* Allocate bitmap to track nodes that have been visited. */
@@ -1038,8 +1034,8 @@ static void
flow_dfs_compute_reverse_init (depth_first_search_ds data)
{
/* Allocate stack for back-tracking up CFG. */
- data->stack = (basic_block *) xmalloc ((n_basic_blocks - (INVALID_BLOCK + 1))
- * sizeof (basic_block));
+ data->stack = xmalloc ((n_basic_blocks - (INVALID_BLOCK + 1))
+ * sizeof (basic_block));
data->sp = 0;
/* Allocate bitmap to track nodes that have been visited. */
diff -rup orig/egcc-CVS20030716/gcc/cfgloop.c egcc-CVS20030716/gcc/cfgloop.c
--- orig/egcc-CVS20030716/gcc/cfgloop.c 2003-07-03 20:00:43.000000000 -0400
+++ egcc-CVS20030716/gcc/cfgloop.c 2003-07-17 00:48:12.028412000 -0400
@@ -241,7 +241,7 @@ flow_loop_entry_edges_find (struct loop
if (! num_entries)
abort ();
- loop->entry_edges = (edge *) xmalloc (num_entries * sizeof (edge *));
+ loop->entry_edges = xmalloc (num_entries * sizeof (edge *));
num_entries = 0;
for (e = loop->header->pred; e; e = e->pred_next)
@@ -288,7 +288,7 @@ flow_loop_exit_edges_find (struct loop *
return;
}
- loop->exit_edges = (edge *) xmalloc (num_exits * sizeof (edge *));
+ loop->exit_edges = xmalloc (num_exits * sizeof (edge *));
/* Store all exiting edges into an array. */
num_exits = 0;
@@ -322,7 +322,7 @@ flow_loop_nodes_find (basic_block header
if (loop->latch->loop_father != loop)
{
- stack = (basic_block *) xmalloc (n_basic_blocks * sizeof (basic_block));
+ stack = xmalloc (n_basic_blocks * sizeof (basic_block));
sp = 0;
num_nodes++;
stack[sp++] = loop->latch;
@@ -380,7 +380,7 @@ flow_loop_pre_header_scan (struct loop *
num++)
ebb = ebb->pred->src;
- loop->pre_header_edges = (edge *) xmalloc (num * sizeof (edge));
+ loop->pre_header_edges = xmalloc (num * sizeof (edge));
loop->num_pre_header_edges = num;
/* Store edges in order that they are followed. The source of the first edge
@@ -817,7 +817,7 @@ flow_loops_find (struct loops *loops, in
}
/* Allocate loop structures. */
- loops->parray = (struct loop **) xcalloc (num_loops + 1, sizeof (struct loop *));
+ loops->parray = xcalloc (num_loops + 1, sizeof (struct loop *));
/* Dummy loop containing whole function. */
loops->parray[0] = xcalloc (1, sizeof (struct loop));
@@ -844,8 +844,8 @@ flow_loops_find (struct loops *loops, in
{
/* Compute depth first search order of the CFG so that outer
natural loops will be found before inner natural loops. */
- dfs_order = (int *) xmalloc (n_basic_blocks * sizeof (int));
- rc_order = (int *) xmalloc (n_basic_blocks * sizeof (int));
+ dfs_order = xmalloc (n_basic_blocks * sizeof (int));
+ rc_order = xmalloc (n_basic_blocks * sizeof (int));
flow_depth_first_order_compute (dfs_order, rc_order);
/* Save CFG derived information to avoid recomputing it. */
diff -rup orig/egcc-CVS20030716/gcc/cfgrtl.c egcc-CVS20030716/gcc/cfgrtl.c
--- orig/egcc-CVS20030716/gcc/cfgrtl.c 2003-07-07 20:01:48.000000000 -0400
+++ egcc-CVS20030716/gcc/cfgrtl.c 2003-07-17 00:49:02.895301000 -0400
@@ -1724,12 +1724,9 @@ print_rtl_with_bb (FILE *outf, rtx rtx_f
{
enum bb_state { NOT_IN_BB, IN_ONE_BB, IN_MULTIPLE_BB };
int max_uid = get_max_uid ();
- basic_block *start
- = (basic_block *) xcalloc (max_uid, sizeof (basic_block));
- basic_block *end
- = (basic_block *) xcalloc (max_uid, sizeof (basic_block));
- enum bb_state *in_bb_p
- = (enum bb_state *) xcalloc (max_uid, sizeof (enum bb_state));
+ basic_block *start = xcalloc (max_uid, sizeof (basic_block));
+ basic_block *end = xcalloc (max_uid, sizeof (basic_block));
+ enum bb_state *in_bb_p = xcalloc (max_uid, sizeof (enum bb_state));
basic_block bb;
@@ -1835,7 +1832,7 @@ rtl_verify_flow_info_1 (void)
int err = 0;
basic_block bb, last_bb_seen;
- bb_info = (basic_block *) xcalloc (max_uid, sizeof (basic_block));
+ bb_info = xcalloc (max_uid, sizeof (basic_block));
/* Check bb chain & numbers. */
last_bb_seen = ENTRY_BLOCK_PTR;
diff -rup orig/egcc-CVS20030716/gcc/collect2.c egcc-CVS20030716/gcc/collect2.c
--- orig/egcc-CVS20030716/gcc/collect2.c 2003-06-29 20:01:01.000000000 -0400
+++ egcc-CVS20030716/gcc/collect2.c 2003-07-17 11:59:14.020693000 -0400
@@ -689,7 +689,7 @@ add_prefix (struct path_prefix *pprefix,
if (len > pprefix->max_len)
pprefix->max_len = len;
- pl = (struct prefix_list *) xmalloc (sizeof (struct prefix_list));
+ pl = xmalloc (sizeof (struct prefix_list));
pl->prefix = xstrdup (prefix);
if (*prev)
@@ -716,7 +716,7 @@ static void
prefix_from_string (const char *p, struct path_prefix *pprefix)
{
const char *startp, *endp;
- char *nstore = (char *) xmalloc (strlen (p) + 3);
+ char *nstore = xmalloc (strlen (p) + 3);
if (debug)
fprintf (stderr, "Convert string '%s' into prefixes, separator = '%c'\n", p, PATH_SEPARATOR);
@@ -838,9 +838,9 @@ main (int argc, char **argv)
/* Do not invoke xcalloc before this point, since locale needs to be
set first, in case a diagnostic is issued. */
- ld1 = (const char **)(ld1_argv = (char **) xcalloc(sizeof (char *), argc+3));
- ld2 = (const char **)(ld2_argv = (char **) xcalloc(sizeof (char *), argc+10));
- object = (const char **)(object_lst = (char **) xcalloc(sizeof (char *), argc));
+ ld1 = (const char **)(ld1_argv = xcalloc(sizeof (char *), argc+3));
+ ld2 = (const char **)(ld2_argv = xcalloc(sizeof (char *), argc+10));
+ object = (const char **)(object_lst = xcalloc(sizeof (char *), argc));
#ifdef DEBUG
debug = 1;
@@ -865,7 +865,7 @@ main (int argc, char **argv)
#endif
obstack_begin (&temporary_obstack, 0);
- temporary_firstobj = (char *) obstack_alloc (&temporary_obstack, 0);
+ temporary_firstobj = obstack_alloc (&temporary_obstack, 0);
current_demangling_style = auto_demangling;
p = getenv ("COLLECT_GCC_OPTIONS");
@@ -880,8 +880,7 @@ main (int argc, char **argv)
/* -fno-exceptions -w */
num_c_args += 2;
- c_ptr = (const char **)
- (c_argv = (char **) xcalloc (sizeof (char *), num_c_args));
+ c_ptr = (const char **) (c_argv = xcalloc (sizeof (char *), num_c_args));
if (argc < 2)
fatal ("no arguments");
@@ -1337,7 +1336,7 @@ main (int argc, char **argv)
/* Strip now if it was requested on the command line. */
if (strip_flag)
{
- char **real_strip_argv = (char **) xcalloc (sizeof (char *), 3);
+ char **real_strip_argv = xcalloc (sizeof (char *), 3);
const char ** strip_argv = (const char **) real_strip_argv;
strip_argv[0] = strip_file_name;
@@ -1579,8 +1578,7 @@ static long sequence_number = 0;
static void
add_to_list (struct head *head_ptr, const char *name)
{
- struct id *newid
- = (struct id *) xcalloc (sizeof (struct id) + strlen (name), 1);
+ struct id *newid = xcalloc (sizeof (struct id) + strlen (name), 1);
struct id *p;
strcpy (newid->name, name);
@@ -2278,7 +2276,7 @@ locatelib (const char *name)
cnt++;
q = xstrdup (p);
}
- l = (const char **) xmalloc ((cnt + 3) * sizeof (char *));
+ l = xmalloc ((cnt + 3) * sizeof (char *));
pp = l;
if (ldr)
{
diff -rup orig/egcc-CVS20030716/gcc/combine.c egcc-CVS20030716/gcc/combine.c
--- orig/egcc-CVS20030716/gcc/combine.c 2003-07-16 20:01:26.000000000 -0400
+++ egcc-CVS20030716/gcc/combine.c 2003-07-17 02:01:37.325099000 -0400
@@ -456,7 +456,7 @@ do_SUBST (rtx *into, rtx newval)
if (undobuf.frees)
buf = undobuf.frees, undobuf.frees = buf->next;
else
- buf = (struct undo *) xmalloc (sizeof (struct undo));
+ buf = xmalloc (sizeof (struct undo));
buf->is_int = 0;
buf->where.r = into;
@@ -484,7 +484,7 @@ do_SUBST_INT (int *into, int newval)
if (undobuf.frees)
buf = undobuf.frees, undobuf.frees = buf->next;
else
- buf = (struct undo *) xmalloc (sizeof (struct undo));
+ buf = xmalloc (sizeof (struct undo));
buf->is_int = 1;
buf->where.i = into;
@@ -520,23 +520,18 @@ combine_instructions (rtx f, unsigned in
combine_max_regno = nregs;
- reg_nonzero_bits = ((unsigned HOST_WIDE_INT *)
- xcalloc (nregs, sizeof (unsigned HOST_WIDE_INT)));
- reg_sign_bit_copies
- = (unsigned char *) xcalloc (nregs, sizeof (unsigned char));
-
- reg_last_death = (rtx *) xmalloc (nregs * sizeof (rtx));
- reg_last_set = (rtx *) xmalloc (nregs * sizeof (rtx));
- reg_last_set_value = (rtx *) xmalloc (nregs * sizeof (rtx));
- reg_last_set_table_tick = (int *) xmalloc (nregs * sizeof (int));
- reg_last_set_label = (int *) xmalloc (nregs * sizeof (int));
- reg_last_set_invalid = (char *) xmalloc (nregs * sizeof (char));
- reg_last_set_mode
- = (enum machine_mode *) xmalloc (nregs * sizeof (enum machine_mode));
- reg_last_set_nonzero_bits
- = (unsigned HOST_WIDE_INT *) xmalloc (nregs * sizeof (HOST_WIDE_INT));
- reg_last_set_sign_bit_copies
- = (char *) xmalloc (nregs * sizeof (char));
+ reg_nonzero_bits = xcalloc (nregs, sizeof (unsigned HOST_WIDE_INT));
+ reg_sign_bit_copies = xcalloc (nregs, sizeof (unsigned char));
+
+ reg_last_death = xmalloc (nregs * sizeof (rtx));
+ reg_last_set = xmalloc (nregs * sizeof (rtx));
+ reg_last_set_value = xmalloc (nregs * sizeof (rtx));
+ reg_last_set_table_tick = xmalloc (nregs * sizeof (int));
+ reg_last_set_label = xmalloc (nregs * sizeof (int));
+ reg_last_set_invalid = xmalloc (nregs * sizeof (char));
+ reg_last_set_mode = xmalloc (nregs * sizeof (enum machine_mode));
+ reg_last_set_nonzero_bits = xmalloc (nregs * sizeof (HOST_WIDE_INT));
+ reg_last_set_sign_bit_copies = xmalloc (nregs * sizeof (char));
init_reg_last_arrays ();
@@ -548,7 +543,7 @@ combine_instructions (rtx f, unsigned in
if (INSN_UID (insn) > i)
i = INSN_UID (insn);
- uid_cuid = (int *) xmalloc ((i + 1) * sizeof (int));
+ uid_cuid = xmalloc ((i + 1) * sizeof (int));
max_uid_cuid = i;
nonzero_bits_mode = mode_for_size (HOST_BITS_PER_WIDE_INT, MODE_INT, 0);
@@ -788,14 +783,14 @@ init_reg_last_arrays (void)
{
unsigned int nregs = combine_max_regno;
- memset ((char *) reg_last_death, 0, nregs * sizeof (rtx));
- memset ((char *) reg_last_set, 0, nregs * sizeof (rtx));
- memset ((char *) reg_last_set_value, 0, nregs * sizeof (rtx));
- memset ((char *) reg_last_set_table_tick, 0, nregs * sizeof (int));
- memset ((char *) reg_last_set_label, 0, nregs * sizeof (int));
+ memset (reg_last_death, 0, nregs * sizeof (rtx));
+ memset (reg_last_set, 0, nregs * sizeof (rtx));
+ memset (reg_last_set_value, 0, nregs * sizeof (rtx));
+ memset (reg_last_set_table_tick, 0, nregs * sizeof (int));
+ memset (reg_last_set_label, 0, nregs * sizeof (int));
memset (reg_last_set_invalid, 0, nregs * sizeof (char));
- memset ((char *) reg_last_set_mode, 0, nregs * sizeof (enum machine_mode));
- memset ((char *) reg_last_set_nonzero_bits, 0, nregs * sizeof (HOST_WIDE_INT));
+ memset (reg_last_set_mode, 0, nregs * sizeof (enum machine_mode));
+ memset (reg_last_set_nonzero_bits, 0, nregs * sizeof (HOST_WIDE_INT));
memset (reg_last_set_sign_bit_copies, 0, nregs * sizeof (char));
}
diff -rup orig/egcc-CVS20030716/gcc/conflict.c egcc-CVS20030716/gcc/conflict.c
--- orig/egcc-CVS20030716/gcc/conflict.c 2003-06-29 20:01:01.000000000 -0400
+++ egcc-CVS20030716/gcc/conflict.c 2003-07-17 11:29:12.326191000 -0400
@@ -148,8 +148,7 @@ arc_eq (const void *arcp1, const void *a
conflict_graph
conflict_graph_new (int num_regs)
{
- conflict_graph graph
- = (conflict_graph) xmalloc (sizeof (struct conflict_graph_def));
+ conflict_graph graph = xmalloc (sizeof (struct conflict_graph_def));
graph->num_regs = num_regs;
/* Set up the hash table. No delete action is specified; memory
@@ -161,8 +160,7 @@ conflict_graph_new (int num_regs)
obstack_init (&graph->arc_obstack);
/* Create and zero the lookup table by register number. */
- graph->neighbor_heads
- = (conflict_graph_arc *) xmalloc (num_regs * sizeof (conflict_graph_arc));
+ graph->neighbor_heads = xmalloc (num_regs * sizeof (conflict_graph_arc));
memset (graph->neighbor_heads, 0, num_regs * sizeof (conflict_graph_arc));
return graph;
@@ -206,8 +204,7 @@ conflict_graph_add (conflict_graph graph
/* Allocate an arc. */
arc
- = (conflict_graph_arc)
- obstack_alloc (&graph->arc_obstack,
+ = obstack_alloc (&graph->arc_obstack,
sizeof (struct conflict_graph_arc_def));
/* Record the reg numbers. */
diff -rup orig/egcc-CVS20030716/gcc/coverage.c egcc-CVS20030716/gcc/coverage.c
--- orig/egcc-CVS20030716/gcc/coverage.c 2003-07-12 22:25:54.000000000 -0400
+++ egcc-CVS20030716/gcc/coverage.c 2003-07-17 11:59:54.207026000 -0400
@@ -888,12 +888,12 @@ coverage_init (const char *filename)
int len = strlen (filename);
/* Name of da file. */
- da_file_name = (char *) xmalloc (len + strlen (GCOV_DATA_SUFFIX) + 1);
+ da_file_name = xmalloc (len + strlen (GCOV_DATA_SUFFIX) + 1);
strcpy (da_file_name, filename);
strcat (da_file_name, GCOV_DATA_SUFFIX);
/* Name of bbg file. */
- bbg_file_name = (char *) xmalloc (len + strlen (GCOV_NOTE_SUFFIX) + 1);
+ bbg_file_name = xmalloc (len + strlen (GCOV_NOTE_SUFFIX) + 1);
strcpy (bbg_file_name, filename);
strcat (bbg_file_name, GCOV_NOTE_SUFFIX);
diff -rup orig/egcc-CVS20030716/gcc/cppexp.c egcc-CVS20030716/gcc/cppexp.c
--- orig/egcc-CVS20030716/gcc/cppexp.c 2003-07-13 20:02:25.000000000 -0400
+++ egcc-CVS20030716/gcc/cppexp.c 2003-07-17 01:03:23.172042000 -0400
@@ -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 new_size = old_size * 2 + 20;
- pfile->op_stack = (struct op *) xrealloc (pfile->op_stack,
- new_size * sizeof (struct op));
+ pfile->op_stack = xrealloc (pfile->op_stack, new_size * sizeof (struct op));
pfile->op_limit = pfile->op_stack + new_size;
return pfile->op_stack + old_size;
diff -rup orig/egcc-CVS20030716/gcc/cppfiles.c egcc-CVS20030716/gcc/cppfiles.c
--- orig/egcc-CVS20030716/gcc/cppfiles.c 2003-07-13 20:02:25.000000000 -0400
+++ egcc-CVS20030716/gcc/cppfiles.c 2003-07-17 01:30:20.277674000 -0400
@@ -459,7 +459,7 @@ read_include_file (cpp_reader *pfile, st
size = inc->st.st_size;
{
- buf = (uchar *) xmalloc (size + 1);
+ buf = xmalloc (size + 1);
offset = 0;
while (offset < size)
{
@@ -494,7 +494,7 @@ read_include_file (cpp_reader *pfile, st
bigger than the majority of C source files. */
size = 8 * 1024;
- buf = (uchar *) xmalloc (size + 1);
+ buf = xmalloc (size + 1);
offset = 0;
while ((count = read (inc->fd, buf + offset, size - offset)) > 0)
{
@@ -553,7 +553,7 @@ cpp_included (cpp_reader *pfile, const c
}
/* Search directory path for the file. */
- name = (char *) alloca (strlen (fname) + pfile->max_include_len + 2);
+ name = alloca (strlen (fname) + pfile->max_include_len + 2);
for (path = pfile->quote_include; path; path = path->next)
{
memcpy (name, path->name, path->len);
@@ -611,7 +611,7 @@ find_include_file (cpp_reader *pfile, co
}
/* Search directory path for the file. */
- name = (char *) alloca (strlen (fname) + pfile->max_include_len + 2);
+ name = alloca (strlen (fname) + pfile->max_include_len + 2);
for (; path; path = path->next)
{
int len = path->len;
@@ -924,14 +924,13 @@ read_name_map (cpp_reader *pfile, const
if (! strcmp (map_list_ptr->map_list_name, dirname))
return map_list_ptr->map_list_map;
- map_list_ptr = ((struct file_name_map_list *)
- xmalloc (sizeof (struct file_name_map_list)));
+ map_list_ptr = xmalloc (sizeof (struct file_name_map_list));
map_list_ptr->map_list_name = xstrdup (dirname);
/* The end of the list ends in NULL. */
map_list_ptr->map_list_map = NULL;
- name = (char *) alloca (strlen (dirname) + strlen (FILE_NAME_MAP_FILE) + 2);
+ name = alloca (strlen (dirname) + strlen (FILE_NAME_MAP_FILE) + 2);
strcpy (name, dirname);
if (*dirname)
strcat (name, "/");
@@ -955,8 +954,7 @@ read_name_map (cpp_reader *pfile, const
;
to = read_filename_string (ch, f);
- ptr = ((struct file_name_map *)
- xmalloc (sizeof (struct file_name_map)));
+ ptr = xmalloc (sizeof (struct file_name_map));
ptr->map_from = from;
/* Make the real filename absolute. */
@@ -1025,7 +1023,7 @@ remap_filename (cpp_reader *pfile, char
if (p == name)
cpp_error (pfile, DL_ICE, "absolute file name in remap_filename");
- dir = (char *) alloca (p - name + 1);
+ dir = alloca (p - name + 1);
memcpy (dir, name, p - name);
dir[p - name] = '\0';
from = p + 1;
diff -rup orig/egcc-CVS20030716/gcc/cpphash.c egcc-CVS20030716/gcc/cpphash.c
--- orig/egcc-CVS20030716/gcc/cpphash.c 2003-07-13 20:02:26.000000000 -0400
+++ egcc-CVS20030716/gcc/cpphash.c 2003-07-17 12:00:17.884897000 -0400
@@ -37,8 +37,7 @@ alloc_node (hash_table *table)
{
cpp_hashnode *node;
- node = (cpp_hashnode *) obstack_alloc (&table->pfile->hash_ob,
- sizeof (cpp_hashnode));
+ node = obstack_alloc (&table->pfile->hash_ob, sizeof (cpp_hashnode));
memset (node, 0, sizeof (cpp_hashnode));
return node;
}
diff -rup orig/egcc-CVS20030716/gcc/cppinit.c egcc-CVS20030716/gcc/cppinit.c
--- orig/egcc-CVS20030716/gcc/cppinit.c 2003-07-13 20:02:26.000000000 -0400
+++ egcc-CVS20030716/gcc/cppinit.c 2003-07-17 01:05:49.568600000 -0400
@@ -130,7 +130,7 @@ cpp_create_reader (enum c_lang lang, has
/* Initialize this instance of the library if it hasn't been already. */
init_library ();
- pfile = (cpp_reader *) xcalloc (1, sizeof (cpp_reader));
+ pfile = xcalloc (1, sizeof (cpp_reader));
cpp_set_lang (pfile, lang);
CPP_OPTION (pfile, warn_import) = 1;
diff -rup orig/egcc-CVS20030716/gcc/cpplex.c egcc-CVS20030716/gcc/cpplex.c
--- orig/egcc-CVS20030716/gcc/cpplex.c 2003-07-13 20:02:26.000000000 -0400
+++ egcc-CVS20030716/gcc/cpplex.c 2003-07-17 01:30:37.146387000 -0400
@@ -88,8 +88,8 @@ add_line_note (cpp_buffer *buffer, const
if (buffer->notes_used == buffer->notes_cap)
{
buffer->notes_cap = buffer->notes_cap * 2 + 200;
- buffer->notes = (_cpp_line_note *)
- xrealloc (buffer->notes, buffer->notes_cap * sizeof (_cpp_line_note));
+ buffer->notes = xrealloc (buffer->notes,
+ buffer->notes_cap * sizeof (_cpp_line_note));
}
buffer->notes[buffer->notes_used].pos = pos;
diff -rup orig/egcc-CVS20030716/gcc/cpplib.c egcc-CVS20030716/gcc/cpplib.c
--- orig/egcc-CVS20030716/gcc/cpplib.c 2003-07-13 20:02:26.000000000 -0400
+++ egcc-CVS20030716/gcc/cpplib.c 2003-07-17 01:06:30.644883000 -0400
@@ -1805,7 +1805,7 @@ cpp_define (cpp_reader *pfile, const cha
tack " 1" on the end. */
count = strlen (str);
- buf = (char *) alloca (count + 3);
+ buf = alloca (count + 3);
memcpy (buf, str, count);
p = strchr (str, '=');
@@ -1866,7 +1866,7 @@ handle_assertion (cpp_reader *pfile, con
/* Copy the entire option so we can modify it. Change the first
"=" in the string to a '(', and tack a ')' on the end. */
- char *buf = (char *) alloca (count + 2);
+ char *buf = alloca (count + 2);
memcpy (buf, str, count);
if (p)
diff -rup orig/egcc-CVS20030716/gcc/cppmacro.c egcc-CVS20030716/gcc/cppmacro.c
--- orig/egcc-CVS20030716/gcc/cppmacro.c 2003-07-13 20:02:27.000000000 -0400
+++ egcc-CVS20030716/gcc/cppmacro.c 2003-07-17 01:31:18.253574000 -0400
@@ -414,7 +414,7 @@ paste_tokens (cpp_reader *pfile, const c
lhs = *plhs;
len = cpp_token_len (lhs) + cpp_token_len (rhs) + 1;
- buf = (unsigned char *) alloca (len);
+ buf = alloca (len);
end = cpp_spell_token (pfile, lhs, buf);
/* Avoid comment headers, since they are still processed in stage 3.
@@ -991,8 +991,7 @@ expand_arg (cpp_reader *pfile, macro_arg
/* Loop, reading in the arguments. */
capacity = 256;
- arg->expanded = (const cpp_token **)
- xmalloc (capacity * sizeof (cpp_token *));
+ arg->expanded = xmalloc (capacity * sizeof (cpp_token *));
push_ptoken_context (pfile, NULL, NULL, arg->first, arg->count + 1);
for (;;)
@@ -1002,8 +1001,8 @@ expand_arg (cpp_reader *pfile, macro_arg
if (arg->expanded_count + 1 >= capacity)
{
capacity *= 2;
- arg->expanded = (const cpp_token **)
- xrealloc (arg->expanded, capacity * sizeof (cpp_token *));
+ arg->expanded = xrealloc (arg->expanded,
+ capacity * sizeof (cpp_token *));
}
token = cpp_get_token (pfile);
@@ -1257,7 +1256,7 @@ _cpp_save_parameter (cpp_reader *pfile,
len = macro->paramc * sizeof (union _cpp_hashnode_value);
if (len > pfile->macro_buffer_len)
{
- pfile->macro_buffer = (uchar *) xrealloc (pfile->macro_buffer, len);
+ pfile->macro_buffer = xrealloc (pfile->macro_buffer, len);
pfile->macro_buffer_len = len;
}
((union _cpp_hashnode_value *) pfile->macro_buffer)[macro->paramc - 1]
@@ -1648,7 +1647,7 @@ cpp_macro_definition (cpp_reader *pfile,
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;
}
diff -rup orig/egcc-CVS20030716/gcc/cppspec.c egcc-CVS20030716/gcc/cppspec.c
--- orig/egcc-CVS20030716/gcc/cppspec.c 2003-06-17 10:11:27.000000000 -0400
+++ egcc-CVS20030716/gcc/cppspec.c 2003-07-17 01:07:21.900219000 -0400
@@ -172,7 +172,7 @@ lang_specific_driver (int *in_argc, cons
return;
/* One more slot for a terminating null. */
- new_argv = (const char **) xmalloc ((new_argc + 1) * sizeof(char *));
+ new_argv = xmalloc ((new_argc + 1) * sizeof(char *));
new_argv[0] = argv[0];
j = 1;
diff -rup orig/egcc-CVS20030716/gcc/cpptrad.c egcc-CVS20030716/gcc/cpptrad.c
--- orig/egcc-CVS20030716/gcc/cpptrad.c 2003-07-13 20:02:27.000000000 -0400
+++ egcc-CVS20030716/gcc/cpptrad.c 2003-07-17 01:07:33.289147000 -0400
@@ -107,8 +107,7 @@ check_output_buffer (cpp_reader *pfile,
size_t size = pfile->out.cur - pfile->out.base;
size_t new_size = (size + n) * 3 / 2;
- pfile->out.base
- = (uchar *) xrealloc (pfile->out.base, new_size);
+ pfile->out.base = xrealloc (pfile->out.base, new_size);
pfile->out.limit = pfile->out.base + new_size;
pfile->out.cur = pfile->out.base + size;
}
diff -rup orig/egcc-CVS20030716/gcc/cse.c egcc-CVS20030716/gcc/cse.c
--- orig/egcc-CVS20030716/gcc/cse.c 2003-06-30 23:48:26.000000000 -0400
+++ egcc-CVS20030716/gcc/cse.c 2003-07-17 02:01:48.874534000 -0400
@@ -929,7 +929,7 @@ get_cse_reg_info (unsigned int regno)
cse_reg_info_free_list = p->next;
}
else
- p = (struct cse_reg_info *) xmalloc (sizeof (struct cse_reg_info));
+ p = xmalloc (sizeof (struct cse_reg_info));
/* Insert into hash table. */
p->hash_next = *hash_head;
@@ -967,7 +967,7 @@ new_basic_block (void)
/* 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)
{
@@ -1540,7 +1540,7 @@ insert (rtx x, struct table_elt *classp,
else
{
n_elements_made++;
- elt = (struct table_elt *) xmalloc (sizeof (struct table_elt));
+ elt = xmalloc (sizeof (struct table_elt));
}
elt->exp = x;
@@ -4692,7 +4692,7 @@ cse_insn (rtx insn, rtx libcall_insn)
if (GET_CODE (x) == SET)
{
- sets = (struct set *) alloca (sizeof (struct set));
+ sets = alloca (sizeof (struct set));
sets[0].rtl = x;
/* Ignore SETs that are unconditional jumps.
@@ -4727,7 +4727,7 @@ cse_insn (rtx insn, rtx libcall_insn)
{
int lim = XVECLEN (x, 0);
- sets = (struct set *) alloca (lim * sizeof (struct set));
+ sets = alloca (lim * sizeof (struct set));
/* Find all regs explicitly clobbered in this insn,
and ensure they are not replaced with any other regs
@@ -6939,8 +6939,7 @@ cse_main (rtx f, int nregs, int after_lo
max_insn_uid = get_max_uid ();
- reg_eqv_table = (struct reg_eqv_elem *)
- xmalloc (nregs * sizeof (struct reg_eqv_elem));
+ reg_eqv_table = xmalloc (nregs * sizeof (struct reg_eqv_elem));
#ifdef LOAD_EXTEND_OP
@@ -6956,7 +6955,7 @@ cse_main (rtx f, int nregs, int after_lo
/* Find the largest uid. */
max_uid = get_max_uid ();
- uid_cuid = (int *) xcalloc (max_uid + 1, sizeof (int));
+ uid_cuid = xcalloc (max_uid + 1, sizeof (int));
/* Compute the mapping from uids to cuids.
CUIDs are numbers assigned to insns, like uids,
@@ -7075,9 +7074,7 @@ cse_basic_block (rtx from, rtx to, struc
/* This array is undefined before max_reg, so only allocate
the space actually needed and adjust the start. */
- qty_table
- = (struct qty_table_elem *) xmalloc ((max_qty - max_reg)
- * sizeof (struct qty_table_elem));
+ qty_table = xmalloc ((max_qty - max_reg) * sizeof (struct qty_table_elem));
qty_table -= max_reg;
new_basic_block ();
@@ -7536,7 +7533,7 @@ delete_trivially_dead_insns (rtx insns,
timevar_push (TV_DELETE_TRIVIALLY_DEAD);
/* First count the number of times each register is used. */
- counts = (int *) xcalloc (nreg, sizeof (int));
+ counts = xcalloc (nreg, sizeof (int));
for (insn = next_real_insn (insns); insn; insn = next_real_insn (insn))
count_reg_usage (insn, counts, NULL_RTX, 1);
diff -rup orig/egcc-CVS20030716/gcc/cselib.c egcc-CVS20030716/gcc/cselib.c
--- orig/egcc-CVS20030716/gcc/cselib.c 2003-06-29 20:01:03.000000000 -0400
+++ egcc-CVS20030716/gcc/cselib.c 2003-07-17 10:47:36.093184000 -0400
@@ -147,7 +147,7 @@ new_elt_list (struct elt_list *next, cse
if (el)
empty_elt_lists = el->next;
else
- el = (struct elt_list *) ggc_alloc (sizeof (struct elt_list));
+ el = ggc_alloc (sizeof (struct elt_list));
el->next = next;
el->elt = elt;
return el;
@@ -164,7 +164,7 @@ new_elt_loc_list (struct elt_loc_list *n
if (el)
empty_elt_loc_lists = el->next;
else
- el = (struct elt_loc_list *) ggc_alloc (sizeof (struct elt_loc_list));
+ el = ggc_alloc (sizeof (struct elt_loc_list));
el->next = next;
el->loc = loc;
el->setting_insn = cselib_current_insn;
@@ -704,7 +704,7 @@ new_cselib_val (unsigned int value, enum
if (e)
empty_vals = e->u.next_free;
else
- e = (cselib_val *) ggc_alloc (sizeof (cselib_val));
+ e = ggc_alloc (sizeof (cselib_val));
if (value == 0)
abort ();
diff -rup orig/egcc-CVS20030716/gcc/dbxout.c egcc-CVS20030716/gcc/dbxout.c
--- orig/egcc-CVS20030716/gcc/dbxout.c 2003-07-15 20:01:41.000000000 -0400
+++ egcc-CVS20030716/gcc/dbxout.c 2003-07-17 10:48:32.767903000 -0400
@@ -459,7 +459,7 @@ dbxout_init (const char *input_file_name
asmfile = asm_out_file;
typevec_len = 100;
- typevec = (struct typeinfo *) ggc_calloc (typevec_len, sizeof typevec[0]);
+ typevec = ggc_calloc (typevec_len, sizeof typevec[0]);
/* Convert Ltext into the appropriate format for local labels in case
the system doesn't insert underscores in front of user generated
@@ -513,7 +513,7 @@ dbxout_init (const char *input_file_name
next_type_number = 1;
#ifdef DBX_USE_BINCL
- current_file = (struct dbx_file *) ggc_alloc (sizeof *current_file);
+ current_file = ggc_alloc (sizeof *current_file);
current_file->next = NULL;
current_file->file_number = 0;
current_file->next_type_number = 1;
@@ -626,7 +626,7 @@ dbxout_start_source_file (unsigned int l
const char *filename ATTRIBUTE_UNUSED)
{
#ifdef DBX_USE_BINCL
- struct dbx_file *n = (struct dbx_file *) ggc_alloc (sizeof *n);
+ struct dbx_file *n = ggc_alloc (sizeof *n);
n->next = current_file;
n->next_type_number = 1;
@@ -1262,11 +1262,8 @@ dbxout_type (tree type, int full)
if (next_type_number == typevec_len)
{
typevec
- = (struct typeinfo *) ggc_realloc (typevec,
- (typevec_len * 2
- * sizeof typevec[0]));
- memset ((char *) (typevec + typevec_len), 0,
- typevec_len * sizeof typevec[0]);
+ = ggc_realloc (typevec, (typevec_len * 2 * sizeof typevec[0]));
+ memset (typevec + typevec_len, 0, typevec_len * sizeof typevec[0]);
typevec_len *= 2;
}
diff -rup orig/egcc-CVS20030716/gcc/defaults.h egcc-CVS20030716/gcc/defaults.h
--- orig/egcc-CVS20030716/gcc/defaults.h 2003-07-08 22:24:09.000000000 -0400
+++ egcc-CVS20030716/gcc/defaults.h 2003-07-17 01:09:09.830504000 -0400
@@ -66,7 +66,7 @@ Software Foundation, 59 Temple Place - S
#ifndef ASM_FORMAT_PRIVATE_NAME
# define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
do { const char *const name_ = (NAME); \
- char *const output_ = (OUTPUT) = (char *) alloca (strlen (name_) + 32);\
+ char *const output_ = (OUTPUT) = alloca (strlen (name_) + 32);\
sprintf (output_, ASM_PN_FORMAT, name_, (unsigned long)(LABELNO)); \
} while (0)
#endif
diff -rup orig/egcc-CVS20030716/gcc/df.c egcc-CVS20030716/gcc/df.c
--- orig/egcc-CVS20030716/gcc/df.c 2003-07-01 14:29:45.000000000 -0400
+++ egcc-CVS20030716/gcc/df.c 2003-07-17 01:32:14.959823000 -0400
@@ -316,8 +316,7 @@ df_insn_table_realloc (struct df *df, un
to enlarge it so often. */
size += df->insn_size / 4;
- df->insns = (struct insn_info *)
- xrealloc (df->insns, size * sizeof (struct insn_info));
+ df->insns = xrealloc (df->insns, size * sizeof (struct insn_info));
memset (df->insns + df->insn_size, 0,
(size - df->insn_size) * sizeof (struct insn_info));
@@ -344,8 +343,7 @@ df_reg_table_realloc (struct df *df, int
if (size < max_reg_num ())
size = max_reg_num ();
- df->regs = (struct reg_info *)
- xrealloc (df->regs, size * sizeof (struct reg_info));
+ df->regs = xrealloc (df->regs, size * sizeof (struct reg_info));
/* Zero the new entries. */
memset (df->regs + df->reg_size, 0,
diff -rup orig/egcc-CVS20030716/gcc/dominance.c egcc-CVS20030716/gcc/dominance.c
--- orig/egcc-CVS20030716/gcc/dominance.c 2003-06-29 20:01:08.000000000 -0400
+++ egcc-CVS20030716/gcc/dominance.c 2003-07-17 01:10:17.574271000 -0400
@@ -133,10 +133,10 @@ void debug_dominance_info (dominance_inf
{ \
unsigned int i = 1; /* Catch content == i. */ \
if (! (content)) \
- (var) = (type *) xcalloc ((num), sizeof (type)); \
+ (var) = xcalloc ((num), sizeof (type)); \
else \
{ \
- (var) = (type *) xmalloc ((num) * sizeof (type)); \
+ (var) = xmalloc ((num) * sizeof (type)); \
for (i = 0; i < num; i++) \
(var)[i] = (content); \
} \
@@ -212,7 +212,7 @@ calc_dfs_tree_nonrec (struct dom_info *d
/* Ending block. */
basic_block ex_block;
- stack = (edge *) xmalloc ((n_basic_blocks + 3) * sizeof (edge));
+ stack = xmalloc ((n_basic_blocks + 3) * sizeof (edge));
sp = 0;
/* Initialize our border blocks, and the first edge. */
diff -rup orig/egcc-CVS20030716/gcc/dwarf2out.c egcc-CVS20030716/gcc/dwarf2out.c
--- orig/egcc-CVS20030716/gcc/dwarf2out.c 2003-07-15 20:01:42.000000000 -0400
+++ egcc-CVS20030716/gcc/dwarf2out.c 2003-07-17 11:54:32.746028000 -0400
@@ -553,7 +553,7 @@ dwarf_cfi_name (unsigned int cfi_opc)
static inline dw_cfi_ref
new_cfi (void)
{
- dw_cfi_ref cfi = (dw_cfi_ref) ggc_alloc (sizeof (dw_cfi_node));
+ dw_cfi_ref cfi = ggc_alloc (sizeof (dw_cfi_node));
cfi->dw_cfi_next = NULL;
cfi->dw_cfi_oprnd1.dw_cfi_reg_num = 0;
@@ -2248,8 +2248,7 @@ void
dwarf2out_frame_init (void)
{
/* Allocate the initial hunk of the fde_table. */
- fde_table = (dw_fde_ref) ggc_alloc_cleared (FDE_TABLE_INCREMENT
- * sizeof (dw_fde_node));
+ fde_table = ggc_alloc_cleared (FDE_TABLE_INCREMENT * sizeof (dw_fde_node));
fde_table_allocated = FDE_TABLE_INCREMENT;
fde_table_in_use = 0;
@@ -2719,8 +2718,7 @@ static inline dw_loc_descr_ref
new_loc_descr (enum dwarf_location_atom op, long unsigned int oprnd1,
long unsigned int oprnd2)
{
- dw_loc_descr_ref descr
- = (dw_loc_descr_ref) ggc_alloc_cleared (sizeof (dw_loc_descr_node));
+ dw_loc_descr_ref descr = ggc_alloc_cleared (sizeof (dw_loc_descr_node));
descr->dw_loc_opc = op;
descr->dw_loc_oprnd1.val_class = dw_val_class_unsigned_const;
@@ -4444,7 +4442,7 @@ AT_class (dw_attr_ref a)
static inline void
add_AT_flag (dw_die_ref die, enum dwarf_attribute attr_kind, unsigned int flag)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4467,7 +4465,7 @@ AT_flag (dw_attr_ref a)
static inline void
add_AT_int (dw_die_ref die, enum dwarf_attribute attr_kind, long int int_val)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4491,7 +4489,7 @@ static inline void
add_AT_unsigned (dw_die_ref die, enum dwarf_attribute attr_kind,
long unsigned int unsigned_val)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4515,7 +4513,7 @@ static inline void
add_AT_long_long (dw_die_ref die, enum dwarf_attribute attr_kind,
long unsigned int val_hi, long unsigned int val_low)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4531,7 +4529,7 @@ static inline void
add_AT_float (dw_die_ref die, enum dwarf_attribute attr_kind,
unsigned int length, long int *array)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4561,7 +4559,7 @@ debug_str_eq (const void *x1, const void
static inline void
add_AT_string (dw_die_ref die, enum dwarf_attribute attr_kind, const char *str)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
struct indirect_string_node *node;
void **slot;
@@ -4638,7 +4636,7 @@ AT_string_form (dw_attr_ref a)
static inline void
add_AT_die_ref (dw_die_ref die, enum dwarf_attribute attr_kind, dw_die_ref targ_die)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4680,7 +4678,7 @@ set_AT_ref_external (dw_attr_ref a, int
static inline void
add_AT_fde_ref (dw_die_ref die, enum dwarf_attribute attr_kind, unsigned int targ_fde)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4694,7 +4692,7 @@ add_AT_fde_ref (dw_die_ref die, enum dwa
static inline void
add_AT_loc (dw_die_ref die, enum dwarf_attribute attr_kind, dw_loc_descr_ref loc)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4715,7 +4713,7 @@ AT_loc (dw_attr_ref a)
static inline void
add_AT_loc_list (dw_die_ref die, enum dwarf_attribute attr_kind, dw_loc_list_ref loc_list)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4739,7 +4737,7 @@ AT_loc_list (dw_attr_ref a)
static inline void
add_AT_addr (dw_die_ref die, enum dwarf_attribute attr_kind, rtx addr)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4762,7 +4760,7 @@ AT_addr (dw_attr_ref a)
static inline void
add_AT_lbl_id (dw_die_ref die, enum dwarf_attribute attr_kind, const char *lbl_id)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4776,7 +4774,7 @@ add_AT_lbl_id (dw_die_ref die, enum dwar
static inline void
add_AT_lbl_offset (dw_die_ref die, enum dwarf_attribute attr_kind, const char *label)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4790,7 +4788,7 @@ add_AT_lbl_offset (dw_die_ref die, enum
static inline void
add_AT_offset (dw_die_ref die, enum dwarf_attribute attr_kind, long unsigned int offset)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -4805,7 +4803,7 @@ static void
add_AT_range_list (dw_die_ref die, enum dwarf_attribute attr_kind,
long unsigned int offset)
{
- dw_attr_ref attr = (dw_attr_ref) ggc_alloc (sizeof (dw_attr_node));
+ dw_attr_ref attr = ggc_alloc (sizeof (dw_attr_node));
attr->dw_attr_next = NULL;
attr->dw_attr = attr_kind;
@@ -5089,7 +5087,7 @@ splice_child_die (dw_die_ref parent, dw_
static inline dw_die_ref
new_die (enum dwarf_tag tag_value, dw_die_ref parent_die, tree t)
{
- dw_die_ref die = (dw_die_ref) ggc_alloc_cleared (sizeof (die_node));
+ dw_die_ref die = ggc_alloc_cleared (sizeof (die_node));
die->die_tag = tag_value;
@@ -5153,7 +5151,7 @@ equate_decl_number_to_die (tree decl, dw
decl_die_table = ggc_realloc (decl_die_table,
sizeof (dw_die_ref) * num_allocated);
- memset ((char *) &decl_die_table[decl_die_table_allocated], 0,
+ memset (&decl_die_table[decl_die_table_allocated], 0,
(num_allocated - decl_die_table_allocated) * sizeof (dw_die_ref));
decl_die_table_allocated = num_allocated;
}
@@ -5663,7 +5661,7 @@ compute_section_prefix (dw_die_ref unit_
{
const char *die_name = get_AT_string (unit_die, DW_AT_name);
const char *base = die_name ? lbasename (die_name) : "anonymous";
- char *name = (char *) alloca (strlen (base) + 64);
+ char *name = alloca (strlen (base) + 64);
char *p;
int i, mark;
unsigned char checksum[16];
@@ -6054,7 +6052,7 @@ build_abbrev_table (dw_die_ref die)
abbrev_die_table = ggc_realloc (abbrev_die_table,
sizeof (dw_die_ref) * n_alloc);
- memset ((char *) &abbrev_die_table[abbrev_die_table_allocated], 0,
+ memset (&abbrev_die_table[abbrev_die_table_allocated], 0,
(n_alloc - abbrev_die_table_allocated) * sizeof (dw_die_ref));
abbrev_die_table_allocated = n_alloc;
}
@@ -6724,7 +6722,7 @@ output_comp_unit (dw_die_ref die, int ou
oldsym = die->die_symbol;
if (oldsym)
{
- tmp = (char *) alloca (strlen (oldsym) + 24);
+ tmp = alloca (strlen (oldsym) + 24);
sprintf (tmp, ".gnu.linkonce.wi.%s", oldsym);
secname = tmp;
@@ -6771,9 +6769,8 @@ add_pubname (tree decl, dw_die_ref die)
{
pubname_table_allocated += PUBNAME_TABLE_INCREMENT;
pubname_table
- = (pubname_ref) ggc_realloc (pubname_table,
- (pubname_table_allocated
- * sizeof (pubname_entry)));
+ = ggc_realloc (pubname_table,
+ (pubname_table_allocated * sizeof (pubname_entry)));
memset (pubname_table + pubname_table_in_use, 0,
PUBNAME_TABLE_INCREMENT * sizeof (pubname_entry));
}
@@ -6932,9 +6929,9 @@ add_ranges (tree block)
if (in_use == ranges_table_allocated)
{
ranges_table_allocated += RANGES_TABLE_INCREMENT;
- ranges_table = (dw_ranges_ref)
- ggc_realloc (ranges_table, (ranges_table_allocated
- * sizeof (struct dw_ranges_struct)));
+ ranges_table
+ = ggc_realloc (ranges_table, (ranges_table_allocated
+ * sizeof (struct dw_ranges_struct)));
memset (ranges_table + ranges_table_in_use, 0,
RANGES_TABLE_INCREMENT * sizeof (struct dw_ranges_struct));
}
@@ -7084,10 +7081,8 @@ output_file_names (void)
}
/* Allocate the various arrays we need. */
- files = (struct file_info *) alloca (VARRAY_ACTIVE_SIZE (file_table)
- * sizeof (struct file_info));
- dirs = (struct dir_info *) alloca (VARRAY_ACTIVE_SIZE (file_table)
- * sizeof (struct dir_info));
+ files = alloca (VARRAY_ACTIVE_SIZE (file_table) * sizeof (struct file_info));
+ dirs = alloca (VARRAY_ACTIVE_SIZE (file_table) * sizeof (struct dir_info));
/* Sort the file names. */
for (i = 1; i < VARRAY_ACTIVE_SIZE (file_table); i++)
@@ -7162,8 +7157,8 @@ output_file_names (void)
where we would have to check out every combination of every single
possible prefix. Instead we use a heuristic which provides nearly optimal
results in most cases and never is much off. */
- saved = (int *) alloca (ndirs * sizeof (int));
- savehere = (int *) alloca (ndirs * sizeof (int));
+ saved = alloca (ndirs * sizeof (int));
+ savehere = alloca (ndirs * sizeof (int));
memset (saved, '\0', ndirs * sizeof (saved[0]));
for (i = 0; i < ndirs; i++)
@@ -7220,7 +7215,7 @@ output_file_names (void)
/* We have to emit them in the order they appear in the file_table array
since the index is used in the debug info generation. To do this
efficiently we generate a back-mapping of the indices first. */
- backmap = (int *) alloca (VARRAY_ACTIVE_SIZE (file_table) * sizeof (int));
+ backmap = alloca (VARRAY_ACTIVE_SIZE (file_table) * sizeof (int));
for (i = 1; i < VARRAY_ACTIVE_SIZE (file_table); i++)
{
backmap[files[i].file_idx] = i;
@@ -9092,7 +9087,7 @@ add_const_value_attribute (dw_die_ref di
if (GET_MODE_CLASS (mode) == MODE_FLOAT)
{
unsigned length = GET_MODE_SIZE (mode) / 4;
- long *array = (long *) ggc_alloc (sizeof (long) * length);
+ long *array = ggc_alloc (sizeof (long) * length);
REAL_VALUE_TYPE rv;
REAL_VALUE_FROM_CONST_DOUBLE (rv, rtl);
@@ -12213,12 +12208,11 @@ dwarf2out_source_line (unsigned int line
{
separate_line_info_table_allocated += LINE_INFO_TABLE_INCREMENT;
separate_line_info_table
- = (dw_separate_line_info_ref)
- ggc_realloc (separate_line_info_table,
+ = ggc_realloc (separate_line_info_table,
separate_line_info_table_allocated
* sizeof (dw_separate_line_info_entry));
- memset ((separate_line_info_table
- + separate_line_info_table_in_use),
+ memset (separate_line_info_table
+ + separate_line_info_table_in_use,
0,
(LINE_INFO_TABLE_INCREMENT
* sizeof (dw_separate_line_info_entry)));
diff -rup orig/egcc-CVS20030716/gcc/dwarfout.c egcc-CVS20030716/gcc/dwarfout.c
--- orig/egcc-CVS20030716/gcc/dwarfout.c 2003-07-05 16:01:35.000000000 -0400
+++ egcc-CVS20030716/gcc/dwarfout.c 2003-07-17 01:37:42.218791000 -0400
@@ -3517,8 +3517,8 @@ dienum_push (void)
{
pending_siblings_allocated += PENDING_SIBLINGS_INCREMENT;
pending_sibling_stack
- = (unsigned *) xrealloc (pending_sibling_stack,
- pending_siblings_allocated * sizeof(unsigned));
+ = xrealloc (pending_sibling_stack,
+ pending_siblings_allocated * sizeof(unsigned));
}
pending_siblings++;
@@ -4406,8 +4406,8 @@ pend_type (tree type)
{
pending_types_allocated += PENDING_TYPES_INCREMENT;
pending_types_list
- = (tree *) xrealloc (pending_types_list,
- sizeof (tree) * pending_types_allocated);
+ = xrealloc (pending_types_list,
+ sizeof (tree) * pending_types_allocated);
}
pending_types_list[pending_types++] = type;
@@ -4533,8 +4533,8 @@ add_incomplete_type (tree type)
{
incomplete_types_allocated += INCOMPLETE_TYPES_INCREMENT;
incomplete_types_list
- = (tree *) xrealloc (incomplete_types_list,
- sizeof (tree) * incomplete_types_allocated);
+ = xrealloc (incomplete_types_list,
+ sizeof (tree) * incomplete_types_allocated);
}
incomplete_types_list[incomplete_types++] = type;
@@ -5851,8 +5851,7 @@ lookup_filename (const char *file_name)
{
ft_entries_allocated += FT_ENTRIES_INCREMENT;
filename_table
- = (filename_entry *)
- xrealloc (filename_table,
+ = xrealloc (filename_table,
ft_entries_allocated * sizeof (filename_entry));
}
@@ -6035,23 +6034,19 @@ dwarfout_init (const char *main_input_fi
/* Allocate the initial hunk of the pending_sibling_stack. */
pending_sibling_stack
- = (unsigned *)
- xmalloc (PENDING_SIBLINGS_INCREMENT * sizeof (unsigned));
+ = xmalloc (PENDING_SIBLINGS_INCREMENT * sizeof (unsigned));
pending_siblings_allocated = PENDING_SIBLINGS_INCREMENT;
pending_siblings = 1;
/* Allocate the initial hunk of the filename_table. */
- filename_table
- = (filename_entry *)
- xmalloc (FT_ENTRIES_INCREMENT * sizeof (filename_entry));
+ filename_table = xmalloc (FT_ENTRIES_INCREMENT * sizeof (filename_entry));
ft_entries_allocated = FT_ENTRIES_INCREMENT;
ft_entries = 0;
/* Allocate the initial hunk of the pending_types_list. */
- pending_types_list
- = (tree *) xmalloc (PENDING_TYPES_INCREMENT * sizeof (tree));
+ pending_types_list = xmalloc (PENDING_TYPES_INCREMENT * sizeof (tree));
pending_types_allocated = PENDING_TYPES_INCREMENT;
pending_types = 0;
diff -rup orig/egcc-CVS20030716/gcc/emit-rtl.c egcc-CVS20030716/gcc/emit-rtl.c
--- orig/egcc-CVS20030716/gcc/emit-rtl.c 2003-07-10 14:05:56.000000000 -0400
+++ egcc-CVS20030716/gcc/emit-rtl.c 2003-07-17 10:56:52.311862000 -0400
@@ -772,7 +772,7 @@ gen_rtvec (int n, ...)
if (n == 0)
return NULL_RTVEC; /* Don't allocate an empty rtvec... */
- vector = (rtx *) alloca (n * sizeof (rtx));
+ vector = alloca (n * sizeof (rtx));
for (i = 0; i < n; i++)
vector[i] = va_arg (p, rtx);
@@ -845,8 +845,8 @@ gen_reg_rtx (enum machine_mode mode)
memset (new + old_size, 0, old_size);
f->emit->regno_pointer_align = (unsigned char *) new;
- new1 = (rtx *) ggc_realloc (f->emit->x_regno_reg_rtx,
- old_size * 2 * sizeof (rtx));
+ new1 = ggc_realloc (f->emit->x_regno_reg_rtx,
+ old_size * 2 * sizeof (rtx));
memset (new1 + old_size, 0, old_size * sizeof (rtx));
regno_reg_rtx = new1;
@@ -4874,7 +4874,7 @@ start_sequence (void)
free_sequence_stack = tem->next;
}
else
- tem = (struct sequence_stack *) ggc_alloc (sizeof (struct sequence_stack));
+ tem = ggc_alloc (sizeof (struct sequence_stack));
tem->next = seq_stack;
tem->first = first_insn;
@@ -5205,7 +5205,7 @@ init_emit (void)
{
struct function *f = cfun;
- f->emit = (struct emit_status *) ggc_alloc (sizeof (struct emit_status));
+ f->emit = ggc_alloc (sizeof (struct emit_status));
first_insn = NULL;
last_insn = NULL;
seq_rtl_expr = NULL;
@@ -5222,11 +5222,11 @@ init_emit (void)
f->emit->regno_pointer_align_length = LAST_VIRTUAL_REGISTER + 101;
f->emit->regno_pointer_align
- = (unsigned char *) ggc_alloc_cleared (f->emit->regno_pointer_align_length
- * sizeof (unsigned char));
+ = ggc_alloc_cleared (f->emit->regno_pointer_align_length
+ * sizeof (unsigned char));
regno_reg_rtx
- = (rtx *) ggc_alloc (f->emit->regno_pointer_align_length * sizeof (rtx));
+ = ggc_alloc (f->emit->regno_pointer_align_length * sizeof (rtx));
/* Put copies of all the hard registers into regno_reg_rtx. */
memcpy (regno_reg_rtx,
diff -rup orig/egcc-CVS20030716/gcc/except.c egcc-CVS20030716/gcc/except.c
--- orig/egcc-CVS20030716/gcc/except.c 2003-06-29 20:01:10.000000000 -0400
+++ egcc-CVS20030716/gcc/except.c 2003-07-17 14:32:00.155748000 -0400
@@ -458,8 +458,7 @@ init_eh (void)
void
init_eh_for_function (void)
{
- cfun->eh = (struct eh_status *)
- ggc_alloc_cleared (sizeof (struct eh_status));
+ cfun->eh = ggc_alloc_cleared (sizeof (struct eh_status));
}
/* Start an exception handling region. All instructions emitted
@@ -477,7 +476,7 @@ expand_eh_region_start (void)
return;
/* Insert a new blank region as a leaf in the tree. */
- new_region = (struct eh_region *) ggc_alloc_cleared (sizeof (*new_region));
+ new_region = ggc_alloc_cleared (sizeof (*new_region));
cur_region = cfun->eh->cur_region;
new_region->outer = cur_region;
if (cur_region)
@@ -1158,7 +1157,7 @@ add_ehl_entry (rtx label, struct eh_regi
LABEL_PRESERVE_P (label) = 1;
- entry = (struct ehl_map_entry *) ggc_alloc (sizeof (*entry));
+ entry = ggc_alloc (sizeof (*entry));
entry->label = label;
entry->region = region;
@@ -1237,8 +1236,7 @@ current_function_has_exception_handlers
static struct eh_region *
duplicate_eh_region_1 (struct eh_region *o, struct inline_remap *map)
{
- struct eh_region *n
- = (struct eh_region *) ggc_alloc_cleared (sizeof (struct eh_region));
+ struct eh_region *n = ggc_alloc_cleared (sizeof (struct eh_region));
n->region_number = o->region_number + cfun->eh->last_region_number;
n->type = o->type;
@@ -1493,7 +1491,7 @@ add_ttypes_entry (htab_t ttypes_hash, tr
{
/* Filter value is a 1 based table index. */
- n = (struct ttypes_filter *) xmalloc (sizeof (*n));
+ n = xmalloc (sizeof (*n));
n->t = type;
n->filter = VARRAY_ACTIVE_SIZE (cfun->eh->ttype_data) + 1;
*slot = n;
@@ -1521,7 +1519,7 @@ add_ehspec_entry (htab_t ehspec_hash, ht
{
/* Filter value is a -1 based byte index into a uleb128 buffer. */
- n = (struct ttypes_filter *) xmalloc (sizeof (*n));
+ n = xmalloc (sizeof (*n));
n->t = list;
n->filter = -(VARRAY_ACTIVE_SIZE (cfun->eh->ehspec_data) + 1);
*slot = n;
@@ -2187,8 +2185,8 @@ sjlj_build_landing_pads (void)
{
struct sjlj_lp_info *lp_info;
- lp_info = (struct sjlj_lp_info *) xcalloc (cfun->eh->last_region_number + 1,
- sizeof (struct sjlj_lp_info));
+ lp_info = xcalloc (cfun->eh->last_region_number + 1,
+ sizeof (struct sjlj_lp_info));
if (sjlj_find_directly_reachable_regions (lp_info))
{
@@ -3108,7 +3106,7 @@ add_action_record (htab_t ar_hash, int f
if ((new = *slot) == NULL)
{
- new = (struct action_record *) xmalloc (sizeof (*new));
+ new = xmalloc (sizeof (*new));
new->offset = VARRAY_ACTIVE_SIZE (cfun->eh->action_record_data) + 1;
new->filter = filter;
new->next = next;
@@ -3239,8 +3237,7 @@ add_call_site (rtx landing_pad, int acti
if (used >= size)
{
size = (size ? size * 2 : 64);
- data = (struct call_site_record *)
- ggc_realloc (data, sizeof (*data) * size);
+ data = ggc_realloc (data, sizeof (*data) * size);
cfun->eh->call_site_data = data;
cfun->eh->call_site_data_size = size;
}
diff -rup orig/egcc-CVS20030716/gcc/expmed.c egcc-CVS20030716/gcc/expmed.c
--- orig/egcc-CVS20030716/gcc/expmed.c 2003-06-29 20:01:11.000000000 -0400
+++ egcc-CVS20030716/gcc/expmed.c 2003-07-17 01:15:59.686640000 -0400
@@ -2096,8 +2096,8 @@ synth_mult (struct algorithm *alg_out, u
/* We'll be needing a couple extra algorithm structures now. */
- alg_in = (struct algorithm *)alloca (sizeof (struct algorithm));
- best_alg = (struct algorithm *)alloca (sizeof (struct algorithm));
+ alg_in = alloca (sizeof (struct algorithm));
+ best_alg = alloca (sizeof (struct algorithm));
/* If we have a group of zero bits at the low-order part of T, try
multiplying by the remaining bits and then doing a shift. */
diff -rup orig/egcc-CVS20030716/gcc/expr.c egcc-CVS20030716/gcc/expr.c
--- orig/egcc-CVS20030716/gcc/expr.c 2003-07-16 20:01:27.000000000 -0400
+++ egcc-CVS20030716/gcc/expr.c 2003-07-17 10:59:27.957615000 -0400
@@ -339,7 +339,7 @@ init_expr_once (void)
void
init_expr (void)
{
- cfun->expr = (struct expr_status *) ggc_alloc (sizeof (struct expr_status));
+ cfun->expr = ggc_alloc (sizeof (struct expr_status));
pending_chain = 0;
pending_stack_adjust = 0;
@@ -2224,7 +2224,7 @@ gen_group_rtx (rtx orig)
abort ();
length = XVECLEN (orig, 0);
- tmps = (rtx *) alloca (sizeof (rtx) * length);
+ tmps = alloca (sizeof (rtx) * length);
/* Skip a NULL entry in first slot. */
i = XEXP (XVECEXP (orig, 0, 0), 0) ? 0 : 1;
@@ -2264,7 +2264,7 @@ emit_group_load (rtx dst, rtx orig_src,
else
start = 1;
- tmps = (rtx *) alloca (sizeof (rtx) * XVECLEN (dst, 0));
+ tmps = alloca (sizeof (rtx) * XVECLEN (dst, 0));
/* Process the pieces. */
for (i = start; i < XVECLEN (dst, 0); i++)
@@ -2421,7 +2421,7 @@ emit_group_store (rtx orig_dst, rtx src,
else
start = 1;
- tmps = (rtx *) alloca (sizeof (rtx) * XVECLEN (src, 0));
+ tmps = alloca (sizeof (rtx) * XVECLEN (src, 0));
/* Copy the (probable) hard regs into pseudos. */
for (i = start; i < XVECLEN (src, 0); i++)
@@ -5388,7 +5388,7 @@ store_constructor (tree exp, rtx target,
{
unsigned int set_word_size = TYPE_ALIGN (TREE_TYPE (exp));
enum machine_mode mode = mode_for_size (set_word_size, MODE_INT, 1);
- char *bit_buffer = (char *) alloca (nbits);
+ char *bit_buffer = alloca (nbits);
HOST_WIDE_INT word = 0;
unsigned int bit_pos = 0;
unsigned int ibit = 0;
diff -rup orig/egcc-CVS20030716/gcc/final.c egcc-CVS20030716/gcc/final.c
--- orig/egcc-CVS20030716/gcc/final.c 2003-07-14 20:06:38.000000000 -0400
+++ egcc-CVS20030716/gcc/final.c 2003-07-17 01:38:51.874265000 -0400
@@ -658,8 +658,8 @@ compute_alignments (void)
max_labelno = max_label_num ();
min_labelno = get_first_label_num ();
- label_align = (struct label_alignment *)
- xcalloc (max_labelno - min_labelno + 1, sizeof (struct label_alignment));
+ label_align = xcalloc (max_labelno - min_labelno + 1,
+ sizeof (struct label_alignment));
/* If not optimizing or optimizing for size, don't assign any alignments. */
if (! optimize || optimize_size)
@@ -766,7 +766,7 @@ shorten_branches (rtx first ATTRIBUTE_UN
/* Compute maximum UID and allocate label_align / uid_shuid. */
max_uid = get_max_uid ();
- uid_shuid = (int *) xmalloc (max_uid * sizeof *uid_shuid);
+ uid_shuid = xmalloc (max_uid * sizeof *uid_shuid);
if (max_labelno != max_label_num ())
{
@@ -779,8 +779,8 @@ shorten_branches (rtx first ATTRIBUTE_UN
n_labels = max_labelno - min_labelno + 1;
n_old_labels = old - min_labelno + 1;
- label_align = (struct label_alignment *) xrealloc
- (label_align, n_labels * sizeof (struct label_alignment));
+ label_align = xrealloc (label_align,
+ n_labels * sizeof (struct label_alignment));
/* Range of labels grows monotonically in the function. Abort here
means that the initialization of array got lost. */
@@ -875,20 +875,20 @@ shorten_branches (rtx first ATTRIBUTE_UN
#ifdef HAVE_ATTR_length
/* Allocate the rest of the arrays. */
- insn_lengths = (int *) xmalloc (max_uid * sizeof (*insn_lengths));
+ insn_lengths = xmalloc (max_uid * sizeof (*insn_lengths));
insn_lengths_max_uid = max_uid;
/* Syntax errors can lead to labels being outside of the main insn stream.
Initialize insn_addresses, so that we get reproducible results. */
INSN_ADDRESSES_ALLOC (max_uid);
- varying_length = (char *) xcalloc (max_uid, sizeof (char));
+ varying_length = xcalloc (max_uid, sizeof (char));
/* Initialize uid_align. We scan instructions
from end to start, and keep in align_tab[n] the last seen insn
that does an alignment of at least n+1, i.e. the successor
in the alignment chain for an insn that does / has a known
alignment of n. */
- uid_align = (rtx *) xcalloc (max_uid, sizeof *uid_align);
+ uid_align = xcalloc (max_uid, sizeof *uid_align);
for (i = MAX_CODE_ALIGN; --i >= 0;)
align_tab[i] = NULL_RTX;
@@ -1566,7 +1566,7 @@ final (rtx first, FILE *file, int optimi
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))
{
@@ -2055,7 +2055,7 @@ final_scan_insn (rtx insn, FILE *file, i
if (asm_noperands (body) >= 0)
{
unsigned int noperands = asm_noperands (body);
- rtx *ops = (rtx *) alloca (noperands * sizeof (rtx));
+ rtx *ops = alloca (noperands * sizeof (rtx));
const char *string;
/* There's no telling what that did to the condition codes. */
@@ -3865,8 +3865,8 @@ debug_queue_symbol (tree decl)
if (symbol_queue_index >= symbol_queue_size)
{
symbol_queue_size += 10;
- symbol_queue = (tree *) xrealloc (symbol_queue,
- symbol_queue_size * sizeof (tree));
+ symbol_queue = xrealloc (symbol_queue,
+ symbol_queue_size * sizeof (tree));
}
symbol_queue[symbol_queue_index++] = decl;
diff -rup orig/egcc-CVS20030716/gcc/fix-header.c egcc-CVS20030716/gcc/fix-header.c
--- orig/egcc-CVS20030716/gcc/fix-header.c 2003-07-12 22:25:55.000000000 -0400
+++ egcc-CVS20030716/gcc/fix-header.c 2003-07-17 11:29:27.134908000 -0400
@@ -544,8 +544,7 @@ recognized_function (const cpp_token *fn
/* We only have a partial function declaration,
so remember that we have to add a complete prototype. */
partial_count++;
- partial = (struct partial_proto *)
- obstack_alloc (&scan_file_obstack, sizeof (struct partial_proto));
+ partial = obstack_alloc (&scan_file_obstack, sizeof (struct partial_proto));
partial->line_seen = line;
partial->fn = fn;
fn->partial = partial;
@@ -1169,7 +1168,7 @@ main (int argc, char **argv)
exit (FATAL_EXIT_CODE);
}
inf_size = sbuf.st_size;
- inf_buffer = (char *) xmalloc (inf_size + 2);
+ inf_buffer = xmalloc (inf_size + 2);
inf_ptr = inf_buffer;
to_read = inf_size;
diff -rup orig/egcc-CVS20030716/gcc/flow.c egcc-CVS20030716/gcc/flow.c
--- orig/egcc-CVS20030716/gcc/flow.c 2003-07-03 14:40:48.000000000 -0400
+++ egcc-CVS20030716/gcc/flow.c 2003-07-17 01:19:46.369026000 -0400
@@ -1082,7 +1082,7 @@ calculate_global_regs_live (sbitmap bloc
/* Create a worklist. Allocate an extra slot for ENTRY_BLOCK, and one
because the `head == tail' style test for an empty queue doesn't
work with a full queue. */
- queue = (basic_block *) xmalloc ((n_basic_blocks + 2) * sizeof (*queue));
+ queue = xmalloc ((n_basic_blocks + 2) * sizeof (*queue));
qtail = queue;
qhead = qend = queue + n_basic_blocks + 2;
@@ -1850,7 +1850,7 @@ init_propagate_block_info (basic_block b
pbi->flags = flags;
if (flags & (PROP_LOG_LINKS | PROP_AUTOINC))
- pbi->reg_next_use = (rtx *) xcalloc (max_reg_num (), sizeof (rtx));
+ pbi->reg_next_use = xcalloc (max_reg_num (), sizeof (rtx));
else
pbi->reg_next_use = NULL;
@@ -1932,7 +1932,7 @@ init_propagate_block_info (basic_block b
struct reg_cond_life_info *rcli;
rtx cond;
- rcli = (struct reg_cond_life_info *) xmalloc (sizeof (*rcli));
+ rcli = xmalloc (sizeof (*rcli));
if (REGNO_REG_SET_P (bb_true->global_live_at_start, i))
cond = cond_false;
@@ -2867,7 +2867,7 @@ mark_regno_cond_dead (struct propagate_b
/* The register was unconditionally live previously.
Record the current condition as the condition under
which it is dead. */
- rcli = (struct reg_cond_life_info *) xmalloc (sizeof (*rcli));
+ rcli = xmalloc (sizeof (*rcli));
rcli->condition = cond;
rcli->stores = cond;
rcli->orig_condition = const0_rtx;
@@ -3644,7 +3644,7 @@ mark_used_reg (struct propagate_block_in
{
/* The register was not previously live at all. Record
the condition under which it is still dead. */
- rcli = (struct reg_cond_life_info *) xmalloc (sizeof (*rcli));
+ rcli = xmalloc (sizeof (*rcli));
rcli->condition = not_reg_cond (cond);
rcli->stores = const0_rtx;
rcli->orig_condition = const0_rtx;
diff -rup orig/egcc-CVS20030716/gcc/fold-const.c egcc-CVS20030716/gcc/fold-const.c
--- orig/egcc-CVS20030716/gcc/fold-const.c 2003-07-10 14:05:56.000000000 -0400
+++ egcc-CVS20030716/gcc/fold-const.c 2003-07-17 10:00:26.624417000 -0400
@@ -313,7 +313,7 @@ mul_double (unsigned HOST_WIDE_INT l1, H
encode (arg1, l1, h1);
encode (arg2, l2, h2);
- memset ((char *) prod, 0, sizeof prod);
+ memset (prod, 0, sizeof prod);
for (i = 0; i < 4; i++)
{
@@ -591,10 +591,10 @@ div_and_round_double (enum tree_code cod
goto finish_up;
}
- memset ((char *) quo, 0, sizeof quo);
+ memset (quo, 0, sizeof quo);
- memset ((char *) num, 0, sizeof num); /* to zero 9th element */
- memset ((char *) den, 0, sizeof den);
+ memset (num, 0, sizeof num); /* to zero 9th element */
+ memset (den, 0, sizeof den);
encode (num, lnum, hnum);
encode (den, lden, hden);
diff -rup orig/egcc-CVS20030716/gcc/function.c egcc-CVS20030716/gcc/function.c
--- orig/egcc-CVS20030716/gcc/function.c 2003-07-15 20:01:43.000000000 -0400
+++ egcc-CVS20030716/gcc/function.c 2003-07-17 11:00:32.111657000 -0400
@@ -692,7 +692,7 @@ assign_stack_temp_for_type (enum machine
if (best_p->size - rounded_size >= alignment)
{
- p = (struct temp_slot *) ggc_alloc (sizeof (struct temp_slot));
+ p = ggc_alloc (sizeof (struct temp_slot));
p->in_use = p->addr_taken = 0;
p->size = best_p->size - rounded_size;
p->base_offset = best_p->base_offset + rounded_size;
@@ -723,7 +723,7 @@ assign_stack_temp_for_type (enum machine
{
HOST_WIDE_INT frame_offset_old = frame_offset;
- p = (struct temp_slot *) ggc_alloc (sizeof (struct temp_slot));
+ p = ggc_alloc (sizeof (struct temp_slot));
/* We are passing an explicit alignment request to assign_stack_local.
One side effect of that is assign_stack_local will not round SIZE
@@ -1477,8 +1477,7 @@ schedule_fixup_var_refs (struct function
{
struct var_refs_queue *temp;
- temp
- = (struct var_refs_queue *) ggc_alloc (sizeof (struct var_refs_queue));
+ temp = ggc_alloc (sizeof (struct var_refs_queue));
temp->modified = reg;
temp->promoted_mode = promoted_mode;
temp->unsignedp = unsigned_p;
@@ -1553,7 +1552,7 @@ find_fixup_replacement (struct fixup_rep
if (p == 0)
{
- p = (struct fixup_replacement *) xmalloc (sizeof (struct fixup_replacement));
+ p = xmalloc (sizeof (struct fixup_replacement));
p->old = x;
p->new = 0;
p->next = *replacements;
@@ -1627,7 +1626,7 @@ fixup_var_refs_insns_with_hash (htab_t h
rtx insn_list;
tmp.key = var;
- ime = (struct insns_for_mem_entry *) htab_find (ht, &tmp);
+ ime = htab_find (ht, &tmp);
for (insn_list = ime->insns; insn_list != 0; insn_list = XEXP (insn_list, 1))
if (INSN_P (XEXP (insn_list, 0)))
fixup_var_refs_insn (XEXP (insn_list, 0), var, promoted_mode,
@@ -3295,7 +3294,7 @@ insns_for_mem_walk (rtx *r, void *data)
{
struct insns_for_mem_entry *ifme;
tmp.key = *r;
- ifme = (struct insns_for_mem_entry *) htab_find (ifmwi->ht, &tmp);
+ ifme = htab_find (ifmwi->ht, &tmp);
/* If we have not already recorded this INSN, do so now. Since
we process the INSNs in order, we know that if we have
@@ -4281,7 +4280,7 @@ assign_parms (tree fndecl)
orig_fnargs = fnargs;
max_parm_reg = LAST_VIRTUAL_REGISTER + 1;
- parm_reg_stack_loc = (rtx *) ggc_alloc_cleared (max_parm_reg * sizeof (rtx));
+ parm_reg_stack_loc = ggc_alloc_cleared (max_parm_reg * sizeof (rtx));
if (SPLIT_COMPLEX_ARGS)
fnargs = split_complex_args (fnargs);
@@ -4944,10 +4943,10 @@ assign_parms (tree fndecl)
but it's also rare and we need max_parm_reg to be
precisely correct. */
max_parm_reg = regno + 1;
- new = (rtx *) ggc_realloc (parm_reg_stack_loc,
- max_parm_reg * sizeof (rtx));
- memset ((char *) (new + old_max_parm_reg), 0,
- (max_parm_reg - old_max_parm_reg) * sizeof (rtx));
+ new = ggc_realloc (parm_reg_stack_loc,
+ max_parm_reg * sizeof (rtx));
+ memset (new + old_max_parm_reg, 0,
+ (max_parm_reg - old_max_parm_reg) * sizeof (rtx));
parm_reg_stack_loc = new;
}
@@ -5885,7 +5884,7 @@ identify_blocks (void)
/* Fill the BLOCK_VECTOR with all of the BLOCKs in this function, in
depth-first order. */
block_vector = get_block_vector (block, &n_blocks);
- block_stack = (tree *) xmalloc (n_blocks * sizeof (tree));
+ block_stack = xmalloc (n_blocks * sizeof (tree));
last_block_vector = identify_blocks_1 (get_insns (),
block_vector + 1,
@@ -6189,7 +6188,7 @@ get_block_vector (tree block, int *n_blo
tree *block_vector;
*n_blocks_p = all_blocks (block, NULL);
- block_vector = (tree *) xmalloc (*n_blocks_p * sizeof (tree));
+ block_vector = xmalloc (*n_blocks_p * sizeof (tree));
all_blocks (block, block_vector);
return block_vector;
@@ -6252,7 +6251,7 @@ debug_find_var_in_block_tree (tree var,
static void
prepare_function_start (void)
{
- cfun = (struct function *) ggc_alloc_cleared (sizeof (struct function));
+ cfun = ggc_alloc_cleared (sizeof (struct function));
init_stmt_for_function ();
init_eh_for_function ();