This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Remove unnecessary casts
- From: Jens-Michael Hoffmann <jensmh at gmx dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 14 Nov 2002 01:27:47 +0100
- Subject: [patch] Remove unnecessary casts
- Organization: Hoffmann Information Services GmbH
hi,
attached is a patch to mainly remove unnecessary casts in a number of files.
There are more patches on this subject to come.
Bootstrapped and tested on i686-pc-linux-gnu.
Since this is my first contribution to GCC please correct me if I ommitted or
overlooked something.
Jens-Michael
2002-11-13 Jens-Michael Hoffmann <jensmh@gmx.de>
* alias.c: Remove unnecessary casts.
* bitmap.c: Likewise.
* builtins.c: Likewise.
* c-common.c: Likewise.
* c-lex.c: Likewise.
* c-typeck.c: Likewise.
* calls.c: Likewise.
* cfg.c: Likewise.
* cfganal.c: Likewise.
* cfgloop.c: Likewise.
* cfgrtl.c: Likewise.
* collect2.c: Likewise.
* combine.c: Likewise.
* conflict.c: Likewise.
* cppexp.c: Likewise.
* cppfiles.c: Likewise.
* cpphash.c: Likewise.
* cppinit.c: Likewise.
* cpplib.c: Likewise.
* cppmacro.c: Likewise.
* cppspec.c: Likewise.
* cpptrad.c: Likewise.
* cse.c: Likewise.
* dbxout.c: Likewise.
* df.c: Likewise.
* dwarf2out.c: Likewise.
* dwarfout.c: Likewise.
* emit-rtl.c: Likewise.
* dominance.c: Likewise.
Put parameter num of macro init_ar in parenthesis.
Index: gcc/alias.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/alias.c,v
retrieving revision 1.180
diff -c -3 -p -r1.180 alias.c
*** gcc/alias.c 14 Oct 2002 21:19:04 -0000 1.180
--- gcc/alias.c 13 Nov 2002 19:53:07 -0000
*************** record_alias_subset (superset, subset)
*** 640,647 ****
{
/* 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->alias_set = superset;
superset_entry->children
= splay_tree_new (splay_tree_compare_ints, 0, 0);
--- 640,646 ----
{
/* Create an entry for the SUPERSET, so that we have a place to
attach the SUBSET. */
! 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);
*************** init_alias_analysis ()
*** 2693,2716 ****
= (rtx *) xcalloc ((maxreg - FIRST_PSEUDO_REGISTER), sizeof (rtx))
- FIRST_PSEUDO_REGISTER;
reg_known_equiv_p
! = (char*) xcalloc ((maxreg - FIRST_PSEUDO_REGISTER), sizeof (char))
- FIRST_PSEUDO_REGISTER;
/* Overallocate reg_base_value to allow some growth during loop
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));
! new_reg_base_value = (rtx *) xmalloc (reg_base_value_size * sizeof (rtx));
! reg_seen = (char *) xmalloc (reg_base_value_size);
if (! reload_completed && flag_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));
}
/* The basic idea is that each pass through this loop will use the
--- 2692,2715 ----
= (rtx *) xcalloc ((maxreg - FIRST_PSEUDO_REGISTER), sizeof (rtx))
- FIRST_PSEUDO_REGISTER;
reg_known_equiv_p
! = (char *) xcalloc ((maxreg - FIRST_PSEUDO_REGISTER), sizeof (char))
- FIRST_PSEUDO_REGISTER;
/* Overallocate reg_base_value to allow some growth during loop
optimization. Loop unrolling can create a large number of
registers. */
reg_base_value_size = maxreg * 2;
! reg_base_value = ggc_alloc_cleared (reg_base_value_size
! * sizeof (rtx));
! new_reg_base_value = xmalloc (reg_base_value_size * sizeof (rtx));
! reg_seen = xmalloc (reg_base_value_size);
if (! reload_completed && flag_unroll_loops)
{
/* ??? Why are we realloc'ing if we're just going to zero it? */
! 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
*************** init_alias_analysis ()
*** 2747,2756 ****
copying_arguments = 1;
/* Wipe the potential alias information clean for this pass. */
! memset ((char *) 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);
/* Mark all hard registers which may contain an address.
The stack, frame and argument pointers may contain an address.
--- 2746,2755 ----
copying_arguments = 1;
/* Wipe the potential alias information clean for this pass. */
! memset (new_reg_base_value, 0, reg_base_value_size * sizeof (rtx));
/* Wipe the reg_seen array clean. */
! 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.
Index: gcc/bitmap.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/bitmap.c,v
retrieving revision 1.37
diff -c -3 -p -r1.37 bitmap.c
*** gcc/bitmap.c 8 Oct 2002 07:19:34 -0000 1.37
--- gcc/bitmap.c 13 Nov 2002 19:53:10 -0000
*************** bitmap_element_allocate (head)
*** 145,152 ****
(void (*) PARAMS ((void *))) OBSTACK_CHUNK_FREE);
}
! element = (bitmap_element *) obstack_alloc (&bitmap_obstack,
! sizeof (bitmap_element));
}
}
else
--- 145,151 ----
(void (*) PARAMS ((void *))) OBSTACK_CHUNK_FREE);
}
! element = obstack_alloc (&bitmap_obstack, sizeof (bitmap_element));
}
}
else
Index: gcc/builtins.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/builtins.c,v
retrieving revision 1.163
diff -c -3 -p -r1.163 builtins.c
*** gcc/builtins.c 17 Sep 2002 01:28:47 -0000 1.163
--- gcc/builtins.c 13 Nov 2002 19:53:27 -0000
*************** result_vector (savep, result)
*** 1059,1065 ****
int regno, size, align, nelts;
enum machine_mode mode;
rtx reg, mem;
! rtx *savevec = (rtx *) alloca (FIRST_PSEUDO_REGISTER * sizeof (rtx));
size = nelts = 0;
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
--- 1059,1065 ----
int regno, size, align, nelts;
enum machine_mode mode;
rtx reg, mem;
! rtx *savevec = alloca (FIRST_PSEUDO_REGISTER * sizeof (rtx));
size = nelts = 0;
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
Index: gcc/c-common.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/c-common.c,v
retrieving revision 1.390
diff -c -3 -p -r1.390 c-common.c
*** gcc/c-common.c 31 Oct 2002 06:57:28 -0000 1.390
--- gcc/c-common.c 13 Nov 2002 19:53:53 -0000
*************** c_expand_start_cond (cond, compstmt_coun
*** 891,902 ****
if (if_stack_space == 0)
{
if_stack_space = 10;
! if_stack = (if_elt *) 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_COND (if_stmt) = cond;
--- 891,902 ----
if (if_stack_space == 0)
{
if_stack_space = 10;
! if_stack = xmalloc (10 * sizeof (if_elt));
}
else if (if_stack_space == if_stack_pointer)
{
if_stack_space += 10;
! if_stack = xrealloc (if_stack, if_stack_space * sizeof (if_elt));
}
IF_COND (if_stmt) = cond;
*************** new_tlist (next, t, writer)
*** 1500,1506 ****
tree writer;
{
struct tlist *l;
! l = (struct tlist *) obstack_alloc (&tlist_obstack, sizeof *l);
l->next = next;
l->expr = t;
l->writer = writer;
--- 1500,1506 ----
tree writer;
{
struct tlist *l;
! l = obstack_alloc (&tlist_obstack, sizeof *l);
l->next = next;
l->expr = t;
l->writer = writer;
*************** verify_tree (x, pbefore_sp, pno_sp, writ
*** 1783,1790 ****
if (! t)
{
! t = (struct tlist_cache *) obstack_alloc (&tlist_obstack,
! sizeof *t);
t->next = save_expr_cache;
t->expr = x;
save_expr_cache = t;
--- 1783,1789 ----
if (! t)
{
! t = obstack_alloc (&tlist_obstack, sizeof *t);
t->next = save_expr_cache;
t->expr = x;
save_expr_cache = t;
*************** c_expand_builtin_printf (arglist, target
*** 4563,4569 ****
/* 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);
memcpy (newstr, TREE_STRING_POINTER (stripped_string), newlen - 1);
newstr[newlen - 1] = 0;
--- 4562,4568 ----
/* 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 = alloca (newlen);
memcpy (newstr, TREE_STRING_POINTER (stripped_string), newlen - 1);
newstr[newlen - 1] = 0;
*************** handle_mode_attribute (node, name, args,
*** 5608,5614 ****
if (len > 4 && p[0] == '_' && p[1] == '_'
&& p[len - 1] == '_' && p[len - 2] == '_')
{
! char *newp = (char *) alloca (len - 1);
strcpy (newp, &p[2]);
newp[len - 4] = '\0';
--- 5607,5613 ----
if (len > 4 && p[0] == '_' && p[1] == '_'
&& p[len - 1] == '_' && p[len - 2] == '_')
{
! char *newp = alloca (len - 1);
strcpy (newp, &p[2]);
newp[len - 4] = '\0';
Index: gcc/c-lex.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/c-lex.c,v
retrieving revision 1.190
diff -c -3 -p -r1.190 c-lex.c
*** gcc/c-lex.c 16 Sep 2002 16:36:31 -0000 1.190
--- gcc/c-lex.c 13 Nov 2002 19:53:57 -0000
*************** get_fileinfo (name)
*** 171,177 ****
if (n)
return (struct c_fileinfo *) n->value;
! fi = (struct c_fileinfo *) xmalloc (sizeof (struct c_fileinfo));
fi->time = 0;
fi->interface_only = 0;
fi->interface_unknown = 1;
--- 171,177 ----
if (n)
return (struct c_fileinfo *) n->value;
! fi = xmalloc (sizeof (struct c_fileinfo));
fi->time = 0;
fi->interface_only = 0;
fi->interface_unknown = 1;
Index: gcc/c-typeck.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/c-typeck.c,v
retrieving revision 1.212
diff -c -3 -p -r1.212 c-typeck.c
*** gcc/c-typeck.c 4 Nov 2002 00:22:57 -0000 1.212
--- gcc/c-typeck.c 13 Nov 2002 19:54:26 -0000
*************** warn_for_assignment (msgid, opname, func
*** 4337,4345 ****
{
/* 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);
sprintf (new_opname, argstring,
IDENTIFIER_POINTER (function));
}
--- 4337,4345 ----
{
/* Function name is known; supply it. */
const char *const argstring = _("passing arg of `%s'");
! new_opname = alloca (IDENTIFIER_LENGTH (function)
! + strlen (argstring) + 1
! + 1);
sprintf (new_opname, argstring,
IDENTIFIER_POINTER (function));
}
*************** warn_for_assignment (msgid, opname, func
*** 4347,4353 ****
{
/* Function name unknown (call through ptr). */
const char *const argnofun = _("passing arg of pointer to function");
! new_opname = (char *) alloca (strlen (argnofun) + 1 + 1);
sprintf (new_opname, argnofun);
}
}
--- 4347,4353 ----
{
/* Function name unknown (call through ptr). */
const char *const argnofun = _("passing arg of pointer to function");
! new_opname = alloca (strlen (argnofun) + 1 + 1);
sprintf (new_opname, argnofun);
}
}
*************** warn_for_assignment (msgid, opname, func
*** 4355,4363 ****
{
/* 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);
sprintf (new_opname, argstring, argnum,
IDENTIFIER_POINTER (function));
}
--- 4355,4363 ----
{
/* Function name is known; supply it. */
const char *const argstring = _("passing arg %d of `%s'");
! new_opname = alloca (IDENTIFIER_LENGTH (function)
! + strlen (argstring) + 1 + 25
! /*%d*/ + 1);
sprintf (new_opname, argstring, argnum,
IDENTIFIER_POINTER (function));
}
*************** warn_for_assignment (msgid, opname, func
*** 4365,4371 ****
{
/* 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);
sprintf (new_opname, argnofun, argnum);
}
opname = new_opname;
--- 4365,4371 ----
{
/* Function name unknown (call through ptr); just give arg number. */
const char *const argnofun = _("passing arg %d of pointer to function");
! new_opname = alloca (strlen (argnofun) + 1 + 25 /*%d*/ + 1);
sprintf (new_opname, argnofun, argnum);
}
opname = new_opname;
*************** static int spelling_size; /* Size of th
*** 4530,4540 ****
spelling_size += 10; \
if (spelling_base == 0) \
spelling_base \
! = (struct spelling *) xmalloc (spelling_size * sizeof (struct spelling));
\
else \
spelling_base \
! = (struct spelling *) xrealloc (spelling_base, \
! spelling_size * sizeof (struct spelling)); \
RESTORE_SPELLING_DEPTH (depth); \
} \
\
--- 4530,4540 ----
spelling_size += 10; \
if (spelling_base == 0) \
spelling_base \
! = xmalloc (spelling_size * sizeof (struct spelling)); \
else \
spelling_base \
! = xrealloc (spelling_base, \
! spelling_size * sizeof (struct spelling)); \
RESTORE_SPELLING_DEPTH (depth); \
} \
\
*************** start_init (decl, asmspec_tree, top_leve
*** 5040,5046 ****
{
const char *locus;
struct initializer_stack *p
! = (struct initializer_stack *) xmalloc (sizeof (struct
initializer_stack));
const char *asmspec = 0;
if (asmspec_tree)
--- 5040,5046 ----
{
const char *locus;
struct initializer_stack *p
! = xmalloc (sizeof (struct initializer_stack));
const char *asmspec = 0;
if (asmspec_tree)
*************** void
*** 5150,5157 ****
really_start_incremental_init (type)
tree type;
{
! struct constructor_stack *p
! = (struct constructor_stack *) xmalloc (sizeof (struct
constructor_stack));
if (type == 0)
type = TREE_TYPE (constructor_decl);
--- 5150,5156 ----
really_start_incremental_init (type)
tree type;
{
! struct constructor_stack *p = xmalloc (sizeof (struct constructor_stack));
if (type == 0)
type = TREE_TYPE (constructor_decl);
*************** push_init_level (implicit)
*** 5284,5290 ****
value = find_init_member (constructor_index);
}
! p = (struct constructor_stack *) xmalloc (sizeof (struct
constructor_stack));
p->type = constructor_type;
p->fields = constructor_fields;
p->index = constructor_index;
--- 5283,5289 ----
value = find_init_member (constructor_index);
}
! p = xmalloc (sizeof (struct constructor_stack));
p->type = constructor_type;
p->fields = constructor_fields;
p->index = constructor_index;
*************** c_expand_asm_operands (string, outputs,
*** 6952,6958 ****
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 tail;
/* Record the contents of OUTPUTS before it is modified. */
--- 6951,6957 ----
int noutputs = list_length (outputs);
int i;
/* o[I] is the place that output number I should be written. */
! tree *o = alloca (noutputs * sizeof (tree));
tree tail;
/* Record the contents of OUTPUTS before it is modified. */
*************** c_start_case (exp)
*** 7152,7158 ****
}
/* Add this new SWITCH_STMT to the stack. */
! cs = (struct c_switch *) 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;
--- 7151,7157 ----
}
/* Add this new SWITCH_STMT to the stack. */
! 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;
Index: gcc/calls.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/calls.c,v
retrieving revision 1.242
diff -c -3 -p -r1.242 calls.c
*** gcc/calls.c 11 Nov 2002 03:13:17 -0000 1.242
--- gcc/calls.c 13 Nov 2002 19:54:46 -0000
*************** store_unaligned_arguments_into_pseudos (
*** 1048,1055 ****
= args[i].partial ? args[i].partial
: (bytes + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD;
! args[i].aligned_regs = (rtx *) xmalloc (sizeof (rtx)
! * args[i].n_aligned_regs);
/* Structures smaller than a word are aligned to the least
significant byte (to the right). On a BYTES_BIG_ENDIAN machine,
--- 1048,1055 ----
= args[i].partial ? args[i].partial
: (bytes + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD;
! args[i].aligned_regs = xmalloc (sizeof (rtx)
! * args[i].n_aligned_regs);
/* Structures smaller than a word are aligned to the least
significant byte (to the right). On a BYTES_BIG_ENDIAN machine,
*************** expand_call (exp, target, ignore)
*** 2377,2384 ****
INIT_CUMULATIVE_ARGS (args_so_far, funtype, NULL_RTX, (fndecl == 0));
/* 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));
/* Build up entries in the ARGS array, compute the size of the
arguments into ARGS_SIZE, etc. */
--- 2377,2384 ----
INIT_CUMULATIVE_ARGS (args_so_far, funtype, NULL_RTX, (fndecl == 0));
/* Make a vector to hold all the information about each arg. */
! 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. */
*************** expand_call (exp, target, ignore)
*** 2787,2794 ****
highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use,
needed);
#endif
! stack_usage_map
! = (char *) alloca (highest_outgoing_arg_in_use);
if (initial_highest_arg_in_use)
memcpy (stack_usage_map, initial_stack_usage_map,
--- 2787,2793 ----
highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use,
needed);
#endif
! stack_usage_map = alloca (highest_outgoing_arg_in_use);
if (initial_highest_arg_in_use)
memcpy (stack_usage_map, initial_stack_usage_map,
*************** emit_library_call_value_1 (retval, orgfu
*** 3583,3590 ****
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));
#ifdef INIT_CUMULATIVE_LIBCALL_ARGS
INIT_CUMULATIVE_LIBCALL_ARGS (args_so_far, outmode, fun);
--- 3582,3589 ----
of the full argument passing conventions to limit complexity here since
library functions shouldn't have many args. */
! 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);
*************** emit_library_call_value_1 (retval, orgfu
*** 3823,3829 ****
highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use,
needed);
#endif
! stack_usage_map = (char *) alloca (highest_outgoing_arg_in_use);
if (initial_highest_arg_in_use)
memcpy (stack_usage_map, initial_stack_usage_map,
--- 3822,3828 ----
highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use,
needed);
#endif
! stack_usage_map = alloca (highest_outgoing_arg_in_use);
if (initial_highest_arg_in_use)
memcpy (stack_usage_map, initial_stack_usage_map,
Index: gcc/cfg.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cfg.c,v
retrieving revision 1.35
diff -c -3 -p -r1.35 cfg.c
*** gcc/cfg.c 10 Aug 2002 18:00:54 -0000 1.35
--- gcc/cfg.c 13 Nov 2002 19:54:49 -0000
*************** init_flow ()
*** 145,157 ****
if (!initialized)
{
gcc_obstack_init (&flow_obstack);
! flow_firstobj = (char *) obstack_alloc (&flow_obstack, 0);
initialized = 1;
}
else
{
obstack_free (&flow_obstack, flow_firstobj);
! flow_firstobj = (char *) obstack_alloc (&flow_obstack, 0);
}
}
--- 145,157 ----
if (!initialized)
{
gcc_obstack_init (&flow_obstack);
! flow_firstobj = obstack_alloc (&flow_obstack, 0);
initialized = 1;
}
else
{
obstack_free (&flow_obstack, flow_firstobj);
! flow_firstobj = obstack_alloc (&flow_obstack, 0);
}
}
*************** alloc_aux_for_blocks (size)
*** 716,722 ****
/* 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);
if (size)
{
basic_block bb;
--- 716,722 ----
/* Check whether AUX data are still allocated. */
else if (first_block_aux_obj)
abort ();
! first_block_aux_obj = obstack_alloc (&block_aux_obstack, 0);
if (size)
{
basic_block bb;
*************** alloc_aux_for_edges (size)
*** 785,791 ****
else if (first_edge_aux_obj)
abort ();
! first_edge_aux_obj = (char *) obstack_alloc (&edge_aux_obstack, 0);
if (size)
{
basic_block bb;
--- 785,791 ----
else if (first_edge_aux_obj)
abort ();
! first_edge_aux_obj = obstack_alloc (&edge_aux_obstack, 0);
if (size)
{
basic_block bb;
Index: gcc/cfganal.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cfganal.c,v
retrieving revision 1.30
diff -c -3 -p -r1.30 cfganal.c
*** gcc/cfganal.c 11 Oct 2002 21:09:59 -0000 1.30
--- gcc/cfganal.c 13 Nov 2002 19:54:53 -0000
*************** mark_dfs_back_edges ()
*** 143,153 ****
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));
/* Allocate stack for back-tracking up CFG. */
! stack = (edge *) xmalloc ((n_basic_blocks + 1) * sizeof (edge));
sp = 0;
/* Allocate bitmap to track nodes that have been visited. */
--- 143,153 ----
bool found = false;
/* Allocate the preorder and postorder number arrays. */
! pre = xcalloc (last_basic_block, sizeof (int));
! post = xcalloc (last_basic_block, sizeof (int));
/* Allocate stack for back-tracking up CFG. */
! stack = xmalloc ((n_basic_blocks + 1) * sizeof (edge));
sp = 0;
/* Allocate bitmap to track nodes that have been visited. */
*************** find_unreachable_blocks ()
*** 403,410 ****
edge e;
basic_block *tos, *worklist, bb;
! tos = worklist =
! (basic_block *) xmalloc (sizeof (basic_block) * n_basic_blocks);
/* Clear all the reachability flags. */
--- 403,409 ----
edge e;
basic_block *tos, *worklist, bb;
! tos = worklist = xmalloc (sizeof (basic_block) * n_basic_blocks);
/* Clear all the reachability flags. */
*************** create_edge_list ()
*** 474,483 ****
num_edges++;
}
! elist = (struct edge_list *) 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);
num_edges = 0;
--- 473,482 ----
num_edges++;
}
! elist = xmalloc (sizeof (struct edge_list));
elist->num_blocks = block_count;
elist->num_edges = num_edges;
! elist->index_to_edge = xmalloc (sizeof (edge) * num_edges);
num_edges = 0;
*************** flow_reverse_top_sort_order_compute (rts
*** 752,758 ****
sbitmap visited;
/* Allocate stack for back-tracking up CFG. */
! stack = (edge *) xmalloc ((n_basic_blocks + 1) * sizeof (edge));
sp = 0;
/* Allocate bitmap to track nodes that have been visited. */
--- 751,757 ----
sbitmap visited;
/* Allocate stack for back-tracking up CFG. */
! stack = xmalloc ((n_basic_blocks + 1) * sizeof (edge));
sp = 0;
/* Allocate bitmap to track nodes that have been visited. */
*************** flow_depth_first_order_compute (dfs_orde
*** 823,829 ****
sbitmap visited;
/* Allocate stack for back-tracking up CFG. */
! stack = (edge *) xmalloc ((n_basic_blocks + 1) * sizeof (edge));
sp = 0;
/* Allocate bitmap to track nodes that have been visited. */
--- 822,828 ----
sbitmap visited;
/* Allocate stack for back-tracking up CFG. */
! stack = xmalloc ((n_basic_blocks + 1) * sizeof (edge));
sp = 0;
/* Allocate bitmap to track nodes that have been visited. */
*************** flow_preorder_transversal_compute (pot_o
*** 929,940 ****
basic_block bb;
/* Allocate stack for back-tracking up CFG. */
! stack = (edge *) xmalloc ((n_basic_blocks + 1) * sizeof (edge));
sp = 0;
/* Allocate the tree. */
! dfst = (struct dfst_node *) xcalloc (last_basic_block,
! sizeof (struct dfst_node));
FOR_EACH_BB (bb)
{
--- 928,938 ----
basic_block bb;
/* Allocate stack for back-tracking up CFG. */
! stack = xmalloc ((n_basic_blocks + 1) * sizeof (edge));
sp = 0;
/* Allocate the tree. */
! dfst = xcalloc (last_basic_block, sizeof (struct dfst_node));
FOR_EACH_BB (bb)
{
*************** flow_preorder_transversal_compute (pot_o
*** 944,951 ****
dfst[bb->index].node
= (max_successors
! ? (struct dfst_node **) xcalloc (max_successors,
! sizeof (struct dfst_node *))
: NULL);
}
--- 942,948 ----
dfst[bb->index].node
= (max_successors
! ? xcalloc (max_successors, sizeof (struct dfst_node *))
: NULL);
}
*************** flow_dfs_compute_reverse_init (data)
*** 1059,1066 ****
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->sp = 0;
/* Allocate bitmap to track nodes that have been visited. */
--- 1056,1063 ----
depth_first_search_ds data;
{
/* Allocate stack for back-tracking up CFG. */
! data->stack = xmalloc ((n_basic_blocks - (INVALID_BLOCK + 1))
! * sizeof (basic_block));
data->sp = 0;
/* Allocate bitmap to track nodes that have been visited. */
Index: gcc/cfgloop.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cfgloop.c,v
retrieving revision 1.17
diff -c -3 -p -r1.17 cfgloop.c
*** gcc/cfgloop.c 22 Sep 2002 02:03:15 -0000 1.17
--- gcc/cfgloop.c 13 Nov 2002 19:54:56 -0000
*************** flow_loop_entry_edges_find (loop)
*** 253,259 ****
if (! num_entries)
abort ();
! loop->entry_edges = (edge *) xmalloc (num_entries * sizeof (edge *));
num_entries = 0;
for (e = loop->header->pred; e; e = e->pred_next)
--- 253,259 ----
if (! num_entries)
abort ();
! loop->entry_edges = xmalloc (num_entries * sizeof (edge *));
num_entries = 0;
for (e = loop->header->pred; e; e = e->pred_next)
*************** flow_loop_exit_edges_find (loop)
*** 301,307 ****
return;
}
! loop->exit_edges = (edge *) xmalloc (num_exits * sizeof (edge *));
/* Store all exiting edges into an array. */
num_exits = 0;
--- 301,307 ----
return;
}
! loop->exit_edges = xmalloc (num_exits * sizeof (edge *));
/* Store all exiting edges into an array. */
num_exits = 0;
*************** flow_loop_nodes_find (header, loop)
*** 339,345 ****
if (loop->latch->loop_father != loop)
{
! stack = (basic_block *) xmalloc (n_basic_blocks * sizeof
(basic_block));
sp = 0;
num_nodes++;
stack[sp++] = loop->latch;
--- 339,345 ----
if (loop->latch->loop_father != loop)
{
! stack = xmalloc (n_basic_blocks * sizeof (basic_block));
sp = 0;
num_nodes++;
stack[sp++] = loop->latch;
*************** flow_loop_pre_header_scan (loop)
*** 398,404 ****
num++)
ebb = ebb->pred->src;
! loop->pre_header_edges = (edge *) xmalloc (num * sizeof (edge));
loop->num_pre_header_edges = num;
/* Store edges in order that they are followed. The source of the first
edge
--- 398,404 ----
num++)
ebb = ebb->pred->src;
! 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
*************** flow_loops_find (loops, flags)
*** 836,842 ****
}
/* Allocate loop structures. */
! loops->parray = (struct loop **) xcalloc (num_loops + 1, sizeof (struct
loop *));
/* Dummy loop containing whole function. */
loops->parray[0] = xcalloc (1, sizeof (struct loop));
--- 836,842 ----
}
/* Allocate loop structures. */
! loops->parray = xcalloc (num_loops + 1, sizeof (struct loop *));
/* Dummy loop containing whole function. */
loops->parray[0] = xcalloc (1, sizeof (struct loop));
*************** flow_loops_find (loops, flags)
*** 863,870 ****
{
/* 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));
flow_depth_first_order_compute (dfs_order, rc_order);
/* Save CFG derived information to avoid recomputing it. */
--- 863,870 ----
{
/* Compute depth first search order of the CFG so that outer
natural loops will be found before inner natural loops. */
! 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. */
Index: gcc/cfgrtl.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cfgrtl.c,v
retrieving revision 1.59
diff -c -3 -p -r1.59 cfgrtl.c
*** gcc/cfgrtl.c 17 Sep 2002 09:03:57 -0000 1.59
--- gcc/cfgrtl.c 13 Nov 2002 19:55:04 -0000
*************** print_rtl_with_bb (outf, rtx_first)
*** 1555,1566 ****
{
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 bb;
--- 1555,1564 ----
{
enum bb_state { NOT_IN_BB, IN_ONE_BB, IN_MULTIPLE_BB };
int max_uid = get_max_uid ();
! 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;
*************** verify_flow_info ()
*** 1675,1684 ****
int num_bb_notes, err = 0;
basic_block bb, last_bb_seen;
! bb_info = (basic_block *) xcalloc (max_uid, sizeof (basic_block));
! last_visited = (basic_block *) xcalloc (last_basic_block + 2,
! sizeof (basic_block));
! edge_checksum = (size_t *) xcalloc (last_basic_block + 2, sizeof
(size_t));
/* Check bb chain & numbers. */
last_bb_seen = ENTRY_BLOCK_PTR;
--- 1673,1682 ----
int num_bb_notes, err = 0;
basic_block bb, last_bb_seen;
! bb_info = xcalloc (max_uid, sizeof (basic_block));
! 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;
Index: gcc/collect2.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/collect2.c,v
retrieving revision 1.142
diff -c -3 -p -r1.142 collect2.c
*** gcc/collect2.c 22 Sep 2002 02:03:15 -0000 1.142
--- gcc/collect2.c 13 Nov 2002 19:55:17 -0000
*************** add_prefix (pprefix, prefix)
*** 729,741 ****
if (len > pprefix->max_len)
pprefix->max_len = len;
! pl = (struct prefix_list *) xmalloc (sizeof (struct prefix_list));
pl->prefix = xstrdup (prefix);
if (*prev)
pl->next = *prev;
else
! pl->next = (struct prefix_list *) 0;
*prev = pl;
}
--- 729,741 ----
if (len > pprefix->max_len)
pprefix->max_len = len;
! pl = xmalloc (sizeof (struct prefix_list));
pl->prefix = xstrdup (prefix);
if (*prev)
pl->next = *prev;
else
! pl->next = 0;
*prev = pl;
}
*************** prefix_from_string (p, pprefix)
*** 760,766 ****
struct path_prefix *pprefix;
{
const char *startp, *endp;
! char *nstore = (char *) xmalloc (strlen (p) + 3);
if (debug)
fprintf (stderr, "Convert string '%s' into prefixes, separator =
'%c'\n", p, PATH_SEPARATOR);
--- 760,766 ----
struct path_prefix *pprefix;
{
const char *startp, *endp;
! char *nstore = xmalloc (strlen (p) + 3);
if (debug)
fprintf (stderr, "Convert string '%s' into prefixes, separator =
'%c'\n", p, PATH_SEPARATOR);
*************** main (argc, argv)
*** 885,893 ****
/* 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));
#ifdef DEBUG
debug = 1;
--- 885,893 ----
/* 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 = 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;
*************** main (argc, argv)
*** 912,918 ****
#endif
obstack_begin (&temporary_obstack, 0);
! temporary_firstobj = (char *) obstack_alloc (&temporary_obstack, 0);
current_demangling_style = auto_demangling;
p = getenv ("COLLECT_GCC_OPTIONS");
--- 912,918 ----
#endif
obstack_begin (&temporary_obstack, 0);
! temporary_firstobj = obstack_alloc (&temporary_obstack, 0);
current_demangling_style = auto_demangling;
p = getenv ("COLLECT_GCC_OPTIONS");
*************** main (argc, argv)
*** 928,934 ****
num_c_args += 2;
c_ptr = (const char **)
! (c_argv = (char **) xcalloc (sizeof (char *), num_c_args));
if (argc < 2)
fatal ("no arguments");
--- 928,934 ----
num_c_args += 2;
c_ptr = (const char **)
! (c_argv = xcalloc (sizeof (char *), num_c_args));
if (argc < 2)
fatal ("no arguments");
*************** main (argc, argv)
*** 1384,1390 ****
/* Strip now if it was requested on the command line. */
if (strip_flag)
{
! char **real_strip_argv = (char **) xcalloc (sizeof (char *), 3);
const char ** strip_argv = (const char **) real_strip_argv;
strip_argv[0] = strip_file_name;
--- 1384,1390 ----
/* Strip now if it was requested on the command line. */
if (strip_flag)
{
! char **real_strip_argv = xcalloc (sizeof (char *), 3);
const char ** strip_argv = (const char **) real_strip_argv;
strip_argv[0] = strip_file_name;
*************** add_to_list (head_ptr, name)
*** 1638,1644 ****
const char *name;
{
struct id *newid
! = (struct id *) xcalloc (sizeof (struct id) + strlen (name), 1);
struct id *p;
strcpy (newid->name, name);
--- 1638,1644 ----
const char *name;
{
struct id *newid
! = xcalloc (sizeof (struct id) + strlen (name), 1);
struct id *p;
strcpy (newid->name, name);
*************** locatelib (name)
*** 2375,2381 ****
cnt++;
q = xstrdup (p);
}
! l = (const char **) xmalloc ((cnt + 3) * sizeof (char *));
pp = l;
if (ldr)
{
--- 2375,2381 ----
cnt++;
q = xstrdup (p);
}
! l = xmalloc ((cnt + 3) * sizeof (char *));
pp = l;
if (ldr)
{
*************** scan_prog_file (prog_name, which_pass)
*** 3059,3065 ****
offset = hdr.moh_first_cmd_off;
load_end = load_array
! = (load_all_t *) xcalloc (sizeof (load_all_t), hdr.moh_n_load_cmds + 2);
/* Build array of load commands, calculating the offsets */
for (i = 0; i < hdr.moh_n_load_cmds; i++)
--- 3059,3065 ----
offset = hdr.moh_first_cmd_off;
load_end = load_array
! = xcalloc (sizeof (load_all_t), hdr.moh_n_load_cmds + 2);
/* Build array of load commands, calculating the offsets */
for (i = 0; i < hdr.moh_n_load_cmds; i++)
*************** scan_prog_file (prog_name, which_pass)
*** 3072,3079 ****
/* If modifying the program file, copy the header. */
if (rw)
{
! load_union_t *ptr = (load_union_t *) xmalloc
(load_hdr->hdr.ldci_cmd_size);
! memcpy ((char *)ptr, (char *)load_hdr, load_hdr->hdr.ldci_cmd_size);
load_hdr = ptr;
/* null out old command map, because we will rewrite at the end. */
--- 3072,3079 ----
/* If modifying the program file, copy the header. */
if (rw)
{
! load_union_t *ptr = xmalloc (load_hdr->hdr.ldci_cmd_size);
! memcpy (ptr, load_hdr, load_hdr->hdr.ldci_cmd_size);
load_hdr = ptr;
/* null out old command map, because we will rewrite at the end. */
*************** scan_prog_file (prog_name, which_pass)
*** 3218,3224 ****
notice ("load command map, %d cmds, new size %ld.\n",
(int) hdr.moh_n_load_cmds, (long) size);
! load_map = (load_union_t *) xcalloc (1, size);
load_map->map.ldc_header.ldci_cmd_type = LDC_CMD_MAP;
load_map->map.ldc_header.ldci_cmd_size = size;
load_map->map.lcm_ld_cmd_strings = cmd_strings;
--- 3218,3224 ----
notice ("load command map, %d cmds, new size %ld.\n",
(int) hdr.moh_n_load_cmds, (long) size);
! load_map = xcalloc (1, size);
load_map->map.ldc_header.ldci_cmd_type = LDC_CMD_MAP;
load_map->map.ldc_header.ldci_cmd_size = size;
load_map->map.lcm_ld_cmd_strings = cmd_strings;
*************** read_file (name, fd, rw)
*** 3492,3498 ****
int rw; /* read/write */
{
struct stat stat_pkt;
! struct file_info *p = (struct file_info *) xcalloc (sizeof (struct
file_info), 1);
#ifdef USE_MMAP
static int page_size;
#endif
--- 3492,3498 ----
int rw; /* read/write */
{
struct stat stat_pkt;
! struct file_info *p = xcalloc (sizeof (struct file_info), 1);
#ifdef USE_MMAP
static int page_size;
#endif
Index: gcc/combine.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/combine.c,v
retrieving revision 1.323
diff -c -3 -p -r1.323 combine.c
*** gcc/combine.c 4 Nov 2002 16:56:59 -0000 1.323
--- gcc/combine.c 13 Nov 2002 19:56:14 -0000
*************** do_SUBST (into, newval)
*** 453,459 ****
if (undobuf.frees)
buf = undobuf.frees, undobuf.frees = buf->next;
else
! buf = (struct undo *) xmalloc (sizeof (struct undo));
buf->is_int = 0;
buf->where.r = into;
--- 453,459 ----
if (undobuf.frees)
buf = undobuf.frees, undobuf.frees = buf->next;
else
! buf = xmalloc (sizeof (struct undo));
buf->is_int = 0;
buf->where.r = into;
*************** do_SUBST_INT (into, newval)
*** 482,488 ****
if (undobuf.frees)
buf = undobuf.frees, undobuf.frees = buf->next;
else
! buf = (struct undo *) xmalloc (sizeof (struct undo));
buf->is_int = 1;
buf->where.i = into;
--- 482,488 ----
if (undobuf.frees)
buf = undobuf.frees, undobuf.frees = buf->next;
else
! buf = xmalloc (sizeof (struct undo));
buf->is_int = 1;
buf->where.i = into;
*************** combine_instructions (f, nregs)
*** 522,542 ****
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));
init_reg_last_arrays ();
--- 522,539 ----
reg_nonzero_bits = ((unsigned HOST_WIDE_INT *)
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
= (unsigned HOST_WIDE_INT *) xmalloc (nregs * sizeof (HOST_WIDE_INT));
! reg_last_set_sign_bit_copies = xmalloc (nregs * sizeof (char));
init_reg_last_arrays ();
*************** combine_instructions (f, nregs)
*** 548,554 ****
if (INSN_UID (insn) > i)
i = INSN_UID (insn);
! uid_cuid = (int *) xmalloc ((i + 1) * sizeof (int));
max_uid_cuid = i;
nonzero_bits_mode = mode_for_size (HOST_BITS_PER_WIDE_INT, MODE_INT, 0);
--- 545,551 ----
if (INSN_UID (insn) > i)
i = INSN_UID (insn);
! 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);
*************** init_reg_last_arrays ()
*** 793,806 ****
{
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_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_sign_bit_copies, 0, nregs * sizeof (char));
}
--- 790,803 ----
{
unsigned int nregs = combine_max_regno;
! 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 (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));
}
Index: gcc/conflict.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/conflict.c,v
retrieving revision 1.17
diff -c -3 -p -r1.17 conflict.c
*** gcc/conflict.c 9 Oct 2002 17:26:27 -0000 1.17
--- gcc/conflict.c 13 Nov 2002 19:56:16 -0000
*************** conflict_graph_new (num_regs)
*** 163,170 ****
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));
memset (graph->neighbor_heads, 0, num_regs * sizeof (conflict_graph_arc));
return graph;
--- 163,169 ----
obstack_init (&graph->arc_obstack);
/* Create and zero the lookup table by register number. */
! graph->neighbor_heads = xmalloc (num_regs * sizeof (conflict_graph_arc));
memset (graph->neighbor_heads, 0, num_regs * sizeof (conflict_graph_arc));
return graph;
Index: gcc/cppexp.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cppexp.c,v
retrieving revision 1.133
diff -c -3 -p -r1.133 cppexp.c
*** gcc/cppexp.c 22 Sep 2002 02:03:16 -0000 1.133
--- gcc/cppexp.c 13 Nov 2002 19:56:22 -0000
*************** _cpp_expand_op_stack (pfile)
*** 1002,1009 ****
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_limit = pfile->op_stack + new_size;
return pfile->op_stack + old_size;
--- 1002,1009 ----
size_t old_size = (size_t) (pfile->op_limit - pfile->op_stack);
size_t new_size = old_size * 2 + 20;
! 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;
Index: gcc/cppfiles.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cppfiles.c,v
retrieving revision 1.156
diff -c -3 -p -r1.156 cppfiles.c
*** gcc/cppfiles.c 22 Sep 2002 02:03:16 -0000 1.156
--- gcc/cppfiles.c 13 Nov 2002 19:56:26 -0000
*************** read_include_file (pfile, inc)
*** 423,429 ****
else
#endif
{
! buf = (uchar *) xmalloc (size + 1);
offset = 0;
while (offset < size)
{
--- 423,429 ----
else
#endif
{
! buf = xmalloc (size + 1);
offset = 0;
while (offset < size)
{
*************** read_include_file (pfile, inc)
*** 458,464 ****
bigger than the majority of C source files. */
size = 8 * 1024;
! buf = (uchar *) xmalloc (size + 1);
offset = 0;
while ((count = read (inc->fd, buf + offset, size - offset)) > 0)
{
--- 458,464 ----
bigger than the majority of C source files. */
size = 8 * 1024;
! buf = xmalloc (size + 1);
offset = 0;
while ((count = read (inc->fd, buf + offset, size - offset)) > 0)
{
*************** cpp_included (pfile, fname)
*** 525,531 ****
}
/* Search directory path for the file. */
! name = (char *) alloca (strlen (fname) + pfile->max_include_len + 2);
for (path = CPP_OPTION (pfile, quote_include); path; path = path->next)
{
memcpy (name, path->name, path->len);
--- 525,531 ----
}
/* Search directory path for the file. */
! name = alloca (strlen (fname) + pfile->max_include_len + 2);
for (path = CPP_OPTION (pfile, quote_include); path; path = path->next)
{
memcpy (name, path->name, path->len);
*************** find_include_file (pfile, header, type)
*** 580,586 ****
}
/* Search directory path for the file. */
! name = (char *) alloca (strlen (fname) + pfile->max_include_len + 2);
for (; path; path = path->next)
{
int len = path->len;
--- 580,586 ----
}
/* Search directory path for the file. */
! name = alloca (strlen (fname) + pfile->max_include_len + 2);
for (; path; path = path->next)
{
int len = path->len;
*************** read_name_map (pfile, dirname)
*** 901,907 ****
/* 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);
strcpy (name, dirname);
if (*dirname)
strcat (name, "/");
--- 901,907 ----
/* The end of the list ends in NULL. */
map_list_ptr->map_list_map = NULL;
! name = alloca (strlen (dirname) + strlen (FILE_NAME_MAP_FILE) + 2);
strcpy (name, dirname);
if (*dirname)
strcat (name, "/");
*************** remap_filename (pfile, name, loc)
*** 998,1004 ****
if (p == name)
cpp_error (pfile, DL_ICE, "absolute file name in remap_filename");
! dir = (char *) alloca (p - name + 1);
memcpy (dir, name, p - name);
dir[p - name] = '\0';
from = p + 1;
--- 998,1004 ----
if (p == name)
cpp_error (pfile, DL_ICE, "absolute file name in remap_filename");
! dir = alloca (p - name + 1);
memcpy (dir, name, p - name);
dir[p - name] = '\0';
from = p + 1;
Index: gcc/cpphash.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cpphash.c,v
retrieving revision 1.120
diff -c -3 -p -r1.120 cpphash.c
*** gcc/cpphash.c 22 May 2002 22:02:10 -0000 1.120
--- gcc/cpphash.c 13 Nov 2002 19:56:26 -0000
*************** alloc_node (table)
*** 38,44 ****
{
cpp_hashnode *node;
! node = (cpp_hashnode *) obstack_alloc (&table->pfile->hash_ob,
sizeof (cpp_hashnode));
memset ((PTR) node, 0, sizeof (cpp_hashnode));
return node;
--- 38,44 ----
{
cpp_hashnode *node;
! node = obstack_alloc (&table->pfile->hash_ob,
sizeof (cpp_hashnode));
memset ((PTR) node, 0, sizeof (cpp_hashnode));
return node;
Index: gcc/cppinit.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cppinit.c,v
retrieving revision 1.264
diff -c -3 -p -r1.264 cppinit.c
*** gcc/cppinit.c 6 Oct 2002 11:21:09 -0000 1.264
--- gcc/cppinit.c 13 Nov 2002 19:56:32 -0000
*************** path_include (pfile, list, path)
*** 170,183 ****
if (q == p)
{
/* An empty name in the path stands for the current directory. */
! name = (char *) xmalloc (2);
name[0] = '.';
name[1] = 0;
}
else
{
/* Otherwise use the directory that is named. */
! name = (char *) xmalloc (q - p + 1);
memcpy (name, p, q - p);
name[q - p] = 0;
}
--- 170,183 ----
if (q == p)
{
/* An empty name in the path stands for the current directory. */
! name = xmalloc (2);
name[0] = '.';
name[1] = 0;
}
else
{
/* Otherwise use the directory that is named. */
! name = xmalloc (q - p + 1);
memcpy (name, p, q - p);
name[q - p] = 0;
}
*************** append_include_chain (pfile, dir, path,
*** 237,243 ****
if (len > pfile->max_include_len)
pfile->max_include_len = len;
! new = (struct search_path *) xmalloc (sizeof (struct search_path));
new->name = dir;
new->len = len;
INO_T_COPY (new->ino, st.st_ino);
--- 237,243 ----
if (len > pfile->max_include_len)
pfile->max_include_len = len;
! new = xmalloc (sizeof (struct search_path));
new->name = dir;
new->len = len;
INO_T_COPY (new->ino, st.st_ino);
*************** cpp_create_reader (lang)
*** 518,524 ****
/* Initialize this instance of the library if it hasn't been already. */
init_library ();
! pfile = (cpp_reader *) xcalloc (1, sizeof (cpp_reader));
cpp_set_lang (pfile, lang);
CPP_OPTION (pfile, warn_import) = 1;
--- 518,524 ----
/* Initialize this instance of the library if it hasn't been already. */
init_library ();
! pfile = xcalloc (1, sizeof (cpp_reader));
cpp_set_lang (pfile, lang);
CPP_OPTION (pfile, warn_import) = 1;
*************** cpp_create_reader (lang)
*** 532,538 ****
CPP_OPTION (pfile, warn_long_long) = !CPP_OPTION (pfile, c99);
CPP_OPTION (pfile, pending) =
! (struct cpp_pending *) xcalloc (1, sizeof (struct cpp_pending));
/* Default CPP arithmetic to something sensible for the host for the
benefit of dumb users like fix-header. */
--- 532,538 ----
CPP_OPTION (pfile, warn_long_long) = !CPP_OPTION (pfile, c99);
CPP_OPTION (pfile, pending) =
! xcalloc (1, sizeof (struct cpp_pending));
/* Default CPP arithmetic to something sensible for the host for the
benefit of dumb users like fix-header. */
*************** init_standard_includes (pfile)
*** 794,800 ****
/* Remove the `include' from /usr/local/lib/gcc.../include.
GCC_INCLUDE_DIR will always end in /include. */
int default_len = cpp_GCC_INCLUDE_DIR_len;
! char *default_prefix = (char *) alloca (default_len + 1);
int specd_len = strlen (specd_prefix);
memcpy (default_prefix, cpp_GCC_INCLUDE_DIR, default_len);
--- 794,800 ----
/* Remove the `include' from /usr/local/lib/gcc.../include.
GCC_INCLUDE_DIR will always end in /include. */
int default_len = cpp_GCC_INCLUDE_DIR_len;
! char *default_prefix = alloca (default_len + 1);
int specd_len = strlen (specd_prefix);
memcpy (default_prefix, cpp_GCC_INCLUDE_DIR, default_len);
*************** init_standard_includes (pfile)
*** 813,819 ****
/* Yes; change prefix and add to search list. */
int flen = strlen (p->fname);
int this_len = specd_len + flen - default_len;
! char *str = (char *) xmalloc (this_len + 1);
memcpy (str, specd_prefix, specd_len);
memcpy (str + specd_len,
p->fname + default_len,
--- 813,819 ----
/* Yes; change prefix and add to search list. */
int flen = strlen (p->fname);
int this_len = specd_len + flen - default_len;
! char *str = xmalloc (this_len + 1);
memcpy (str, specd_prefix, specd_len);
memcpy (str + specd_len,
p->fname + default_len,
Index: gcc/cpplib.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cpplib.c,v
retrieving revision 1.324
diff -c -3 -p -r1.324 cpplib.c
*** gcc/cpplib.c 22 Sep 2002 02:03:17 -0000 1.324
--- gcc/cpplib.c 13 Nov 2002 19:56:39 -0000
*************** glue_header_name (pfile)
*** 572,578 ****
/* To avoid lexed tokens overwriting our glued name, we can only
allocate from the string pool once we've lexed everything. */
! buffer = (unsigned char *) xmalloc (capacity);
for (;;)
{
token = cpp_get_token (pfile);
--- 572,578 ----
/* To avoid lexed tokens overwriting our glued name, we can only
allocate from the string pool once we've lexed everything. */
! buffer = xmalloc (capacity);
for (;;)
{
token = cpp_get_token (pfile);
*************** glue_header_name (pfile)
*** 584,590 ****
if (total_len + len > capacity)
{
capacity = (capacity + len) * 2;
! buffer = (unsigned char *) xrealloc (buffer, capacity);
}
if (token->flags & PREV_WHITE)
--- 584,590 ----
if (total_len + len > capacity)
{
capacity = (capacity + len) * 2;
! buffer = xrealloc (buffer, capacity);
}
if (token->flags & PREV_WHITE)
*************** cpp_define (pfile, str)
*** 1794,1800 ****
tack " 1" on the end. */
count = strlen (str);
! buf = (char *) alloca (count + 3);
memcpy (buf, str, count);
p = strchr (str, '=');
--- 1794,1800 ----
tack " 1" on the end. */
count = strlen (str);
! buf = alloca (count + 3);
memcpy (buf, str, count);
p = strchr (str, '=');
*************** handle_assertion (pfile, str, type)
*** 1860,1866 ****
{
/* 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);
memcpy (buf, str, count);
buf[p - str] = '(';
--- 1860,1866 ----
{
/* 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 = alloca (count + 2);
memcpy (buf, str, count);
buf[p - str] = '(';
Index: gcc/cppmacro.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cppmacro.c,v
retrieving revision 1.126
diff -c -3 -p -r1.126 cppmacro.c
*** gcc/cppmacro.c 9 Oct 2002 09:56:07 -0000 1.126
--- gcc/cppmacro.c 13 Nov 2002 19:56:46 -0000
*************** paste_tokens (pfile, plhs, rhs)
*** 435,441 ****
lhs = *plhs;
len = cpp_token_len (lhs) + cpp_token_len (rhs) + 1;
! buf = (unsigned char *) alloca (len);
end = cpp_spell_token (pfile, lhs, buf);
/* Avoid comment headers, since they are still processed in stage 3.
--- 435,441 ----
lhs = *plhs;
len = cpp_token_len (lhs) + cpp_token_len (rhs) + 1;
! buf = alloca (len);
end = cpp_spell_token (pfile, lhs, buf);
/* Avoid comment headers, since they are still processed in stage 3.
*************** cpp_macro_definition (pfile, node)
*** 1712,1718 ****
if (len > pfile->macro_buffer_len)
{
! pfile->macro_buffer = (uchar *) xrealloc (pfile->macro_buffer, len);
pfile->macro_buffer_len = len;
}
--- 1712,1718 ----
if (len > pfile->macro_buffer_len)
{
! pfile->macro_buffer = xrealloc (pfile->macro_buffer, len);
pfile->macro_buffer_len = len;
}
Index: gcc/cppspec.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cppspec.c,v
retrieving revision 1.17
diff -c -3 -p -r1.17 cppspec.c
*** gcc/cppspec.c 22 May 2002 22:02:16 -0000 1.17
--- gcc/cppspec.c 13 Nov 2002 19:56:47 -0000
*************** lang_specific_driver (in_argc, in_argv,
*** 199,205 ****
return;
/* One more slot for a terminating null. */
! new_argv = (const char **) xmalloc ((new_argc + 1) * sizeof(char *));
new_argv[0] = argv[0];
j = 1;
--- 199,205 ----
return;
/* One more slot for a terminating null. */
! new_argv = xmalloc ((new_argc + 1) * sizeof(char *));
new_argv[0] = argv[0];
j = 1;
Index: gcc/cpptrad.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cpptrad.c,v
retrieving revision 1.28
diff -c -3 -p -r1.28 cpptrad.c
*** gcc/cpptrad.c 8 Nov 2002 22:36:22 -0000 1.28
--- gcc/cpptrad.c 13 Nov 2002 19:56:51 -0000
*************** check_output_buffer (pfile, n)
*** 116,123 ****
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.limit = pfile->out.base + new_size;
pfile->out.cur = pfile->out.base + size;
}
--- 116,122 ----
size_t size = pfile->out.cur - pfile->out.base;
size_t new_size = (size + n) * 3 / 2;
! pfile->out.base = xrealloc (pfile->out.base, new_size);
pfile->out.limit = pfile->out.base + new_size;
pfile->out.cur = pfile->out.base + size;
}
Index: gcc/cse.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cse.c,v
retrieving revision 1.243
diff -c -3 -p -r1.243 cse.c
*** gcc/cse.c 28 Oct 2002 14:07:45 -0000 1.243
--- gcc/cse.c 13 Nov 2002 19:57:23 -0000
*************** get_cse_reg_info (regno)
*** 957,963 ****
cse_reg_info_free_list = p->next;
}
else
! p = (struct cse_reg_info *) xmalloc (sizeof (struct cse_reg_info));
/* Insert into hash table. */
p->hash_next = *hash_head;
--- 957,963 ----
cse_reg_info_free_list = p->next;
}
else
! p = xmalloc (sizeof (struct cse_reg_info));
/* Insert into hash table. */
p->hash_next = *hash_head;
*************** new_basic_block ()
*** 995,1001 ****
/* Clear out hash table state for this pass. */
! memset ((char *) reg_hash, 0, sizeof reg_hash);
if (cse_reg_info_used_list)
{
--- 995,1001 ----
/* Clear out hash table state for this pass. */
! memset (reg_hash, 0, sizeof reg_hash);
if (cse_reg_info_used_list)
{
*************** insert (x, classp, hash, mode)
*** 1591,1597 ****
else
{
n_elements_made++;
! elt = (struct table_elt *) xmalloc (sizeof (struct table_elt));
}
elt->exp = x;
--- 1591,1597 ----
else
{
n_elements_made++;
! elt = xmalloc (sizeof (struct table_elt));
}
elt->exp = x;
*************** cse_insn (insn, libcall_insn)
*** 4810,4816 ****
if (GET_CODE (x) == SET)
{
! sets = (struct set *) alloca (sizeof (struct set));
sets[0].rtl = x;
/* Ignore SETs that are unconditional jumps.
--- 4810,4816 ----
if (GET_CODE (x) == SET)
{
! sets = alloca (sizeof (struct set));
sets[0].rtl = x;
/* Ignore SETs that are unconditional jumps.
*************** cse_insn (insn, libcall_insn)
*** 4845,4851 ****
{
int lim = XVECLEN (x, 0);
! sets = (struct set *) alloca (lim * sizeof (struct set));
/* Find all regs explicitly clobbered in this insn,
and ensure they are not replaced with any other regs
--- 4845,4851 ----
{
int lim = XVECLEN (x, 0);
! sets = alloca (lim * sizeof (struct set));
/* Find all regs explicitly clobbered in this insn,
and ensure they are not replaced with any other regs
*************** cse_main (f, nregs, after_loop, file)
*** 7132,7138 ****
/* Find the largest uid. */
max_uid = get_max_uid ();
! uid_cuid = (int *) xcalloc (max_uid + 1, sizeof (int));
/* Compute the mapping from uids to cuids.
CUIDs are numbers assigned to insns, like uids,
--- 7132,7138 ----
/* Find the largest uid. */
max_uid = get_max_uid ();
! uid_cuid = xcalloc (max_uid + 1, sizeof (int));
/* Compute the mapping from uids to cuids.
CUIDs are numbers assigned to insns, like uids,
*************** cse_basic_block (from, to, next_branch,
*** 7252,7260 ****
/* 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 -= max_reg;
new_basic_block ();
--- 7252,7258 ----
/* This array is undefined before max_reg, so only allocate
the space actually needed and adjust the start. */
! qty_table = xmalloc ((max_qty - max_reg) * sizeof (struct
qty_table_elem));
qty_table -= max_reg;
new_basic_block ();
*************** delete_trivially_dead_insns (insns, nreg
*** 7692,7698 ****
timevar_push (TV_DELETE_TRIVIALLY_DEAD);
/* First count the number of times each register is used. */
! counts = (int *) xcalloc (nreg, sizeof (int));
for (insn = next_real_insn (insns); insn; insn = next_real_insn (insn))
count_reg_usage (insn, counts, NULL_RTX, 1);
--- 7690,7696 ----
timevar_push (TV_DELETE_TRIVIALLY_DEAD);
/* First count the number of times each register is used. */
! 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);
Index: gcc/dbxout.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/dbxout.c,v
retrieving revision 1.129
diff -c -3 -p -r1.129 dbxout.c
*** gcc/dbxout.c 8 Nov 2002 23:12:24 -0000 1.129
--- gcc/dbxout.c 13 Nov 2002 19:57:35 -0000
*************** dbxout_init (input_file_name)
*** 422,428 ****
asmfile = asm_out_file;
typevec_len = 100;
! typevec = (struct typeinfo *) xcalloc (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
--- 422,428 ----
asmfile = asm_out_file;
typevec_len = 100;
! typevec = xcalloc (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
*************** dbxout_init (input_file_name)
*** 481,487 ****
next_type_number = 1;
#ifdef DBX_USE_BINCL
! current_file = (struct dbx_file *) xmalloc (sizeof *current_file);
current_file->next = NULL;
current_file->file_number = 0;
current_file->next_type_number = 1;
--- 481,487 ----
next_type_number = 1;
#ifdef DBX_USE_BINCL
! current_file = xmalloc (sizeof *current_file);
current_file->next = NULL;
current_file->file_number = 0;
current_file->next_type_number = 1;
*************** dbxout_start_source_file (line, filename
*** 538,544 ****
const char *filename ATTRIBUTE_UNUSED;
{
#ifdef DBX_USE_BINCL
! struct dbx_file *n = (struct dbx_file *) xmalloc (sizeof *n);
n->next = current_file;
n->file_number = next_file_number++;
--- 538,544 ----
const char *filename ATTRIBUTE_UNUSED;
{
#ifdef DBX_USE_BINCL
! struct dbx_file *n = xmalloc (sizeof *n);
n->next = current_file;
n->file_number = next_file_number++;
*************** dbxout_type (type, full)
*** 1090,1100 ****
if (next_type_number == typevec_len)
{
! typevec
! = (struct typeinfo *) xrealloc (typevec,
! typevec_len * 2 * sizeof typevec[0]);
! memset ((char *) (typevec + typevec_len), 0,
! typevec_len * sizeof typevec[0]);
typevec_len *= 2;
}
--- 1090,1098 ----
if (next_type_number == typevec_len)
{
! typevec = xrealloc (typevec, typevec_len * 2 * sizeof typevec[0]);
! memset (typevec + typevec_len, 0,
! typevec_len * sizeof typevec[0]);
typevec_len *= 2;
}
Index: gcc/df.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/df.c,v
retrieving revision 1.38
diff -c -3 -p -r1.38 df.c
*** gcc/df.c 22 Sep 2002 14:09:30 -0000 1.38
--- gcc/df.c 13 Nov 2002 19:57:48 -0000
*************** df_link_create (ref, next)
*** 643,650 ****
{
struct df_link *link;
! link = (struct df_link *) obstack_alloc (&df_ref_obstack,
! sizeof (*link));
link->next = next;
link->ref = ref;
return link;
--- 643,649 ----
{
struct df_link *link;
! link = obstack_alloc (&df_ref_obstack, sizeof (*link));
link->next = next;
link->ref = ref;
return link;
*************** df_ref_create (df, reg, loc, insn, ref_t
*** 783,790 ****
struct ref *this_ref;
unsigned int uid;
! this_ref = (struct ref *) obstack_alloc (&df_ref_obstack,
! sizeof (*this_ref));
DF_REF_REG (this_ref) = reg;
DF_REF_LOC (this_ref) = loc;
DF_REF_INSN (this_ref) = insn;
--- 782,789 ----
struct ref *this_ref;
unsigned int uid;
! this_ref = obstack_alloc (&df_ref_obstack,
! sizeof (*this_ref));
DF_REF_REG (this_ref) = reg;
DF_REF_LOC (this_ref) = loc;
DF_REF_INSN (this_ref) = insn;
Index: gcc/dominance.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/dominance.c,v
retrieving revision 1.13
diff -c -3 -p -r1.13 dominance.c
*** gcc/dominance.c 14 Sep 2002 15:51:42 -0000 1.13
--- gcc/dominance.c 13 Nov 2002 19:57:51 -0000
*************** void debug_dominance_info PARAMS ((domi
*** 134,144 ****
{ \
unsigned int i = 1; /* Catch content == i. */ \
if (! (content)) \
! (var) = (type *) xcalloc ((num), sizeof (type)); \
else \
{ \
! (var) = (type *) xmalloc ((num) * sizeof (type)); \
! for (i = 0; i < num; i++) \
(var)[i] = (content); \
} \
} \
--- 134,144 ----
{ \
unsigned int i = 1; /* Catch content == i. */ \
if (! (content)) \
! (var) = xcalloc ((num), sizeof (type)); \
else \
{ \
! (var) = xmalloc ((num) * sizeof (type)); \
! for (i = 0; i < (num); i++) \
(var)[i] = (content); \
} \
} \
*************** calc_dfs_tree_nonrec (di, bb, reverse)
*** 218,224 ****
/* Ending block. */
basic_block ex_block;
! stack = (edge *) xmalloc ((n_basic_blocks + 3) * sizeof (edge));
sp = 0;
/* Initialize our border blocks, and the first edge. */
--- 218,224 ----
/* Ending block. */
basic_block ex_block;
! stack = xmalloc ((n_basic_blocks + 3) * sizeof (edge));
sp = 0;
/* Initialize our border blocks, and the first edge. */
Index: gcc/dwarf2out.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.389
diff -c -3 -p -r1.389 dwarf2out.c
*** gcc/dwarf2out.c 27 Oct 2002 09:14:03 -0000 1.389
--- gcc/dwarf2out.c 13 Nov 2002 19:58:41 -0000
*************** queue_reg_save (label, reg, offset)
*** 1087,1093 ****
rtx reg;
long offset;
{
! struct queued_reg_save *q = (struct queued_reg_save *) xmalloc (sizeof
(*q));
q->next = queued_reg_saves;
q->reg = reg;
--- 1087,1093 ----
rtx reg;
long offset;
{
! struct queued_reg_save *q = xmalloc (sizeof (*q));
q->next = queued_reg_saves;
q->reg = reg;
*************** new_die (tag_value, parent_die, t)
*** 5119,5125 ****
{
limbo_die_node *limbo_node;
! limbo_node = (limbo_die_node *) xmalloc (sizeof (limbo_die_node));
limbo_node->die = die;
limbo_node->created_for = t;
limbo_node->next = limbo_die_list;
--- 5119,5125 ----
{
limbo_die_node *limbo_node;
! limbo_node = xmalloc (sizeof (limbo_die_node));
limbo_node->die = die;
limbo_node->created_for = t;
limbo_node->next = limbo_die_list;
*************** equate_decl_number_to_die (decl, decl_di
*** 5176,5187 ****
/ DECL_DIE_TABLE_INCREMENT)
* DECL_DIE_TABLE_INCREMENT;
! decl_die_table
! = (dw_die_ref *) xrealloc (decl_die_table,
! sizeof (dw_die_ref) * num_allocated);
! memset ((char *) &decl_die_table[decl_die_table_allocated], 0,
! (num_allocated - decl_die_table_allocated) * sizeof (dw_die_ref));
decl_die_table_allocated = num_allocated;
}
--- 5176,5186 ----
/ DECL_DIE_TABLE_INCREMENT)
* DECL_DIE_TABLE_INCREMENT;
! decl_die_table = xrealloc (decl_die_table,
! sizeof (dw_die_ref) * num_allocated);
! 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;
}
*************** compute_section_prefix (unit_die)
*** 5722,5728 ****
{
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 *p;
int i, mark;
unsigned char checksum[16];
--- 5721,5727 ----
{
const char *die_name = get_AT_string (unit_die, DW_AT_name);
const char *base = die_name ? lbasename (die_name) : "anonymous";
! char *name = alloca (strlen (base) + 64);
char *p;
int i, mark;
unsigned char checksum[16];
*************** build_abbrev_table (die)
*** 6130,6140 ****
if (abbrev_die_table_in_use >= abbrev_die_table_allocated)
{
n_alloc = abbrev_die_table_allocated + ABBREV_DIE_TABLE_INCREMENT;
! abbrev_die_table
! = (dw_die_ref *) xrealloc (abbrev_die_table,
sizeof (dw_die_ref) * n_alloc);
! memset ((char *) &abbrev_die_table[abbrev_die_table_allocated], 0,
(n_alloc - abbrev_die_table_allocated) * sizeof (dw_die_ref));
abbrev_die_table_allocated = n_alloc;
}
--- 6129,6138 ----
if (abbrev_die_table_in_use >= abbrev_die_table_allocated)
{
n_alloc = abbrev_die_table_allocated + ABBREV_DIE_TABLE_INCREMENT;
! abbrev_die_table = xrealloc (abbrev_die_table,
sizeof (dw_die_ref) * n_alloc);
! 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;
}
*************** output_comp_unit (die, output_if_empty)
*** 6818,6824 ****
oldsym = die->die_symbol;
if (oldsym)
{
! tmp = (char *) alloca (strlen (oldsym) + 24);
sprintf (tmp, ".gnu.linkonce.wi.%s", oldsym);
secname = tmp;
--- 6816,6822 ----
oldsym = die->die_symbol;
if (oldsym)
{
! tmp = alloca (strlen (oldsym) + 24);
sprintf (tmp, ".gnu.linkonce.wi.%s", oldsym);
secname = tmp;
*************** output_file_names ()
*** 7166,7175 ****
int idx;
/* Allocate the various arrays we need. */
! files = (struct file_info *) alloca (file_table.in_use
! * sizeof (struct file_info));
! dirs = (struct dir_info *) alloca (file_table.in_use
! * sizeof (struct dir_info));
/* Sort the file names. */
for (i = 1; i < (int) file_table.in_use; i++)
--- 7164,7171 ----
int idx;
/* Allocate the various arrays we need. */
! files = alloca (file_table.in_use * sizeof (struct file_info));
! dirs = alloca (file_table.in_use * sizeof (struct dir_info));
/* Sort the file names. */
for (i = 1; i < (int) file_table.in_use; i++)
*************** output_file_names ()
*** 7243,7250 ****
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));
memset (saved, '\0', ndirs * sizeof (saved[0]));
for (i = 0; i < ndirs; i++)
--- 7239,7246 ----
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 = alloca (ndirs * sizeof (int));
! savehere = alloca (ndirs * sizeof (int));
memset (saved, '\0', ndirs * sizeof (saved[0]));
for (i = 0; i < ndirs; i++)
*************** output_file_names ()
*** 7301,7307 ****
/* 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 (file_table.in_use * sizeof (int));
for (i = 1; i < (int) file_table.in_use; i++)
{
backmap[files[i].file_idx] = i;
--- 7297,7303 ----
/* 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 = alloca (file_table.in_use * sizeof (int));
for (i = 1; i < (int) file_table.in_use; i++)
{
backmap[files[i].file_idx] = i;
*************** add_const_value_attribute (die, rtl)
*** 9073,9079 ****
if (GET_MODE_CLASS (mode) == MODE_FLOAT)
{
unsigned length = GET_MODE_SIZE (mode) / 4;
! long *array = (long *) xmalloc (sizeof (long) * length);
REAL_VALUE_TYPE rv;
REAL_VALUE_FROM_CONST_DOUBLE (rv, rtl);
--- 9069,9075 ----
if (GET_MODE_CLASS (mode) == MODE_FLOAT)
{
unsigned length = GET_MODE_SIZE (mode) / 4;
! long *array = xmalloc (sizeof (long) * length);
REAL_VALUE_TYPE rv;
REAL_VALUE_FROM_CONST_DOUBLE (rv, rtl);
*************** static void
*** 12229,12235 ****
init_file_table ()
{
/* Allocate the initial hunk of the file_table. */
! file_table.table = (char **) xcalloc (FILE_TABLE_INCREMENT, sizeof (char
*));
file_table.allocated = FILE_TABLE_INCREMENT;
/* Skip the first entry - file numbers begin at 1. */
--- 12225,12231 ----
init_file_table ()
{
/* Allocate the initial hunk of the file_table. */
! file_table.table = xcalloc (FILE_TABLE_INCREMENT, sizeof (char *));
file_table.allocated = FILE_TABLE_INCREMENT;
/* Skip the first entry - file numbers begin at 1. */
*************** dwarf2out_init (main_input_filename)
*** 12419,12426 ****
lookup_filename (main_input_filename);
/* Allocate the initial hunk of the decl_die_table. */
! decl_die_table
! = (dw_die_ref *) xcalloc (DECL_DIE_TABLE_INCREMENT, sizeof
(dw_die_ref));
decl_die_table_allocated = DECL_DIE_TABLE_INCREMENT;
decl_die_table_in_use = 0;
--- 12415,12421 ----
lookup_filename (main_input_filename);
/* Allocate the initial hunk of the decl_die_table. */
! decl_die_table = xcalloc (DECL_DIE_TABLE_INCREMENT, sizeof (dw_die_ref));
decl_die_table_allocated = DECL_DIE_TABLE_INCREMENT;
decl_die_table_in_use = 0;
*************** dwarf2out_init (main_input_filename)
*** 12428,12444 ****
VARRAY_TREE_INIT (decl_scope_table, 256, "decl_scope_table");
/* Allocate the initial hunk of the abbrev_die_table. */
! abbrev_die_table
! = (dw_die_ref *) xcalloc (ABBREV_DIE_TABLE_INCREMENT,
sizeof (dw_die_ref));
abbrev_die_table_allocated = ABBREV_DIE_TABLE_INCREMENT;
/* Zero-th entry is allocated, but unused */
abbrev_die_table_in_use = 1;
/* Allocate the initial hunk of the line_info_table. */
! line_info_table
! = (dw_line_info_ref) xcalloc (LINE_INFO_TABLE_INCREMENT,
! sizeof (dw_line_info_entry));
line_info_table_allocated = LINE_INFO_TABLE_INCREMENT;
/* Zero-th entry is allocated, but unused */
--- 12423,12437 ----
VARRAY_TREE_INIT (decl_scope_table, 256, "decl_scope_table");
/* Allocate the initial hunk of the abbrev_die_table. */
! abbrev_die_table = xcalloc (ABBREV_DIE_TABLE_INCREMENT,
sizeof (dw_die_ref));
abbrev_die_table_allocated = ABBREV_DIE_TABLE_INCREMENT;
/* Zero-th entry is allocated, but unused */
abbrev_die_table_in_use = 1;
/* Allocate the initial hunk of the line_info_table. */
! line_info_table = xcalloc (LINE_INFO_TABLE_INCREMENT,
! sizeof (dw_line_info_entry));
line_info_table_allocated = LINE_INFO_TABLE_INCREMENT;
/* Zero-th entry is allocated, but unused */
Index: gcc/dwarfout.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/dwarfout.c,v
retrieving revision 1.117
diff -c -3 -p -r1.117 dwarfout.c
*** gcc/dwarfout.c 22 Sep 2002 14:09:31 -0000 1.117
--- gcc/dwarfout.c 13 Nov 2002 19:59:10 -0000
*************** dienum_push ()
*** 3599,3606 ****
{
pending_siblings_allocated += PENDING_SIBLINGS_INCREMENT;
pending_sibling_stack
! = (unsigned *) xrealloc (pending_sibling_stack,
! pending_siblings_allocated * sizeof(unsigned));
}
pending_siblings++;
--- 3599,3606 ----
{
pending_siblings_allocated += PENDING_SIBLINGS_INCREMENT;
pending_sibling_stack
! = xrealloc (pending_sibling_stack,
! pending_siblings_allocated * sizeof(unsigned));
}
pending_siblings++;
*************** pend_type (type)
*** 4521,4528 ****
{
pending_types_allocated += PENDING_TYPES_INCREMENT;
pending_types_list
! = (tree *) xrealloc (pending_types_list,
! sizeof (tree) * pending_types_allocated);
}
pending_types_list[pending_types++] = type;
--- 4521,4528 ----
{
pending_types_allocated += PENDING_TYPES_INCREMENT;
pending_types_list
! = xrealloc (pending_types_list,
! sizeof (tree) * pending_types_allocated);
}
pending_types_list[pending_types++] = type;
*************** add_incomplete_type (type)
*** 4652,4659 ****
{
incomplete_types_allocated += INCOMPLETE_TYPES_INCREMENT;
incomplete_types_list
! = (tree *) xrealloc (incomplete_types_list,
! sizeof (tree) * incomplete_types_allocated);
}
incomplete_types_list[incomplete_types++] = type;
--- 4652,4659 ----
{
incomplete_types_allocated += INCOMPLETE_TYPES_INCREMENT;
incomplete_types_list
! = xrealloc (incomplete_types_list,
! sizeof (tree) * incomplete_types_allocated);
}
incomplete_types_list[incomplete_types++] = type;
*************** dwarfout_init (main_input_filename)
*** 6203,6209 ****
/* Allocate the initial hunk of the pending_types_list. */
pending_types_list
! = (tree *) xmalloc (PENDING_TYPES_INCREMENT * sizeof (tree));
pending_types_allocated = PENDING_TYPES_INCREMENT;
pending_types = 0;
--- 6203,6209 ----
/* Allocate the initial hunk of the pending_types_list. */
pending_types_list
! = xmalloc (PENDING_TYPES_INCREMENT * sizeof (tree));
pending_types_allocated = PENDING_TYPES_INCREMENT;
pending_types = 0;
Index: gcc/emit-rtl.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/emit-rtl.c,v
retrieving revision 1.302
diff -c -3 -p -r1.302 emit-rtl.c
*** gcc/emit-rtl.c 11 Oct 2002 09:59:04 -0000 1.302
--- gcc/emit-rtl.c 13 Nov 2002 19:59:30 -0000
*************** gen_rtvec VPARAMS ((int n, ...))
*** 746,752 ****
if (n == 0)
return NULL_RTVEC; /* Don't allocate an empty rtvec... */
! vector = (rtx *) alloca (n * sizeof (rtx));
for (i = 0; i < n; i++)
vector[i] = va_arg (p, rtx);
--- 746,752 ----
if (n == 0)
return NULL_RTVEC; /* Don't allocate an empty rtvec... */
! vector = alloca (n * sizeof (rtx));
for (i = 0; i < n; i++)
vector[i] = va_arg (p, rtx);
*************** init_emit ()
*** 5212,5227 ****
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));
regno_reg_rtx
! = (rtx *) ggc_alloc_cleared (f->emit->regno_pointer_align_length
! * sizeof (rtx));
f->emit->regno_decl
! = (tree *) ggc_alloc_cleared (f->emit->regno_pointer_align_length
! * sizeof (tree));
/* Put copies of all the hard registers into regno_reg_rtx. */
memcpy (regno_reg_rtx,
--- 5212,5227 ----
f->emit->regno_pointer_align_length = LAST_VIRTUAL_REGISTER + 101;
f->emit->regno_pointer_align
! = ggc_alloc_cleared (f->emit->regno_pointer_align_length
! * sizeof (unsigned char));
regno_reg_rtx
! = ggc_alloc_cleared (f->emit->regno_pointer_align_length
! * sizeof (rtx));
f->emit->regno_decl
! = ggc_alloc_cleared (f->emit->regno_pointer_align_length
! * sizeof (tree));
/* Put copies of all the hard registers into regno_reg_rtx. */
memcpy (regno_reg_rtx,