From: burnus Date: Tue, 9 Oct 2012 11:46:25 +0000 (+0000) Subject: gcc/ X-Git-Tag: upstream/4.9.2~10079 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=883554eb10ec811c13458b4153fe24da738f8e23;p=platform%2Fupstream%2Flinaro-gcc.git gcc/ 2012-10-08 Tobias Burnus * lto-cgraph.c (input_node_opt_summary): Remove unused code. * lto-opts.c (append_to_collect_gcc_options): Fix condition. * lto-symtab.c (lto_cgraph_replace_node): Don't xstrdup string which is passed to fprintf. gcc/lto/ 2012-10-08 Tobias Burnus * lto-lang.c (lto_register_builtin_type): Avoid useless decl creation. * lto-object.c (lto_obj_file_open, lto_obj_file_open): Free memory. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192250 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9967ecf..7ad8a41 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2012-10-09 Tobias Burnus + + * lto-cgraph.c (input_node_opt_summary): Remove unused code. + * lto-opts.c (append_to_collect_gcc_options): Fix condition. + * lto-symtab.c (lto_cgraph_replace_node): Don't xstrdup string + which is passed to fprintf. + 2012-10-09 Paolo Carlini PR c++/54194 diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c index 4f952f5..b23f192 100644 --- a/gcc/lto-cgraph.c +++ b/gcc/lto-cgraph.c @@ -1517,14 +1517,9 @@ input_node_opt_summary (struct cgraph_node *node, count = streamer_read_uhwi (ib_main); for (i = 0; i < count; i++) { - int parm_num; - tree parm; struct ipa_replace_map *map = ggc_alloc_ipa_replace_map (); VEC_safe_push (ipa_replace_map_p, gc, node->clone.tree_map, map); - for (parm_num = 0, parm = DECL_ARGUMENTS (node->symbol.decl); parm_num; - parm = DECL_CHAIN (parm)) - parm_num --; map->parm_num = streamer_read_uhwi (ib_main); map->old_tree = NULL; map->new_tree = stream_read_tree (ib_main, data_in); diff --git a/gcc/lto-opts.c b/gcc/lto-opts.c index 668a5ce..a235f41 100644 --- a/gcc/lto-opts.c +++ b/gcc/lto-opts.c @@ -44,7 +44,7 @@ append_to_collect_gcc_options (struct obstack *ob, bool *first_p, const char *opt) { const char *p, *q = opt; - if (!first_p) + if (!*first_p) obstack_grow (ob, " ", 1); obstack_grow (ob, "'", 1); while ((p = strchr (q, '\''))) diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c index 25c0b22..659a68b 100644 --- a/gcc/lto-symtab.c +++ b/gcc/lto-symtab.c @@ -46,8 +46,8 @@ lto_cgraph_replace_node (struct cgraph_node *node, { fprintf (cgraph_dump_file, "Replacing cgraph node %s/%i by %s/%i" " for symbol %s\n", - xstrdup (cgraph_node_name (node)), node->uid, - xstrdup (cgraph_node_name (prevailing_node)), + cgraph_node_name (node), node->uid, + cgraph_node_name (prevailing_node), prevailing_node->uid, IDENTIFIER_POINTER ((*targetm.asm_out.mangle_assembler_name) (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->symbol.decl))))); diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index d9849b4..265922f 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,9 @@ +2012-10-09 Tobias Burnus + + * lto-lang.c (lto_register_builtin_type): Avoid useless + decl creation. + * lto-object.c (lto_obj_file_open, lto_obj_file_open): Free memory. + 2012-10-08 Tobias Burnus * lto.c (lto_wpa_write_files, read_cgraph_and_symbols): diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c index 280d883..edfab74 100644 --- a/gcc/lto/lto-lang.c +++ b/gcc/lto/lto-lang.c @@ -1079,10 +1079,13 @@ lto_register_builtin_type (tree type, const char *name) { tree decl; - decl = build_decl (UNKNOWN_LOCATION, TYPE_DECL, get_identifier (name), type); - DECL_ARTIFICIAL (decl) = 1; if (!TYPE_NAME (type)) - TYPE_NAME (type) = decl; + { + decl = build_decl (UNKNOWN_LOCATION, TYPE_DECL, + get_identifier (name), type); + DECL_ARTIFICIAL (decl) = 1; + TYPE_NAME (type) = decl; + } registered_builtin_types = tree_cons (0, type, registered_builtin_types); } diff --git a/gcc/lto/lto-object.c b/gcc/lto/lto-object.c index daf3bd0..ce24400 100644 --- a/gcc/lto/lto-object.c +++ b/gcc/lto/lto-object.c @@ -133,7 +133,10 @@ lto_obj_file_open (const char *filename, bool writable) errmsg = simple_object_attributes_merge (saved_attributes, attrs, &err); if (errmsg != NULL) - goto fail_errmsg; + { + free (attrs); + goto fail_errmsg; + } } } else @@ -155,11 +158,13 @@ lto_obj_file_open (const char *filename, bool writable) error ("%s: %s: %s", fname, errmsg, xstrerror (err)); fail: - if (lo != NULL) + if (lo->fd != -1) lto_obj_file_close ((lto_file *) lo); + free (lo); return NULL; } + /* Close FILE. If FILE was opened for writing, it is written out now. */