aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2013-02-04 12:19:25 +0000
committerRichard Guenther <rguenther@suse.de>2013-02-04 12:19:25 +0000
commit89948f763486475bf3879e430d3ccb73f305e011 (patch)
tree621502d44633d587a4706564dbe2902f5db4f1e5 /gcc/lto
parente8bd1b24d04b4b33e2011ae05b4838c4a7298698 (diff)
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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@195709 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/ChangeLog6
-rw-r--r--gcc/lto/lto.c22
2 files changed, 20 insertions, 8 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 503ff80460b..2da6ae1d205 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 9583b9109b2..6edf87a45b0 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 ();