summaryrefslogtreecommitdiff
path: root/gcc/ifcvt.c
diff options
context:
space:
mode:
authorzadeck <zadeck@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-30 19:31:42 +0000
committerzadeck <zadeck@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-30 19:31:42 +0000
commitdf6632c5546ec80e943d8041949facc8f32f7a3e (patch)
tree51966707b68782094d933d2a1c44aa2519b1bc11 /gcc/ifcvt.c
parentce29975928c8a054d094c42fd4b8d1e26ac4cf0f (diff)
downloadgcc-df6632c5546ec80e943d8041949facc8f32f7a3e.tar.gz
2008-06-30 Kenneth Zadeck <zadeck@naturalbridge.com>
* ifcvt.c (cond_move_process_if_block): Free vectors on false return. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@137285 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ifcvt.c')
-rw-r--r--gcc/ifcvt.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index e1601b1eacb..da8afde3106 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -2614,7 +2614,11 @@ cond_move_process_if_block (struct noce_if_info *if_info)
/* Make sure the blocks are suitable. */
if (!check_cond_move_block (then_bb, then_vals, then_regs, cond)
|| (else_bb && !check_cond_move_block (else_bb, else_vals, else_regs, cond)))
- return FALSE;
+ {
+ VEC_free (int, heap, then_regs);
+ VEC_free (int, heap, else_regs);
+ return FALSE;
+ }
/* Make sure the blocks can be used together. If the same register
is set in both blocks, and is not set to a constant in both
@@ -2635,7 +2639,11 @@ cond_move_process_if_block (struct noce_if_info *if_info)
if (!CONSTANT_P (then_vals[reg])
&& !CONSTANT_P (else_vals[reg])
&& !rtx_equal_p (then_vals[reg], else_vals[reg]))
- return FALSE;
+ {
+ VEC_free (int, heap, then_regs);
+ VEC_free (int, heap, else_regs);
+ return FALSE;
+ }
}
}
@@ -2649,7 +2657,11 @@ cond_move_process_if_block (struct noce_if_info *if_info)
branches, since if we convert we are going to always execute
them. */
if (c > MAX_CONDITIONAL_EXECUTE)
- return FALSE;
+ {
+ VEC_free (int, heap, then_regs);
+ VEC_free (int, heap, else_regs);
+ return FALSE;
+ }
/* Try to emit the conditional moves. First do the then block,
then do anything left in the else blocks. */
@@ -2661,11 +2673,17 @@ cond_move_process_if_block (struct noce_if_info *if_info)
then_vals, else_vals, true)))
{
end_sequence ();
+ VEC_free (int, heap, then_regs);
+ VEC_free (int, heap, else_regs);
return FALSE;
}
seq = end_ifcvt_sequence (if_info);
if (!seq)
- return FALSE;
+ {
+ VEC_free (int, heap, then_regs);
+ VEC_free (int, heap, else_regs);
+ return FALSE;
+ }
loc_insn = first_active_insn (then_bb);
if (!loc_insn)
@@ -2698,7 +2716,6 @@ cond_move_process_if_block (struct noce_if_info *if_info)
VEC_free (int, heap, then_regs);
VEC_free (int, heap, else_regs);
-
return TRUE;
}