diff options
-rw-r--r-- | gcc/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/config/avr/avr.c | 9 | ||||
-rw-r--r-- | gcc/config/ia64/ia64.c | 9 | ||||
-rw-r--r-- | gcc/conflict.c | 3 | ||||
-rw-r--r-- | gcc/fixinc/fixincl.c | 3 | ||||
-rw-r--r-- | gcc/genattrtab.c | 6 | ||||
-rw-r--r-- | gcc/genrecog.c | 3 | ||||
-rw-r--r-- | gcc/haifa-sched.c | 3 | ||||
-rw-r--r-- | gcc/hashtable.c | 3 |
9 files changed, 25 insertions, 26 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2d7dabe507e..d204bc35a0f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index 432dd538ae6..16701d1b550 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -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; diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 5a101287ea8..c3676e151f9 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -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) { diff --git a/gcc/conflict.c b/gcc/conflict.c index 9b637737411..c832b7df52c 100644 --- a/gcc/conflict.c +++ b/gcc/conflict.c @@ -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; } diff --git a/gcc/fixinc/fixincl.c b/gcc/fixinc/fixincl.c index 2d24c17237c..5b92c3ce097 100644 --- a/gcc/fixinc/fixincl.c +++ b/gcc/fixinc/fixincl.c @@ -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, diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index 30a889ca70d..d34fde26213 100644 --- a/gcc/genattrtab.c +++ b/gcc/genattrtab.c @@ -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; diff --git a/gcc/genrecog.c b/gcc/genrecog.c index 65387123436..76f37496107 100644 --- a/gcc/genrecog.c +++ b/gcc/genrecog.c @@ -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++; diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index 1043f09e95c..c75f5ba3590 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -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++) diff --git a/gcc/hashtable.c b/gcc/hashtable.c index ea7d2b07577..41551394f8a 100644 --- a/gcc/hashtable.c +++ b/gcc/hashtable.c @@ -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, |