avr.c (avr_init_once): Use xcalloc in lieu of xmalloc/memset.

* config/avr/avr.c (avr_init_once): Use xcalloc in lieu of
	xmalloc/memset.
	* config/ia64/ia64.c (ia64_reorg): Likewise.
	* conflict.c (conflict_graph_new): Likewise.
	* fixinc/fixincl.c (run_compiles): Likewise.
	* genattrtab.c (optimize_attrs): Likewise.
	* genrecog.c (new_decision): Likewise.
	* haifa-sched.c (schedule_block): Likewise.
	* hashtable.c (ht_create): Likewise.

From-SVN: r70337
This commit is contained in:
Kaveh R. Ghazi 2003-08-11 21:47:39 +00:00 committed by Kaveh Ghazi
parent 1705e37dbb
commit 29da5c9288
9 changed files with 25 additions and 26 deletions

View File

@ -1,3 +1,15 @@
2003-08-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* config/avr/avr.c (avr_init_once): Use xcalloc in lieu of
xmalloc/memset.
* config/ia64/ia64.c (ia64_reorg): Likewise.
* conflict.c (conflict_graph_new): Likewise.
* fixinc/fixincl.c (run_compiles): Likewise.
* genattrtab.c (optimize_attrs): Likewise.
* genrecog.c (new_decision): Likewise.
* haifa-sched.c (schedule_block): Likewise.
* hashtable.c (ht_create): Likewise.
2003-08-11 Bob Wilson <bob.wilson@acm.org>
* config/xtensa/lib2funcs.S: Fix whitespace.

View File

@ -281,20 +281,17 @@ avr_override_options ()
void
avr_init_once ()
{
tmp_reg_rtx = xmalloc (sizeof (struct rtx_def) + 1 * sizeof (rtunion));
memset (tmp_reg_rtx, 0, sizeof (struct rtx_def) + 1 * sizeof (rtunion));
tmp_reg_rtx = xcalloc (1, sizeof (struct rtx_def) + 1 * sizeof (rtunion));
PUT_CODE (tmp_reg_rtx, REG);
PUT_MODE (tmp_reg_rtx, QImode);
XINT (tmp_reg_rtx, 0) = TMP_REGNO;
zero_reg_rtx = xmalloc (sizeof (struct rtx_def) + 1 * sizeof (rtunion));
memset (zero_reg_rtx, 0, sizeof (struct rtx_def) + 1 * sizeof (rtunion));
zero_reg_rtx = xcalloc (1, sizeof (struct rtx_def) + 1 * sizeof (rtunion));
PUT_CODE (zero_reg_rtx, REG);
PUT_MODE (zero_reg_rtx, QImode);
XINT (zero_reg_rtx, 0) = ZERO_REGNO;
ldi_reg_rtx = xmalloc (sizeof (struct rtx_def) + 1 * sizeof (rtunion));
memset (ldi_reg_rtx, 0, sizeof (struct rtx_def) + 1 * sizeof (rtunion));
ldi_reg_rtx = xcalloc (1, sizeof (struct rtx_def) + 1 * sizeof (rtunion));
PUT_CODE (ldi_reg_rtx, REG);
PUT_MODE (ldi_reg_rtx, QImode);
XINT (ldi_reg_rtx, 0) = LDI_REG_REGNO;

View File

@ -7419,14 +7419,11 @@ ia64_reorg ()
PREV_INSN (ia64_nop) = NEXT_INSN (ia64_nop) = NULL_RTX;
recog_memoized (ia64_nop);
clocks_length = get_max_uid () + 1;
stops_p = (char *) xmalloc (clocks_length);
memset (stops_p, 0, clocks_length);
stops_p = xcalloc (1, clocks_length);
if (ia64_tune == PROCESSOR_ITANIUM)
{
clocks = (int *) xmalloc (clocks_length * sizeof (int));
memset (clocks, 0, clocks_length * sizeof (int));
add_cycles = (int *) xmalloc (clocks_length * sizeof (int));
memset (add_cycles, 0, clocks_length * sizeof (int));
clocks = xcalloc (clocks_length, sizeof (int));
add_cycles = xcalloc (clocks_length, sizeof (int));
}
if (ia64_tune == PROCESSOR_ITANIUM2)
{

View File

@ -160,9 +160,8 @@ conflict_graph_new (int num_regs)
obstack_init (&graph->arc_obstack);
/* Create and zero the lookup table by register number. */
graph->neighbor_heads = xmalloc (num_regs * sizeof (conflict_graph_arc));
graph->neighbor_heads = xcalloc (num_regs, sizeof (conflict_graph_arc));
memset (graph->neighbor_heads, 0, num_regs * sizeof (conflict_graph_arc));
return graph;
}

View File

@ -481,11 +481,10 @@ run_compiles (void)
{
tFixDesc *p_fixd = fixDescList;
int fix_ct = FIX_COUNT;
regex_t *p_re = xmalloc (REGEX_COUNT * sizeof (regex_t));
regex_t *p_re = xcalloc (REGEX_COUNT, sizeof (regex_t));
/* Make sure compile_re does not stumble across invalid data */
memset (p_re, '\0', REGEX_COUNT * sizeof (regex_t));
memset (&incl_quote_re, '\0', sizeof (regex_t));
compile_re (incl_quote_pat, &incl_quote_re, 1,

View File

@ -3393,10 +3393,8 @@ optimize_attrs (void)
return;
/* Make 2 extra elements, for "code" values -2 and -1. */
insn_code_values = xmalloc ((insn_code_number + 2)
* sizeof (struct attr_value_list *));
memset (insn_code_values, 0,
(insn_code_number + 2) * sizeof (struct attr_value_list *));
insn_code_values = xcalloc ((insn_code_number + 2),
sizeof (struct attr_value_list *));
/* Offset the table address so we can index by -2 or -1. */
insn_code_values += 2;

View File

@ -316,9 +316,8 @@ extern void debug_decision_list
static struct decision *
new_decision (const char *position, struct decision_head *last)
{
struct decision *new = xmalloc (sizeof (struct decision));
struct decision *new = xcalloc (1, sizeof (struct decision));
memset (new, 0, sizeof (*new));
new->success = *last;
new->position = xstrdup (position);
new->number = next_number++;

View File

@ -2138,8 +2138,7 @@ schedule_block (int b, int rgn_n_insns)
{
/* It is used for first cycle multipass scheduling. */
temp_state = alloca (dfa_state_size);
ready_try = xmalloc ((rgn_n_insns + 1) * sizeof (char));
memset (ready_try, 0, (rgn_n_insns + 1) * sizeof (char));
ready_try = xcalloc ((rgn_n_insns + 1), sizeof (char));
choice_stack = xmalloc ((rgn_n_insns + 1)
* sizeof (struct choice_entry));
for (i = 0; i <= rgn_n_insns; i++)

View File

@ -58,8 +58,7 @@ ht_create (unsigned int order)
unsigned int nslots = 1 << order;
hash_table *table;
table = xmalloc (sizeof (hash_table));
memset (table, 0, sizeof (hash_table));
table = xcalloc (1, sizeof (hash_table));
/* Strings need no alignment. */
_obstack_begin (&table->stack, 0, 0,