diff options
author | Marcin Dalecki <martin@dalecki.de> | 2006-01-31 20:56:55 +0100 |
---|---|---|
committer | Marcin Dalecki <dalecki@gcc.gnu.org> | 2006-01-31 20:56:55 +0100 |
commit | 5ed6ace578e0657c0481bacd16c97ceb3deda9a4 (patch) | |
tree | 1d4ee70ba0860ea79946b28d772ea552777594d6 /gcc/loop.c | |
parent | 8f13c4d68fa3f5328f93cde8274152f8da5bd341 (diff) | |
download | gcc-5ed6ace578e0657c0481bacd16c97ceb3deda9a4.zip gcc-5ed6ace578e0657c0481bacd16c97ceb3deda9a4.tar.gz gcc-5ed6ace578e0657c0481bacd16c97ceb3deda9a4.tar.bz2 |
tree-vrp.c: Use XNEW/XCNEW allocation wrappers.
2006-01-31 Marcin Dalecki <martin@dalecki.de>
* tree-vrp.c: Use XNEW/XCNEW allocation wrappers.
* regrename.c: Ditto.
* tree-ssa-loop-im.c: Ditto.
* tree-dump.c: Ditto.
* tree-complex.c: Ditto.
* genrecog.c: Ditto.
* tree-ssa-threadupdate.c: Ditto.
* tracer.c: Ditto.
* java/class.c: Ditto.
* java/jcf-parse.c: Ditto.
* java/resource.c: Ditto.
* java/except.c: Ditto.
* java/jvspec.c: Ditto.
* java/jcf-write.c: Ditto.
* java/jcf-path.c: Ditto.
* java/gjavah.c: Ditto.
* java/zextract.c: Ditto.
* java/jcf-io.c: Ditto.
* java/jcf.h: Ditto.
* java/buffer.c: Ditto.
* java/lang.c: Ditto.
* java/parse-scan.y: Ditto.
* java/lex.c: Ditto.
* java/lex.h: Ditto.
* cfgloopmanip.c: Ditto.
* postreload-gcse.c: Ditto.
* tree-ssa-loop-manip.c: Ditto.
* postreload.c: Ditto.
* tree-ssa-loop-ch.c: Ditto.
* loop.c: Ditto.
* ipa-cp.c: Ditto.
* cppspec.c: Ditto.
* diagnostic.c: Ditto.
* final.c: Ditto.
* genoutput.c: Ditto.
* gcc.c: Ditto.
* cfghooks.c: Ditto.
* cfgloopanal.c: Ditto.
* objc/objc-act.c: Ditto.
* gcov.c: Ditto.
* genextract.c: Ditto.
* genautomata.c: Ditto.
* pretty-print.c: Ditto.
* genemit.c: Ditto.
* cgraphunit.c: Ditto.
* flow.c: Ditto.
* df-scan.c: Ditto.
* haifa-sched.c: Ditto.
* dominance.c: Ditto.
* dbxout.c: Ditto.
* tree-ssa-loop-ivopts.c: Ditto.
* df-core.c: Ditto.
* mode-switching.c: Ditto.
* modulo-sched.c: Ditto.
* graph.c: Ditto.
* ipa-pure-const.c: Ditto.
* cse.c: Ditto.
* fix-header.c: Ditto.
* web.c: Ditto.
* tree-stdarg.c: Ditto.
* ipa-utils.c: Ditto.
* loop-init.c: Ditto.
* ipa-inline.c: Ditto.
* cfganal.c: Ditto.
* global.c: Ditto.
* alloc-pool.c: Ditto.
* dwarf2out.c: Ditto.
* opts.c: Ditto.
* genattrtab.c: Ditto.
* tree-ssa-loop-ivcanon.c: Ditto.
* predict.c: Ditto.
* timevar.c: Ditto.
* lcm.c: Ditto.
* fortran/gfortranspec.c: Ditto.
* regmove.c: Ditto.
* local-alloc.c: Ditto.
* langhooks.c: Ditto.
* function.c: Ditto.
* tree-vectorizer.c: Ditto.
* gcse.c: Ditto.
* ipa-type-escape.c: Ditto.
* alias.c: Ditto.
* tree-if-conv.c: Ditto.
* profile.c: Ditto.
* ipa.c: Ditto.
* tree-data-ref.c: Ditto.
* loop-unroll.c: Ditto.
* treelang/treetree.c: Ditto.
* calls.c: Ditto.
* bt-load.c: Ditto.
* ggc-common.c: Ditto.
* except.c: Ditto.
* coverage.c: Ditto.
* cselib.c: Ditto.
* tree-cfgcleanup.c: Ditto.
* tree-ssa-pre.c: Ditto.
* cfgcleanup.c: Ditto.
* loop-invariant.c: Ditto.
* loop-iv.c: Ditto.
* ipa-prop.c: Ditto.
* print-tree.c: Ditto.
* conflict.c: Ditto.
* ggc-page.c: Ditto.
* sched-deps.c: Ditto.
* regclass.c: Ditto.
* tree-object-size.c: Ditto.
* combine.c: Ditto.
* bb-reorder.c: Ditto.
* resource.c: Ditto.
* var-tracking.c: Ditto.
* cfgloop.c: Ditto.
* df-problems.c: Ditto.
* reg-stack.c: Ditto.
* tlink.c: Ditto.
* gccspec.c: Ditto.
* sched-rgn.c: Ditto.
* tree-ssa-structalias.c: Ditto.
* tree-ssa-reassoc.c: Ditto.
* config/darwin-c.c: Ditto.
* config/darwin.c: Ditto.
* config/arm/arm.c: Ditto.
* cfgrtl.c: Ditto.
* collect2.c: Ditto.
* reload1.c: Ditto.
From-SVN: r110446
Diffstat (limited to 'gcc/loop.c')
-rw-r--r-- | gcc/loop.c | 39 |
1 files changed, 19 insertions, 20 deletions
@@ -841,18 +841,18 @@ loop_optimize (rtx f, FILE *dumpfile, int flags) Leave some space for labels allocated by find_and_verify_loops. */ max_uid_for_loop = get_max_uid () + 1 + max_loop_num * 32; - uid_luid = xcalloc (max_uid_for_loop, sizeof (int)); - uid_loop = xcalloc (max_uid_for_loop, sizeof (struct loop *)); + uid_luid = XCNEWVEC (int, max_uid_for_loop); + uid_loop = XCNEWVEC (struct loop *, max_uid_for_loop); /* Allocate storage for array of loops. */ - loops->array = xcalloc (loops->num, sizeof (struct loop)); + loops->array = XCNEWVEC (struct loop, loops->num); /* Find and process each loop. First, find them, and record them in order of their beginnings. */ find_and_verify_loops (f, loops); /* Allocate and initialize auxiliary loop information. */ - loops_info = xcalloc (loops->num, sizeof (struct loop_info)); + loops_info = XCNEWVEC (struct loop_info, loops->num); for (i = 0; i < (int) loops->num; i++) loops->array[i].aux = loops_info + i; @@ -1328,7 +1328,7 @@ scan_loop (struct loop *loop, int flags) continue; } - m = xmalloc (sizeof (struct movable)); + m = XNEW (struct movable); m->next = 0; m->insn = p; m->set_src = src; @@ -1416,7 +1416,7 @@ scan_loop (struct loop *loop, int flags) if (regs->array[regno].set_in_loop == 2) { struct movable *m; - m = xmalloc (sizeof (struct movable)); + m = XNEW (struct movable); m->next = 0; m->insn = p; m->set_dest = SET_DEST (set); @@ -1853,7 +1853,7 @@ static void combine_movables (struct loop_movables *movables, struct loop_regs *regs) { struct movable *m; - char *matched_regs = xmalloc (regs->num); + char *matched_regs = XNEWVEC (char, regs->num); enum machine_mode mode; /* Regs that are set more than once are not allowed to match @@ -2188,8 +2188,8 @@ move_movables (struct loop *loop, struct loop_movables *movables, /* Map of pseudo-register replacements to handle combining when we move several insns that load the same value into different pseudo-registers. */ - rtx *reg_map = xcalloc (nregs, sizeof (rtx)); - char *already_moved = xcalloc (nregs, sizeof (char)); + rtx *reg_map = XCNEWVEC (rtx, nregs); + char *already_moved = XCNEWVEC (char, nregs); for (m = movables->head; m; m = m->next) { @@ -2537,8 +2537,7 @@ move_movables (struct loop *loop, struct loop_movables *movables, } else if (m->insert_temp) { - rtx *reg_map2 = xcalloc (REGNO (newreg), - sizeof(rtx)); + rtx *reg_map2 = XCNEWVEC (rtx, REGNO(newreg)); reg_map2 [m->regno] = newreg; i1 = loop_insn_hoist (loop, copy_rtx (PATTERN (p))); @@ -6382,7 +6381,7 @@ strength_reduce (struct loop *loop, int flags) addr_placeholder = gen_reg_rtx (Pmode); ivs->n_regs = max_reg_before_loop; - ivs->regs = xcalloc (ivs->n_regs, sizeof (struct iv)); + ivs->regs = XCNEWVEC (struct iv, ivs->n_regs); /* Find all BIVs in loop. */ loop_bivs_find (loop); @@ -6431,7 +6430,7 @@ strength_reduce (struct loop *loop, int flags) Some givs might have been made from biv increments, so look at ivs->reg_iv_type for a suitable size. */ reg_map_size = ivs->n_regs; - reg_map = xcalloc (reg_map_size, sizeof (rtx)); + reg_map = XCNEWVEC (rtx, reg_map_size); /* Examine each iv class for feasibility of strength reduction/induction variable elimination. */ @@ -6649,7 +6648,7 @@ check_insn_for_bivs (struct loop *loop, rtx p, int not_every_iteration, /* It is a possible basic induction variable. Create and initialize an induction structure for it. */ - struct induction *v = xmalloc (sizeof (struct induction)); + struct induction *v = XNEW (struct induction); record_biv (loop, v, p, dest_reg, inc_val, mult_val, location, not_every_iteration, maybe_multiple); @@ -6712,7 +6711,7 @@ check_insn_for_givs (struct loop *loop, rtx p, int not_every_iteration, &add_val, &mult_val, &ext_val, &last_consec_insn)))) { - struct induction *v = xmalloc (sizeof (struct induction)); + struct induction *v = XNEW (struct induction); /* If this is a library call, increase benefit. */ if (find_reg_note (p, REG_RETVAL, NULL_RTX)) @@ -6828,7 +6827,7 @@ find_mem_givs (const struct loop *loop, rtx x, rtx insn, GET_MODE (x))) { /* Found one; record it. */ - struct induction *v = xmalloc (sizeof (struct induction)); + struct induction *v = XNEW (struct induction); record_giv (loop, v, insn, src_reg, addr_placeholder, mult_val, add_val, ext_val, benefit, DEST_ADDR, @@ -6901,7 +6900,7 @@ record_biv (struct loop *loop, struct induction *v, rtx insn, rtx dest_reg, { /* Create and initialize new iv_class. */ - bl = xmalloc (sizeof (struct iv_class)); + bl = XNEW (struct iv_class); bl->regno = REGNO (dest_reg); bl->biv = 0; @@ -9024,8 +9023,8 @@ combine_givs (struct loop_regs *regs, struct iv_class *bl) if (!g1->ignore) giv_array[i++] = g1; - stats = xcalloc (giv_count, sizeof (*stats)); - can_combine = xcalloc (giv_count, giv_count * sizeof (rtx)); + stats = XCNEWVEC (struct combine_givs_stats, giv_count); + can_combine = XCNEWVEC (rtx, giv_count * giv_count); for (i = 0; i < giv_count; i++) { @@ -10617,7 +10616,7 @@ loop_regs_scan (const struct loop *loop, int extra_size) regs->array[i].single_usage = NULL_RTX; } - last_set = xcalloc (regs->num, sizeof (rtx)); + last_set = XCNEWVEC (rtx, regs->num); /* Scan the loop, recording register usage. */ for (insn = loop->top ? loop->top : loop->start; insn != loop->end; |