summaryrefslogtreecommitdiff
path: root/gcc/haifa-sched.c
diff options
context:
space:
mode:
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>1999-09-07 02:36:41 +0000
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>1999-09-07 02:36:41 +0000
commit713829e97b2cabe9369424002f6efb23a7c86aba (patch)
tree4078f3a9721ec2407abe016bdfff56e653a05da4 /gcc/haifa-sched.c
parentda7052f68ce6c63c9b86c438a016f6052f2e8613 (diff)
downloadgcc-713829e97b2cabe9369424002f6efb23a7c86aba.tar.gz
* c-aux-info.c (concat): Don't define.
* cccp.c (my_strerror): Likewise. All callers changed to use xstrerror instead. (do_include): Call xstrdup, not xmalloc/strcpy. (grow_outbuf): Don't check if xrealloc returns NULL, it can't. (xmalloc, xrealloc, xcalloc, xstrdup): Don't define. * collect2.c (my_strsignal): Likewise. All callers changed to use strsignal instead. (locatelib): Call xstrdup, not xmalloc/strcpy. * 1750a.h (ASM_OUTPUT_INTERNAL_LABEL): Call xmalloc, not malloc. * dsp16xx.c (override_options): Call xstrdup, not xmalloc/strcpy. * i370.h (ASM_DECLARE_FUNCTION_NAME): Call xmalloc, not malloc. * mips.c (build_mips16_call_stub): Call xstrdup, not xmalloc/strcpy. * cppinit.c (cpp_options_init): Call xcalloc, not xmalloc/bzero. * dwarfout.c (dwarfout_init): Call concat, not xmalloc/strcpy/... * except.c (new_eh_region_entry): Call xmalloc/xrealloc, not malloc/realloc. (find_all_handler_type_matches): Likewise. Don't check return value. (get_new_handler, init_insn_eh_region, process_nestinfo): Call xmalloc, not malloc. (init_eh_nesting_info): Likewise. Call xcalloc, not xmalloc/bzero. * gcc.c (xstrerror, xmalloc, xrealloc): Don't define. (init_spec): Call xcalloc, not xmalloc/bzero. (set_spec): Call xstrdup, not save_string. (record_temp_file): Call xstrdup, not xmalloc/strcpy. (find_a_file): Call xstrdup, not xmalloc/strcpy. (process_command): Call xstrdup, not save_string. (main): Call xcalloc, not xmalloc/bzero. * gcov.c (xmalloc): Don't define. (create_program_flow_graph): Call xcalloc, not xmalloc/bzero. (scan_for_source_files): Call xstrdup, not xmalloc/strcpy. (output_data): Call xcalloc, not xmalloc/bzero. * haifa-sched.c (schedule_insns): Call xcalloc, not xmalloc/bzero. * mips-tdump.c (xmalloc): Don't define. (print_symbol): Call xmalloc, not malloc. (read_tfile): Call xcalloc, not calloc. * mips-tfile.c (xfree, my_strsignal, xmalloc, xcalloc, xrealloc): Don't define. All callers of xfree/my_strsignal changed to use free/strsignal instead. (allocate_cluster): Call xcalloc, not calloc. * objc/objc-act.c (lang_init): Call concat, not xmalloc/strcpy/... Fix memory leak, free allocated memory. * prefix.c (translate_name): Call xstrdup, not save_string. (update_path): Likewise. * profile.c (branch_prob): Call xstrdup, not xmalloc/strcpy. * protoize.c (xstrerror, xmalloc, xrealloc, xfree, savestring2): Don't define. Callers of xfree/savestring2 changed to use free/concat instead. * reload1.c (reload): Call xcalloc, not xmalloc/bzero. (init_elim_table): Likewise. * resource.c (init_resource_info): Likewise. * stupid.c (stupid_life_analysis): Likewise. * toplev.c (xmalloc, xcalloc, xrealloc, xstrdup): Don't define. (open_dump_file): Call concat, not xmalloc/strcpy/... (clean_dump_file): Likewise. (compile_file): Call xstrdup, not xmalloc/strcpy. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29148 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/haifa-sched.c')
-rw-r--r--gcc/haifa-sched.c44
1 files changed, 13 insertions, 31 deletions
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index a4bf5c4be2a..5aa69b69e1e 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -7767,14 +7767,9 @@ schedule_insns (dump_file)
max_uid = (get_max_uid () + 1);
- cant_move = (char *) xmalloc (max_uid * sizeof (char));
- bzero ((char *) cant_move, max_uid * sizeof (char));
-
- fed_by_spec_load = (char *) xmalloc (max_uid * sizeof (char));
- bzero ((char *) fed_by_spec_load, max_uid * sizeof (char));
-
- is_load_insn = (char *) xmalloc (max_uid * sizeof (char));
- bzero ((char *) is_load_insn, max_uid * sizeof (char));
+ cant_move = xcalloc (max_uid, sizeof (char));
+ fed_by_spec_load = xcalloc (max_uid, sizeof (char));
+ is_load_insn = xcalloc (max_uid, sizeof (char));
insn_orig_block = (int *) xmalloc (max_uid * sizeof (int));
insn_luid = (int *) xmalloc (max_uid * sizeof (int));
@@ -7903,17 +7898,17 @@ schedule_insns (dump_file)
We use xmalloc instead of alloca, because max_uid can be very large
when there is a lot of function inlining. If we used alloca, we could
exceed stack limits on some hosts for some inputs. */
- insn_priority = (int *) xmalloc (max_uid * sizeof (int));
- insn_reg_weight = (int *) xmalloc (max_uid * sizeof (int));
- insn_tick = (int *) xmalloc (max_uid * sizeof (int));
- insn_costs = (short *) xmalloc (max_uid * sizeof (short));
- insn_units = (short *) xmalloc (max_uid * sizeof (short));
- insn_blockage = (unsigned int *) xmalloc (max_uid * sizeof (unsigned int));
- insn_ref_count = (int *) xmalloc (max_uid * sizeof (int));
+ insn_priority = (int *) xcalloc (max_uid, sizeof (int));
+ insn_reg_weight = (int *) xcalloc (max_uid, sizeof (int));
+ insn_tick = (int *) xcalloc (max_uid, sizeof (int));
+ insn_costs = (short *) xcalloc (max_uid, sizeof (short));
+ insn_units = (short *) xcalloc (max_uid, sizeof (short));
+ insn_blockage = (unsigned int *) xcalloc (max_uid, sizeof (unsigned int));
+ insn_ref_count = (int *) xcalloc (max_uid, sizeof (int));
/* Allocate for forward dependencies. */
- insn_dep_count = (int *) xmalloc (max_uid * sizeof (int));
- insn_depend = (rtx *) xmalloc (max_uid * sizeof (rtx));
+ insn_dep_count = (int *) xcalloc (max_uid, sizeof (int));
+ insn_depend = (rtx *) xcalloc (max_uid, sizeof (rtx));
if (reload_completed == 0)
{
@@ -7941,8 +7936,7 @@ schedule_insns (dump_file)
{
rtx line;
- line_note = (rtx *) xmalloc (max_uid * sizeof (rtx));
- bzero ((char *) line_note, max_uid * sizeof (rtx));
+ line_note = (rtx *) xcalloc (max_uid, sizeof (rtx));
line_note_head = (rtx *) alloca (n_basic_blocks * sizeof (rtx));
bzero ((char *) line_note_head, n_basic_blocks * sizeof (rtx));
@@ -7961,18 +7955,6 @@ schedule_insns (dump_file)
}
}
- bzero ((char *) insn_priority, max_uid * sizeof (int));
- bzero ((char *) insn_reg_weight, max_uid * sizeof (int));
- bzero ((char *) insn_tick, max_uid * sizeof (int));
- bzero ((char *) insn_costs, max_uid * sizeof (short));
- bzero ((char *) insn_units, max_uid * sizeof (short));
- bzero ((char *) insn_blockage, max_uid * sizeof (unsigned int));
- bzero ((char *) insn_ref_count, max_uid * sizeof (int));
-
- /* Initialize for forward dependencies. */
- bzero ((char *) insn_depend, max_uid * sizeof (rtx));
- bzero ((char *) insn_dep_count, max_uid * sizeof (int));
-
/* Find units used in this fuction, for visualization. */
if (sched_verbose)
init_target_units ();