diff options
author | Richard Guenther <rguenther@suse.de> | 2013-02-04 12:19:25 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2013-02-04 12:19:25 +0000 |
commit | ed73881ea9ff3c99389618defe96b814cb952135 (patch) | |
tree | 621502d44633d587a4706564dbe2902f5db4f1e5 /gcc/lto | |
parent | 139a0707cb46308598ece7785130679ea6e737a8 (diff) | |
download | gcc-ed73881ea9ff3c99389618defe96b814cb952135.zip gcc-ed73881ea9ff3c99389618defe96b814cb952135.tar.gz gcc-ed73881ea9ff3c99389618defe96b814cb952135.tar.bz2 |
re PR lto/56168 (GCC seems to disregard -fno-builtin when compiling with LTO)
2013-02-04 Richard Guenther <rguenther@suse.de>
PR lto/56168
* lto-symtab.c (lto_symtab_merge_decls_1): Make non-builtin
node prevail as last resort.
(lto_symtab_merge_decls): Remove guard on LTRANS here.
(lto_symtab_prevailing_decl): Builtins are their own prevailing
decl.
lto/
* lto.c (read_cgraph_and_symbols): Do not call lto_symtab_merge_decls
or lto_fixup_decls at LTRANS time.
* gcc.dg/lto/pr56168_0.c: New testcase.
* gcc.dg/lto/pr56168_1.c: Likewise.
From-SVN: r195709
Diffstat (limited to 'gcc/lto')
-rw-r--r-- | gcc/lto/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/lto/lto.c | 22 |
2 files changed, 20 insertions, 8 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 503ff80..2da6ae1 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,9 @@ +2013-02-04 Richard Guenther <rguenther@suse.de> + + PR lto/56168 + * lto.c (read_cgraph_and_symbols): Do not call lto_symtab_merge_decls + or lto_fixup_decls at LTRANS time. + 2013-01-09 Jan Hubicka <jh@suse.cz> PR lto/45375 diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 9583b910..6edf87a 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -3033,16 +3033,22 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames) fprintf (stderr, "Merging declarations\n"); timevar_push (TV_IPA_LTO_DECL_MERGE); - /* Merge global decls. */ - lto_symtab_merge_decls (); + /* Merge global decls. In ltrans mode we read merged cgraph, we do not + need to care about resolving symbols again, we only need to replace + duplicated declarations read from the callgraph and from function + sections. */ + if (!flag_ltrans) + { + lto_symtab_merge_decls (); - /* If there were errors during symbol merging bail out, we have no - good way to recover here. */ - if (seen_error ()) - fatal_error ("errors during merging of translation units"); + /* If there were errors during symbol merging bail out, we have no + good way to recover here. */ + if (seen_error ()) + fatal_error ("errors during merging of translation units"); - /* Fixup all decls. */ - lto_fixup_decls (all_file_decl_data); + /* Fixup all decls. */ + lto_fixup_decls (all_file_decl_data); + } htab_delete (tree_with_vars); tree_with_vars = NULL; ggc_collect (); |