aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/lto-streamer.c8
-rw-r--r--gcc/tree-loop-distribution.c1
2 files changed, 7 insertions, 2 deletions
diff --git a/gcc/lto-streamer.c b/gcc/lto-streamer.c
index 36e6735..84db5eb 100644
--- a/gcc/lto-streamer.c
+++ b/gcc/lto-streamer.c
@@ -106,6 +106,7 @@ lto_get_section_name (int section_type, const char *name,
const char *add;
char post[32];
const char *sep;
+ char *buffer = NULL;
if (section_type == LTO_section_function_body)
{
@@ -113,7 +114,7 @@ lto_get_section_name (int section_type, const char *name,
if (name[0] == '*')
name++;
- char *buffer = (char *)xmalloc (strlen (name) + 32);
+ buffer = (char *)xmalloc (strlen (name) + 32);
sprintf (buffer, "%s.%d", name, node_order);
add = buffer;
@@ -138,7 +139,10 @@ lto_get_section_name (int section_type, const char *name,
sprintf (post, "." HOST_WIDE_INT_PRINT_HEX_PURE, f->id);
else
sprintf (post, "." HOST_WIDE_INT_PRINT_HEX_PURE, get_random_seed (false));
- return concat (section_name_prefix, sep, add, post, NULL);
+ char *res = concat (section_name_prefix, sep, add, post, NULL);
+ if (buffer)
+ free (buffer);
+ return res;
}
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index bb15fd3..7ee19fc 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -2358,6 +2358,7 @@ loop_distribution::merge_dep_scc_partitions (struct graph *rdg,
sort_partitions_by_post_order (pg, partitions);
gcc_assert (partitions->length () == (unsigned)num_sccs);
free_partition_graph_vdata (pg);
+ for_each_edge (pg, free_partition_graph_edata_cb, NULL);
free_graph (pg);
}