summaryrefslogtreecommitdiff
path: root/gcc/reg-stack.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-11-06 19:09:26 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-11-06 19:09:26 +0000
commitbfcb79b125ce8203ce800744fe9fecea1c235547 (patch)
tree87cace2499c0c4f87ac63051263d863a58b39a9e /gcc/reg-stack.c
parentcff53614c5fcdc00d829b353fba0e812c7adda22 (diff)
downloadgcc-bfcb79b125ce8203ce800744fe9fecea1c235547.tar.gz
* local-alloc.c (local_alloc): Use xmalloc/xcalloc, not alloca.
(update_equiv_regs): Likewise. (block_alloc): Likewise. * reg-stack.c (reg_to_stack): Likewise. (convert_regs_2): Likewise. * reload1.c (reload_as_needed): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30434 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reg-stack.c')
-rw-r--r--gcc/reg-stack.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c
index ec7d06997cc..98b87786745 100644
--- a/gcc/reg-stack.c
+++ b/gcc/reg-stack.c
@@ -435,8 +435,7 @@ reg_to_stack (first, file)
life_analysis (first, max_reg_num (), file, 0);
/* Set up block info for each basic block. */
- bi = (block_info) alloca ((n_basic_blocks + 1) * sizeof (*bi));
- memset (bi, 0, (n_basic_blocks + 1) * sizeof (*bi));
+ bi = (block_info) xcalloc ((n_basic_blocks + 1), sizeof (*bi));
for (i = n_basic_blocks - 1; i >= 0; --i)
BASIC_BLOCK (i)->aux = bi + i;
EXIT_BLOCK_PTR->aux = bi + n_basic_blocks;
@@ -483,7 +482,9 @@ reg_to_stack (first, file)
!JUMP_NOOP_MOVES, !JUMP_AFTER_REGSCAN);
}
+ /* Clean up. */
VARRAY_FREE (stack_regs_mentioned_data);
+ free (bi);
}
/* Check PAT, which is in INSN, for LABEL_REFs. Add INSN to the
@@ -2616,7 +2617,7 @@ convert_regs_2 (file, block)
basic_block *stack, *sp;
int inserted;
- stack = (basic_block *) alloca (sizeof (*stack) * n_basic_blocks);
+ stack = (basic_block *) xmalloc (sizeof (*stack) * n_basic_blocks);
sp = stack;
*sp++ = block;