diff options
author | Martin Liska <mliska@suse.cz> | 2017-02-14 15:54:55 +0100 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2017-02-14 14:54:55 +0000 |
commit | da9cd044552cb68f95a0beb2995b17119bb5e962 (patch) | |
tree | a8375a1a51f9c32c616bdbb7ed1a123d6ba7cecb /gcc/tree-ssa-loop-unswitch.c | |
parent | b719f884b44f4b678025606356f25a0da277529d (diff) | |
download | gcc-da9cd044552cb68f95a0beb2995b17119bb5e962.zip gcc-da9cd044552cb68f95a0beb2995b17119bb5e962.tar.gz gcc-da9cd044552cb68f95a0beb2995b17119bb5e962.tar.bz2 |
Fix memory leak in tree-ssa-loop-unswitch.c
2017-02-14 Martin Liska <mliska@suse.cz>
* tree-ssa-loop-unswitch.c (hoist_guard): Release get_loop_body
vector. Fix trailing white spaces.
From-SVN: r245430
Diffstat (limited to 'gcc/tree-ssa-loop-unswitch.c')
-rw-r--r-- | gcc/tree-ssa-loop-unswitch.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c index 143caf7..afa04e9 100644 --- a/gcc/tree-ssa-loop-unswitch.c +++ b/gcc/tree-ssa-loop-unswitch.c @@ -820,7 +820,7 @@ hoist_guard (struct loop *loop, edge guard) /* Create new loop pre-header. */ e = split_block (pre_header, last_stmt (pre_header)); if (dump_file && (dump_flags & TDF_DETAILS)) - fprintf (dump_file, " Moving guard %i->%i (prob %i) to bb %i, " + fprintf (dump_file, " Moving guard %i->%i (prob %i) to bb %i, " "new preheader is %i\n", guard->src->index, guard->dest->index, guard->probability, e->src->index, e->dest->index); @@ -879,7 +879,7 @@ hoist_guard (struct loop *loop, edge guard) /* ... finally scale everything in the loop except for guarded basic blocks where profile does not change. */ basic_block *body = get_loop_body (loop); - + if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, " Scaling nonguarded BBs in loop:"); for (unsigned int i = 0; i < loop->num_nodes; i++) @@ -920,6 +920,8 @@ hoist_guard (struct loop *loop, edge guard) if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, "\n guard hoisted.\n"); + + free (body); } /* Return true if phi argument for exit edge can be used |