diff options
author | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-09 11:46:25 +0000 |
---|---|---|
committer | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-09 11:46:25 +0000 |
commit | 883554eb10ec811c13458b4153fe24da738f8e23 (patch) | |
tree | bd59306e865ec5d8977d9b28fa471840fefb7dca /gcc/lto | |
parent | b0e7825e8224e344c8b099e3c635d9854ae04ff0 (diff) | |
download | gcc-883554eb10ec811c13458b4153fe24da738f8e23.tar.gz |
gcc/
2012-10-08 Tobias Burnus <burnus@net-b.de>
* 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 <burnus@net-b.de>
* 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
Diffstat (limited to 'gcc/lto')
-rw-r--r-- | gcc/lto/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/lto/lto-lang.c | 9 | ||||
-rw-r--r-- | gcc/lto/lto-object.c | 9 |
3 files changed, 19 insertions, 5 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index d9849b47698..265922f5d13 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,9 @@ +2012-10-09 Tobias Burnus <burnus@net-b.de> + + * 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 <burnus@net-b.de> * 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 280d88359de..edfab74de0a 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 daf3bd002a3..ce24400cb10 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. */ |