PR ipa/59469
[official-gcc.git] / gcc / lto / ChangeLog
blobdb7b030e5ab54a120b89bdc886fb5af21224ca2c
1 2014-02-06  Jan Hubicka  <hubicka@ucw.cz>
3         PR ipa/59469
4         * lto-partition.c (symbol_class): Move to cgraph.h
5         (get_symbol_class): Move to symtab.c
6         (add_references_to_partition, add_symbol_to_partition_1,
7         lto_max_map, lto_1_to_1_map, lto_balanced_map,
8         lto_promote_cross_file_statics): Update.
10 2014-02-05  Jan Hubicka  <hubicka@ucw.cz>
12         * lto.c (lto_parallelism): New static var.
13         (do_stream_out, wait_for_child, stream_out): New static functions.
14         (lto_wpa_write_files): Add support for parallel streaming.
15         (do_whole_program_analysis): Set parallelism.
16         * lang.opt (fwpa): Add parameter.
17         * lto-lang.c (lto_handle_option): Handle flag_wpa.
18         (lto_init): Update use of flag_wpa.
19         * lto-streamer.h (asm_nodes_output): Declare.
21 2014-02-05  Richard Biener  <rguenther@suse.de>
23         * lto.h (lto_global_var_decls): Remove.
24         * lto-lang.c (lto_init): Do not allocate lto_global_var_decls.
25         (lto_write_globals): Do nothing in WPA stage, gather globals from
26         the varpool here ...
27         * lto.c (lto_main): ... not here.
28         (materialize_cgraph): Do not call rest_of_decl_compilation
29         on the empty lto_global_var_decls vector.
30         (lto_global_var_decls): Remove.
32 2014-02-04  Jan Hubicka  <hubicka@ucw.cz>
34         * lto-partition.c (get_symbol_class): Only unforced DECL_ONE_ONLY 
35         needs duplicating, not generic COMDAT.
37 2014-02-04  Richard Biener  <rguenther@suse.de>
39         PR lto/59723
40         * lto.c (mentions_vars_p): Handle NAMELIST_DECL.
41         (lto_fixup_prevailing_decls): Handle fixing up CONSTRUCTOR values.
43 2014-02-04  Jan Hubicka  <hubicka@ucw.cz>
44             Markus Trippelsdorf
46         PR ipa/59469
47         * lto-symtab.c (lto_cgraph_replace_node, lto_varpool_replace_node):
48         merge force_output and forced_by_abi flags.
50 2014-01-24  Balaji V. Iyer  <balaji.v.iyer@intel.com>
52         * lto-lang.c (lto_init): Replaced flag_enable_cilkplus with
53         flag_cilkplus.
55 2014-01-09  Richard Biener  <rguenther@suse.de>
57         * lto.c (gimple_canonical_types_compatible_p): Fix comment.
59 2014-01-09  Richard Biener  <rguenther@suse.de>
61         PR lto/45586
62         * lto.c (hash_canonical_type): Do not hash TREE_ADDRESSABLE,
63         TYPE_ALIGN, TYPE_RESTRICT or TYPE_REF_CAN_ALIAS_ALL.
64         (gimple_canonical_types_compatible_p): Do not compare them either.
66 2014-01-02  Richard Sandiford  <rdsandiford@googlemail.com>
68         Update copyright years
70 2013-12-06  Oleg Endo  <olegendo@gcc.gnu.org>
72         * lto.c: Remove struct tags when referring to class varpool_node.
73         * lto-partition.c: Likewise.
74         * lto-symtab.c: Likewise.
76 2013-11-29  Jakub Jelinek  <jakub@redhat.com>
77             Richard Biener  <rguenther@suse.de>
79         PR lto/59326
80         * lto.c (compare_tree_sccs_1): Handle OMP_CLAUSE.
82 2013-11-29  Jakub Jelinek  <jakub@redhat.com>
84         PR lto/59326
85         * lto.c (mentions_vars_p_omp_clause): New function.
86         (mentions_vars_p): Call it for OMP_CLAUSE.  Remove break;
87         after return stmts.
89 2013-11-22  Andrew MacLeod  <amacleod@redhat.com>
91         * lto.c: Add required include files from gimple.h.
92         * lto-lang.c: Likewise
93         * lto-object.c: Likewise
94         * lto-partition.c: Likewise
95         * lto-symtab.c: Likewise
97 2013-11-18  Trevor Saunders  <tsaunders@mozilla.com>
99         * lto-partition.c lto-symtab.c lto.c Adjust.
101 2013-11-14  Diego Novillo  <dnovillo@google.com>
103         * lto-lang.c: Include stringpool.h.
104         Include stor-layout.h.
105         * lto-partition.c: Include gcc-symtab.h.
106         * lto.c: Include stor-layout.h.
108 2013-10-31  David Malcolm  <dmalcolm@redhat.com>
110         Automated part of renaming of symtab_node_base to symtab_node.
112         Patch autogenerated by rename_symtab.py from
113         https://github.com/davidmalcolm/gcc-refactoring-scripts
114         revision 58bb219cc090b2f4516a9297d868c245495ee622
116         * lto-partition.c (add_symbol_to_partition): Rename
117         symtab_node_base to symtab_node.
118         (get_symbol_class): Likewise.
119         (symbol_partitioned_p): Likewise.
120         (add_references_to_partition): Likewise.
121         (add_symbol_to_partition_1): Likewise.
122         (contained_in_symbol): Likewise.
123         (add_symbol_to_partition): Likewise.
124         (lto_1_to_1_map): Likewise.
125         (lto_max_map): Likewise.
126         (lto_balanced_map): Likewise.
127         (privatize_symbol_name): Likewise.
128         (promote_symbol): Likewise.
129         (may_need_named_section_p): Likewise.
130         (rename_statics): Likewise.
131         (lto_promote_statics_nonwpa): Likewise.
132         * lto-symtab.c (lto_symtab_merge): Likewise.
133         (lto_symtab_resolve_replaceable_p): Likewise.
134         (lto_symtab_symbol_p): Likewise.
135         (lto_symtab_resolve_can_prevail_p): Likewise.
136         (lto_symtab_resolve_symbols): Likewise.
137         (lto_symtab_merge_decls_2): Likewise.
138         (lto_symtab_merge_decls_1): Likewise.
139         (lto_symtab_merge_decls): Likewise.
140         (lto_symtab_merge_symbols_1): Likewise.
141         (lto_symtab_merge_symbols): Likewise.
142         (lto_symtab_prevailing_decl): Likewise.
143         * lto.c (lto_wpa_write_files): Likewise.
144         (read_cgraph_and_symbols): Likewise.
145         (do_whole_program_analysis): Likewise.
147 2013-10-30  David Malcolm  <dmalcolm@redhat.com>
149         * lto-symtab.c (lto_symtab_merge_decls_2): Split symtab_node
150         declarations onto multiple lines to make things easier for
151         rename_symtab.py.
152         (lto_symtab_merge_decls_1): Likewise.
153         (lto_symtab_merge_symbols_1): Likewise.
155 2013-10-29  Balaji V. Iyer  <balaji.v.iyer@intel.com>
157         * Make-lang.in (lto/lto-lang.o): Added cilk.h in dependency list.
158         * lto-lang.c (lto_init): Added a call to cilk_init_builtins if Cilk
159         Plus is enabled.
161 2013-10-29  David Malcolm  <dmalcolm@redhat.com>
163         Patch autogenerated by refactor_symtab.py from
164         https://github.com/davidmalcolm/gcc-refactoring-scripts
165         revision 58bb219cc090b2f4516a9297d868c245495ee622
167         * lto-partition.c (lto_promote_cross_file_statics): Update for
168         conversion of symtab types to a true class hierarchy.
169         (rename_statics): Likewise.
170         (promote_symbol): Likewise.
171         (privatize_symbol_name): Likewise.
172         (lto_balanced_map): Likewise.
173         (varpool_node_cmp): Likewise.
174         (node_cmp): Likewise.
175         (lto_1_to_1_map): Likewise.
176         (undo_partition): Likewise.
177         (add_symbol_to_partition): Likewise.
178         (contained_in_symbol): Likewise.
179         (add_symbol_to_partition_1): Likewise.
180         (add_references_to_partition): Likewise.
181         (symbol_partitioned_p): Likewise.
182         (get_symbol_class): Likewise.
183         (lto_max_map): Likewise.
184         * lto-symtab.c (lto_symtab_prevailing_decl): Likewise.
185         (lto_symtab_merge_symbols): Likewise.
186         (lto_symtab_merge_symbols_1): Likewise.
187         (lto_symtab_merge_decls): Likewise.
188         (lto_symtab_merge_decls_1): Likewise.
189         (lto_symtab_merge_decls_2): Likewise.
190         (lto_symtab_resolve_symbols): Likewise.
191         (lto_symtab_resolve_can_prevail_p): Likewise.
192         (lto_symtab_symbol_p): Likewise.
193         (lto_symtab_resolve_replaceable_p): Likewise.
194         (lto_symtab_merge): Likewise.
195         (lto_varpool_replace_node): Likewise.
196         (lto_cgraph_replace_node): Likewise.
197         * lto.c (lto_main): Likewise.
198         (do_whole_program_analysis): Likewise.
199         (materialize_cgraph): Likewise.
200         (read_cgraph_and_symbols): Likewise.
201         (cmp_partitions_order): Likewise.
202         (lto_materialize_function): Likewise.
203         (has_analyzed_clone_p): Likewise.
205 2013-10-29  Andrew MacLeod  <amacleod@redhat.com>
207         * lto/lto-object.c: Add gimple.h to include list.
208         * lto/lto-partition.c: Likewise.
210 2013-10-18  Andrew MacLeod  <amacleod@redhat.com>
212         * lto.c: Remove tree-flow.h from include list.
214 2013-10-15  Richard Biener  <rguenther@suse.de>
216         * lto.c (hash_canonical_type): Split out from ...
217         (iterative_hash_canonical_type): ... here.  Register types
218         we recurse to.
219         (gimple_canonical_type_hash): Adjust.
220         (gimple_register_canonical_type_1): Split out from ...
221         (gimple_register_canonical_type): ... here.  Cache computed
222         hash value.
223         (lto_register_canonical_types): Split into two modes,
224         clearing and computing TYPE_CANONICAL.
225         (lto_read_decls): Adjust.
226         (read_cgraph_and_symbols): Do two passes over global trees,
227         first clearing then computing TYPE_CANONICAL.
229 2013-10-14  Richard Biener  <rguenther@suse.de>
231         * lto.c (gimple_canonical_types): Move out-of GC space.
232         (canonical_type_hash_cache): Make a pointer-map.
233         (num_canonical_type_hash_entries, num_canonical_type_hash_queries):
234         New counters.
235         (iterative_hash_canonical_type): Adjust.
236         (read_cgraph_and_symbols): Likewise.
237         (print_lto_report_1): Likewise.
239 2013-10-14  Richard Biener  <rguenther@suse.de>
241         * lto.c (gimple_types, type_hash_cache, struct type_pair_d,
242         type_pair_cache, lookup_type_pair, struct sccs, next_dfs_num,
243         gtc_next_dfs_num, compare_type_names_p, gtc_visit,
244         gimple_types_compatible_p_1, gimple_types_compatible_p,
245         visit, iterative_hash_name, struct type_hash_pair,
246         type_hash_pair_compare, iterative_hash_gimple_type, gimple_type_hash,
247         gimple_type_eq, gimple_register_type, num_not_merged_types,
248         num_not_merged_types_in_same_scc, num_not_merged_types_trees,
249         num_not_merged_types_in_same_scc_trees): Remove old merging code
250         and statistics.
251         (lto_read_decls): Do not run old merging code in parallel.
252         (read_cgraph_and_symbols): Do not init/free old merging
253         data structures.
254         (print_lto_report_1): Do not report differences of old vs. new
255         merging code.
257 2013-10-14  Richard Biener  <rguenther@suse.de>
259         * lto-lang.c (lto_init): Do not re-init canonical types here.
260         (lto_register_canonical_types): Move to ...
261         * lto.c (lto_register_canonical_types): ... here.
262         (gimple_canonical_types, canonical_type_hash_cache,
263         iterative_hash_canonical_type, gimple_canonical_type_hash,
264         gimple_canonical_types_compatible_p, gimple_canonical_type_eq,
265         gimple_register_canonical_type): Add canonical type merging machinery
266         moved from gimple.c.
267         (read_cgraph_and_symbols): Init and free canonical type tables
268         here.
269         (print_lto_report_1): Report canonical type table stats here.
271 2013-10-11  Jakub Jelinek  <jakub@redhat.com>
273         * lto-lang.c (DEF_FUNCTION_TYPE_8): Define.
275 2013-09-25  Tom Tromey  <tromey@redhat.com>
277         * Make-lang.in (LTO_H, LINKER_PLUGIN_API_H, LTO_TREE_H)
278         (lto/lto-lang.o, lto/lto.o, lto/lto-partition.o)
279         (lto/lto-object.o): Remove.
281 2013-09-06  Richard Biener  <rguenther@suse.de>
283         * lto-symtab.c: Move from gcc/
284         * lto.h: Include vec.h.
285         (lto_global_var_decls): Declare.
286         * lto.c (lto_global_var_decls): Move definition here.
287         * Make-lang.in (LTO_OBJS): Add lto-symtab.o.
288         (lto-symtab.o): Add.
289         * config-lang.in (gtfiles): Add lto.h.
291 2013-08-31  Jan Hubicka  <jh@suse.cz>
293         * lto.c (mentions_vars_p_field_decl, lto_fixup_prevailing_decls): 
294         DECL_FIELD_OFFSET can contain an reference to variable.
296 2013-08-31  Jan Hubicka  <jh@suse.cz>
298         * lto.c (tree_with_vars): Turn into vector.
299         (MAYBE_REMEMBER_WITH_VARS): Change to...
300         (CHECK_VAR): ... this one.
301         (CHECK_NO_VAR): New macro.
302         (maybe_remember_with_vars_typed): Turn to ...
303         (mentions_vars_p_typed): ... this one.
304         (maybe_remember_with_vars_common): Turn to ...
305         (mentions_vars_p_comon): ... this one.
306         (maybe_remember_with_vars_decl_minimal): Turn to ...
307         (mentions_vars_p_decl_minmal): ... this one.
308         (maybe_remember_with_vars_decl_common): Turn to ...
309         (mentions_vars_p_decl_common): ... this one.
310         (maybe_remember_with_vars_decl_with_vis): Turn to ...
311         (mentions_vars_p_decl_with_vis): ... this one.
312         (maybe_remember_with_vars_decl_non_common): Turn to ...
313         (mentions_vars_p_decl_non_common): ... this one.
314         (maybe_remember_with_vars_function): Turn to ...
315         (mentions_vars_p_function): ... this one.
316         (maybe_remember_with_vars_field_decl): Turn to ...
317         (mentions_vars_p_field_decl): ... this one.
318         (maybe_remember_with_vars_type): Turn to ...
319         (mentions_vars_p_type): ... this one.
320         (maybe_remember_with_vars_binfo): Turn to ...
321         (mentions_vars_p_binfo): ... this one.
322         (maybe_remember_with_vars_constructor): Turn to ...
323         (mentions_vars_p_constructor): ... this one.
324         (maybe_remember_with_vars_expr): Turn to ...
325         (mentions_vars_p_expr): ... this one.
326         (maybe_remember_with_vars): Turn to ...
327         (mentions_vars_p): ... this one.
328         (lto_read_decls): Update.
329         (LTO_SET_PREVAIL): Do not call function for internal decls.
330         (lto_fixup_prevailing_decls): Update to match mentions_vars_p;
331         check that something was updated.
332         (lto_fixup_state): Do not care about internal decls.
333         (lto_fixup_decls): Update.
334         (read_cgraph_and_symbols): Update.
336 2013-08-29  Jan Hubicka  <jh@suse.cz>
338         * lto.c (read_cgraph_and_symbols): Free decl states.
340 2013-08-29  Jan Hubicka  <jh@suse.cz>
342         * lto.c (compare_tree_sccs_1): Compare  DECL_FINAL_P,
343         DECL_CXX_CONSTRUCTOR_P, DECL_CXX_DESTRUCTOR_P and
344         TYPE_FINAL_P.
346 2013-08-28  Jan Hubicka  <jh@suse.cz>
348         * lto.c (compare_tree_sccs_1): Drop DECL_ERROR_ISSUED,
349         DECL_DEFER_OUTPUT and DECL_IN_TEXT_SECTION.
350         (unify_scc): Do checking assert.
352 2013-08-06  Jan Hubicka  <jh@suse.cz>
353             Martin Liska  <marxin.liska@gmail.com>
355         * lto-partition.c (lto_balanced_map): Always base order on 
356         source file order.
358 2013-08-06  Jan Hubicka  <jh@suse.cz>
360         * lto.c (lto_materialize_function): Do not read body anymore.
362 2013-08-02  Jan Hubicka  <jh@suse.cz>
364         * lto.c (lto_materialize_function): Do not push struct function.
365         * lto-partition.c (get_symbol_class): Handle abstracts correctly.
366         (may_need_named_section_p): Even abstract origins may need
367         named section.
369 2013-07-30  David Malcolm  <dmalcolm@redhat.com>
371         * Make-lang.in (lto/lto.o:): Depend on CONTEXT_H and
372         PASS_MANAGER_H.
374         * lto.c (do_whole_program_analysis): Update for move of
375         all_regular_ipa_passes from a global to a field of class
376         pass_manager.
378 2013-07-21   Ondřej Bílka  <neleai@seznam.cz>
380         * lto-partition.c: Fix typos.
382 2013-06-20  Jan Hubicka  <jh@suse.cz>
384         * lto-partition.c (lto_balanced_map): Fix -fno-toplevel-reorder
385         partitioning of variables.
387 2013-06-20  Jan Hubicka  <jh@suse.cz>
389         * lto.c (read_cgraph_and_symbols): Set cgraph state.
391 2013-06-19  Jan Hubicka  <jh@suse.cz>
393         * lto-partition.c (add_references_to_partition): Use
394         ctor_for_folding.
396 2013-06-18  Richard Biener  <rguenther@suse.de>
398         * lto.c (lto_register_var_decl_in_symtab): Pass in cache index
399         and use it.
400         (lto_register_function_decl_in_symtab): Likewise.
401         (cmp_tree): New function.
402         (unify_scc): Instead of using the streamer cache map from entry
403         to cache index match up the two maps we have by sorting them.
404         Adjust calls to lto_register_var_decl_in_symtab and
405         lto_register_function_decl_in_symtab.
407 2013-06-17  Richard Biener  <rguenther@suse.de>
409         * Make-lang.in (lto.o): Add $(DATA_STREAMER_H) dependency.
410         * lto.c: Include data-streamer.h.
411         (lto_read_in_decl_state): Use streamer_tree_cache_get_tree.
412         (gimple_type_leader_entry_s, gimple_type_leader,
413         gimple_lookup_type_leader): Remove.
414         (gtc_visit): Simplify.
415         (gimple_types_compatible_p): Likewise.
416         (gimple_register_type_1): Likewise.  Merge into ...
417         (gimple_register_type): ... this.  Keep it as legacy for
418         statistics purposes for now.
419         (fixup_integer_cst): Remove.
420         (LTO_FIXUP_TREE, lto_fixup_types, lto_ft_*): Simplify and
421         rename to ...
422         (MAYBE_REMEMBER_WITH_VARS, maybe_remember_with_vars,
423         maybe_remember_with_vars_*): ... these.
424         (uniquify_nodes): Remove.
425         (lto_fixup_prevailing_type): New function.
426         (struct tree_scc, struct tree_scc_hasher): New type and hasher.
427         (tree_scc_hash, tree_scc_hash_obstack): New globals.
428         (num_merged_types, num_prevailing_types, num_not_merged_types,
429         num_not_merged_types_in_same_scc, total_scc_size, num_sccs_read,
430         total_scc_size_merged, num_sccs_merged, num_scc_compares,
431         num_scc_compare_collisions): New global counters.
432         (compare_tree_sccs_1): New function.
433         (compare_tree_sccs): Likewise.
434         (unify_scc): Likewise.
435         (lto_read_decls): Stream in tree SCCs and unify them on the
436         way in.  Finalize prevailing SCC tree members.
437         (read_cgraph_and_symbols): Do not initialize or free gimple_type_leader.
438         Allocate and free tree_scc_hash_obstack and tree_scc_hash, do not bother
439         to ggc-collect during merging.
440         (print_lto_report_1): Adjust for new merging code.
442 2013-06-12  Jan Hubicka  <jh@suse.cz>
444         * lto.c (read_cgraph_and_symbols): Set cgraph into streaming state.
446 2013-06-12  Jan Hubicka  <jh@suse.cz>
448         * lto.c (register_resolution): Take lto_file_data argument.
449         (lto_register_var_decl_in_symtab,
450         lto_register_function_decl_in_symtab): Update.
451         (read_cgraph_and_symbols): Update resolution_map handling.
453 2013-06-11  Jan Hubicka  <jh@suse.cz>
455         * lto-partition.c (get_symbol_class): Simplify weakref handling.
456         (add_symbol_to_partition_1): Likewise.
457         (contained_in_symbol): Likewise.
458         (lto_balanced_map): Likewise.
459         (rename_statics): Drop weakref.
461 2013-06-05  Richard Biener  <rguenther@suse.de>
463         * lto.c (num_merged_types): New global variable.
464         (uniquify_nodes): Increase num_merged_types when merging a type.
465         (print_lto_report_1): Output the number of merged types.
467 2013-06-01  Jan Hubicka  <jh@suse.cz>
469         * lto.c (read_cgraph_and_symbols): Simplify dumping; Replace
470         lto_symtab_merge_cgraph_nodes by lto_symtab_merge_symbols.
471         (do_whole_program_analysis): Update dumping.
473 2013-05-29  Jan Hubicka  <jh@suse.cz>
475         * lto.c (has_analyzed_clone_p, lto_materialize_function): Update for new symtab
476         flags.
477         * lto-partition.c (get_symbol_class, lto_balanced_map): Likewise.
479 2013-05-15  Jan Hubicka  <jh@suse.cz>
481         * lto-partition.c (privatize_symbol_name): Return true when
482         privatizing happened.
483         (rename_statics): Do not go into infinite loop when privatizing
484         is not needed.
486 2013-05-16  Jason Merrill  <jason@redhat.com>
488         * Make-lang.in ($(LTO_EXE)): Use link mutex.
490 2013-05-15  Martin Jambor  <mjambor@suse.cz>
492         * lto-partition.c (lto_balanced_map): Print symbol order instead
493         of node uids.
495 2013-05-15  Jan Hubicka  <jh@suse.cz>
497         PR lto/57038
498         PR lto/47375
499         * lto-partition.c (get_symbol_class): Fix weakrefs.
500         (lto_balanced_map): Fix weakrefs.
501         (privatize_symbol_name): Remove unnecesary label.
502         (rename_statics): Handle weakrefs as statics.
504 2013-05-09  Jan Hubicka  <jh@suse.cz>
505             Richard Biener  <rguenther@suse.de>
507         * lto.c (lto_register_var_decl_in_symtab): Don't do renaming.
508         (lto_register_var_decl_in_symtab): Likewise.
509         (lto_main): Promote statics.
510         * lto-partition.c (privatize_symbol_name): New function.
511         (promote_symbol): Use it.
512         (may_need_named_section_p): New predicate.
513         (rename_statics): New functions.
514         (lto_promote_cross_file_statics): Simplify; do renaming.
515         (lto_promote_statics_nonwpa): New function.
516         * lto-partition.h (lto_promote_statics_nonwpa): New function.
518 2013-02-08  Richard Biener  <rguenther@suse.de>
520         PR lto/56231
521         * lto-lang.c (lto_init): Do not enter a dummy file.
523 2013-02-07  Uros Bizjak  <ubizjak@gmail.com>
525         PR bootstrap/56227
526         * lto.c (lto_resolution_ready): Use %wx instead of
527         HOST_WIDE_INT_PRINT_HEX_PURE in the argument to internal_error.
529 2013-02-04  Richard Guenther  <rguenther@suse.de>
531         PR lto/56168
532         * lto.c (read_cgraph_and_symbols): Do not call lto_symtab_merge_decls
533         or lto_fixup_decls at LTRANS time.
535 2013-01-09  Jan Hubicka  <jh@suse.cz>
537         PR lto/45375
538         * lto.c (do_whole_program_analysis): Remove unreachable nodes after IPA.
540 2012-12-10  H.J. Lu  <hongjiu.lu@intel.com>
542         PR lto/55466
543         * lto.c (lto_register_var_decl_in_symtab): Don't record static
544         variables.
545         (lto_main): Record the global variables if WPA isn't enabled.
547 2012-11-20  Diego Novillo  <dnovillo@google.com>
548             Jakub Jelinek  <jakub@redhat.com>
550         * lto.c: Replace all vec<T, A>() initializers with vNULL.
552 2012-11-16  Diego Novillo  <dnovillo@google.com>
554         Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)
556         * lto-lang.c: Use new vec API in vec.h.
557         * lto-partition.c: Likewise.
558         * lto-partition.h: Likewise.
559         * lto.c: Likewise.
561 2012-10-31  Lawrence Crowl  <crowl@google.com>
563         * lto.c (lto_wpa_write_files): Change symtab checking to a checked
564         down-cast via dyn_cast.
565         * lto-partition.c (add_symbol_to_partition_1): Likewise.
566         (undo_partition): Likewise.
567         (lto_balanced_map): Likewise.
568         (get_symbol_class): Likewise and via is_a.
569         (lto_balanced_map): Change symtab checking to is_a.
571 2012-10-12  Richard Biener  <rguenther@suse.de>
573         PR lto/54898
574         * lto.c (gimple_types_compatible_p_1): Also compare
575         TYPE_MAIN_VARIANT.
576         (iterative_hash_gimple_type): Also hash TYPE_MAIN_VARIANT.
578 2012-10-09  Tobias Burnus  <burnus@net-b.de>
580         * lto-lang.c (lto_register_builtin_type): Avoid useless
581         decl creation.
582         * lto-object.c (lto_obj_file_open, lto_obj_file_open): Free memory.
584 2012-10-08  Tobias Burnus  <burnus@net-b.de>
586         * lto.c (lto_wpa_write_files, read_cgraph_and_symbols):
587         Free lto_file struct after closing the file.
589 2012-10-08  Jan Hubicka  <jh@suse.cz>
591         * lto/lto.c (remember_with_vars): Also fixup INTEGER_CST.
592         (fixup_integer_cst): New functoin.
593         (lto_ft_type): Fixup BASETYPE of methods and offsets.
595 2012-10-07  Jan Hubicka  <jh@suse.cz>
597         * lto.c (read_cgraph_and_symbols): Release type merging hash early;
598         release input encoders.
599         * lto-partition.c (new_partition): Update for new lto_symtab_encoder_new.
601 2012-10-06  Jan Hubicka  <jh@suse.cz>
603         PR lto/54790 
604         * lto.c (resolution_map): New static var.
605         (register_resolution): New function.
606         (lto_register_var_decl_in_symtab): Use it.
607         (read_cgraph_and_symbols): Copy resolutions into the symtab.
609 2012-09-20  Martin Jambor  <mjambor@suse.cz>
611         * lto.c (lto_materialize_function): Call push_struct_function and
612         pop_cfun.
614 2012-09-19  Dehao Chen  <dehao@google.com>
616         * lto/lto.c (lto_fixup_prevailing_decls): Remove tree.exp.block field.
618 2012-09-19  Jan Hubicka  <jh@suse.cz>
620         * lto.c (lto_materialize_function): Update confused comment.
621         (read_cgraph_and_symbols): Do not free symtab.
623 2012-09-12  Jan Hubicka  <jh@suse.cz>
625         * lto.c (do_whole_program_analysis): Care timevars, statistics and
626         AUX pointer cleaning. Add max partitioning.
627         * lto-partition.c (enum symbol_class): New.
628         (get_symbol_class): New function.
629         (symbol_partitioned_p): New function.
630         (add_references_to_partition): Remove.
631         (add_aliases_to_partition): Remove.
632         (add_cgraph_node_to_partition_1): Remove.
633         (add_cgraph_node_to_partition): Remove.
634         (add_symbol_to_partition): New function.
635         (add_symbol_to_partition_1): New function.
636         (contained_in_symbol): New function.
637         (partition_cgraph_node_p): Remove.
638         (partition_varpool_node_p): Remove.
639         (partition_symbol_p): Remove.
640         (lto_1_to_1_map): Cleanup.
641         (lto_max_map): New.
642         (lto_balanced_map): Update.
643         (lto_promote_cross_file_statics): Update.
644         * lto-partition.h (lto_max_map): Declare.
645         * timevar.def (TV_WHOPR_PARTITIONING): New timevar.
647 2012-09-11  Jan Hubicka  <jh@suse.cz>
649         PR lto/54312
650         * lto.c (uniquify_nodes): Remove quadratic loop checking if the
651         type is variant leader.
653 2012-09-11  Richard Guenther  <rguenther@suse.de>
655         * lto.c (enum gtc_mode): Remove.
656         (struct type_pair_d): Adjust.
657         (lookup_type_pair): Likewise.
658         (gimple_type_leader): Do not mark as deletable.
659         (gimple_lookup_type_leader): Adjust.
660         (gtc_visit): Likewise.
661         (gimple_types_compatible_p_1): Likewise.
662         (gimple_types_compatible_p): Likewise.
663         (gimple_type_hash): Likewise.
664         (gimple_register_type): Likewise.
665         (read_cgraph_and_symbols): Manage lifetime of tables
666         here.
668 2012-09-11  Richard Guenther  <rguenther@suse.de>
670         * lto.c (gimple_types, type_hash_cache, enum gtc_mode,
671         struct type_pair_d, lookup_type_pair, struct sccs,
672         next_dfs_num, gtc_next_dfs_num, struct gimple_type_leader_entry_s,
673         gimple_type_leader, gimple_lookup_type_leader, compare_type_names_p,
674         gtc_visit, gimple_types_compatible_p_1, gimple_types_compatible_p,
675         visit, iterative_hash_name, struct type_hash_pair,
676         type_hash_pair_compare, iterative_hash_gimple_type, gimple_type_hash,
677         gimple_type_eq, gimple_register_type_1, gimple_register_type):
678         Move here from gimple.c
679         (read_cgraph_and_symbols): Free hash tables here.
680         (print_lto_report_1): New function wrapping print_lto_report.
681         (do_whole_program_analysis): Call it.
682         (lto_main): Likewise.
684 2012-09-10  Jan Hubicka  <jh@suse.cz>
686         * lto-partition.c (partition_symbol_p): Forward declare.
687         (add_references_to_partition): Reimplement using partition_symbol_p.
688         (add_aliases_to_partition): Break out from add_references_to_partition;
689         reimplement using partition_symbol_p.
690         (add_cgraph_node_to_partition_1): Handle callees using partition_symbol_p;
691         add sanity checks.
692         (add_varpool_node_to_partition): Use add_aliases_to_partition.
693         (partition_varpool_node_p): Do not special case aliases.
695 2012-08-12  Jan Hubicka  <jh@suse.cz>
697         * lto.c (lto_wpa_write_files): Do not delete partition encoder;
698         it is deleted after streaming.
699         * lto-partition.c (partition_symbol_p): New function.
700         (promote_var, promote_fn): Remove.
701         (promote_symbol): New function.
702         (lto_promote_cross_file_statics): First compute boundaries; rewrite
703         to lookup the actual boundaries instead of computing them ad-hoc.
705 2012-08-12  Jan Hubicka  <jh@suse.cz>
707         Replace cgraph_node_set and varpool_node_set by symtab_node_encoder
708         in partitioning.
709         * lto-partition.h (ltrans_partition_def): Replace cgraph_set and varpool_set
710         by encoder.
711         * lto-partition.c (new_partition): Update.
712         * lto.c (cmp_partitions_order): Update.
713         (lto_wpa_write_files): Update.
714         (free_ltrans_partitions): Update.
715         (add_references_to_partition): Update.
716         (add_cgraph_node_to_partition_1): Update.
717         (add_cgraph_node_to_partition): Update.
718         (add_varpool_node_to_partition): Update.
719         (undo_partition): Update.
720         (lto_balanced_map): Update.
721         (set_referenced_from_other_partition_p, set_reachable_from_other_partition_p,
722         set_referenced_from_this_partition_p): Update.
723         (lto_promote_cross_file_statics): Update.
725 2012-08-12  Jan Hubicka  <jh@suse.cz>
727         * lto-partition.c (set_referenced_from_other_partition_p,
728         set_reachable_from_other_partition_p, set_referenced_from_this_partition_p):
729         New functions.
730         (lto_promote_cross_file_statics): Use them.
732 2012-07-24  Jan Hubicka  <jh@suse.cz>
734         * lto.c (read_cgraph_and_symbols): Use input_symtab.
736 2012-07-24  Uros Bizjak  <ubizjak@gmail.com>
738         * lto-tree.h (lang_decl): Add variable_size GTY option.
740 2012-07-16  Steven Bosscher  <steven@gcc.gnu.org>
742         * lto.c: Do not include timevar.h.
743         * Make-lang.in: Fix dependencies.
745 2012-06-18  Lawrence Crowl  <crowl@google.com>
747         * lto.c (do_whole_program_analysis):  Rename use of TV_PHASE_CGRAPH to
748         TV_PHASE_OPT_GEN.  Use new timevar TV_PHASE_STREAM_OUT around the call
749         to lto_wpa_write_files.
750         (lto_main):  Rename use of TV_PHASE_CGRAPH to TV_PHASE_OPT_GEN.  Move
751         start of TV_PHASE_OPT_GEN to include call to materialize_cgraph.  Use
752         TV_PHASE_SETUP for the call to lto_init.  Use new timevar
753         TV_PHASE_STREAM_IN around the call to read_cgraph_and_symbols.
754         Turn TV_PHASE_PARSING off then back on again, because LTO is pretending
755         to be a front end, but is not one.
757 2012-05-18  Jan Hubicka  <jh@suse.cz>
759         * lto.c (lto_materialize_constructors_and_inits): Remove.
760         (read_cgraph_and_symbols): Remove handling of alias pairs.
762 2012-05-17  Jan Hubicka  <jh@suse.cz>
764         * lto-partition.c (add_references_to_partition): Handle external vars.
765         (partition_varpool_node_p): Likewise.
766         (lto_promote_cross_file_statics): Do not promote externals.
768 2012-05-14  Bernd Schmidt  <bernds@codesourcery.com>
770         * lto-lang.c (handle_fnspec_attribute): New static function.
771         (lto_attribute_table): Add "fn spec".
772         (DEF_ATTR_STRING): Define and undefine along with the other macros.
774 2012-05-04  Jan Hubicka  <jh@suse.cz>
776         * lto.c (do_whole_program_analysis): Set timevars correctly.
777         (lto_main): Likewise.
779 2012-05-04  Richard Guenther  <rguenther@suse.de>
781         * lang.opt (fwpa): Do not mark as Optimization.
782         (fltrans): Likewise.
784 2012-04-30  Jan Hubicka  <jh@suse.cz>
786         * lto.c (lto_main): Use compile ().
787         * lto-partition.c (partition_cgraph_node_p): Use
788         symtab_used_from_object_file_p.
789         (partition_varpool_node_p): Likewise.
791 2012-04-20  Jan Hubicka  <jh@suse.cz>
793         * lto-partition.c (partition_cgraph_node_p): Use force_output.
795 2012-04-18  Jan Hubicka  <jh@suse.cz>
797         * lto-partition.c (add_references_to_partition, lto_balanced_map):
798         Update for new ipa-ref API.
800 2012-04-16  Jan Hubicka  <jh@suse.cz>
802         * lto.c (read_cgraph_and_symbols): Use FOR_EACH
803         walkers to walk cgraph and varpool.
804         (materialize_cgraph): Likewise.
805         * lto-partition.c (lto_1_to_1_map): Likewise.
806         (lto_balanced_map): Likewise.
807         (lto_promote_cross_file_statics): Likewise.
809 2012-04-14  Jan Hubicka  <jh@suse.cz>
811         * lto.c: Update field referenced for new cgraph/varpool layout.
812         * lto-partition.c: Likewise.
814 2012-04-11  Jan Hubicka  <jh@suse.cz>
816         * lto.c: Update copyright; remove params.h, ipa-inline.h
817         and ipa-utils.h inlines; inline lto-partition.h
818         (ltrans_partition_def, ltrans_partition, add_cgraph_node_to_partition,
819         add_varpool_node_to_partition, new_partition, free_ltrans_partitions,
820         add_references_to_partition, add_cgraph_node_to_partition_1,
821         add_cgraph_node_to_partition, add_varpool_node_to_partition,
822         undo_partition, partition_cgraph_node_p, partition_varpool_node_p,
823         lto_1_to_1_map, node_cmp, varpool_node_cmp, lto_balanced_map,
824         promote_var, promote_fn, lto_promote_cross_file_statics): move to...
825         * lto-partition.c: ... here; new file.
826         * lto-partition.h: New file.
827         * Make-lang.in (lto.o): Update dependencies.
828         (lto-partition.o): New.
830 2012-04-05  Richard Guenther  <rguenther@suse.de>
832         * lto-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Remove
833         definition.
835 2012-03-12  Richard Guenther  <rguenther@suse.de>
837         * lto-lang.c (builtin_type_for_size): Use lto_type_for_size.
839 2012-03-06  Richard Guenther  <rguenther@suse.de>
841         PR lto/52097
842         * lto.c (uniquify_nodes): Merge TYPE_FIELDS of variant types.
844 2012-02-28  Richard Guenther  <rguenther@suse.de>
846         PR lto/52400
847         * lto.c (lto_register_function_decl_in_symtab): Do not register
848         a reverse renamed decl mapping.
850 2012-01-06  Jakub Jelinek  <jakub@redhat.com>
852         PR lto/51774
853         * lto-lang.c (handle_returns_twice_attribute): New function.
854         (lto_attribute_table): Add returns_twice attribute.
856 2011-12-21  Richard Guenther  <rguenther@suse.de>
858         * lto.c (GIMPLE_REGISTER_TYPE): New define.
859         (LTO_FIXUP_TREE): Use it.
860         (uniquify_nodes): Mark new non-prevailing types and avoid
861         calling gimple_register_type on others.
862         (lto_read_decls): Add comment.
864 2011-12-13  Eric Botcazou  <ebotcazou@adacore.com>
866         * lto.h (lto_parse_hex): Delete.
867         * lto.c (lto_read_decls): Use 'int' for offsets.
868         (lto_parse_hex): Make static and return proper 64-bit host type.
869         (lto_resolution_read): Use proper 64-bit host type.
871 2011-12-13  Richard Guenther  <rguenther@suse.de>
873         PR lto/48354
874         * lto.c (lto_ft_decl_non_common): When we merged DECL_ORIGINAL_TYPE
875         with the type of the TYPE_DECL clear DECL_ORIGINAL_TYPE.
877 2011-12-01  Uros Bizjak  <ubizjak@gmail.com>
879         * lto-lang.c (lto_attribute_table): Handle *tm regparm.
880         (ignore_attribute): New.
882 2011-11-21  Aldy Hernandez  <aldyh@redhat.com>
884         * lto-lang.c (lto_attribute_table): Handle transaction_pure.
885         (handle_transaction_pure_attribute): New.
887 2011-11-03  Richard Guenther  <rguenther@suse.de>
889         PR lto/44965
890         * lto-lang.c (lto_post_options): Do not read file options.
891         * lto.c (lto_read_all_file_options): Remove.
892         (lto_init): Call lto_set_in_hooks here.
894 2011-10-09  Jan Hubicka  <jh@suse.cz>
896         * lto.c (node_cmp, varpool_node_cmp): New functions.
897         (lto_balanced_map): Honnor -fno-toplevel-reorder of vars&functions.
898         (cmp_partitions): Rename to ...
899         (cmp_partitions_size): ... this one.
900         (cmp_partitions_order): New function.
901         (lto_wpa_write_files): Sort partitions by order when
902         -fno-toplevel-reorder is used.
904 2011-10-09  Andi Kleen  <ak@linux.intel.com>
906         * lto.c (lto_section_read): Call fatal_error on IO or mmap errors.
908 2011-10-11  Michael Meissner  <meissner@linux.vnet.ibm.com>
910         * lto-lang.c (def_builtin_1): Delete old interface with two
911         parallel arrays to hold standard builtin declarations, and replace
912         it with a function based interface that can support creating
913         builtins on the fly in the future.  Change all uses, and poison
914         the old names.  Make sure 0 is not a legitimate builtin index.
916 2011-10-02   Andi Kleen  <ak@linux.intel.com>
918         * lto-object.c (lto_obj_add_section_data): Add list.
919         (lto_obj_add_section): Fill in list.
920         (ltoobj_build_section_table): Pass through list.
921         * lto.c (file_data_list): Declare.
922         (create_subid_section_table): Pass arguments directly.
923         Fill in list of file_datas.
924         (lwstate): Delete.
925         (lto_create_files_from_ids): Pass in direct arguments.
926         Don't maintain list.
927         (lto_file_read): Use explicit section and file data lists.
928         (lto_read_all_file_options): Pass in section_list.
929         * lto.h (lto_obj_build_section_table): Add list.
930         (lto_section_slot): Add next.
931         (lto_section_list): Declare.
933 2011-10-02  Jan Hubicka  <jh@suse.cz>
935         PR lto/47247
936         * common.c (lto_resolution_str): Add new resolution.
937         * common.h (lto_resolution_str): Likewise.
939 2011-09-30  H.J. Lu  <hongjiu.lu@intel.com>
940             Andi Kleen  <ak@linux.intel.com>
942         PR lto/50568
943         * lto.c (lto_splay_tree_delete_id): New.
944         (lto_splay_tree_compare_ids): Likewise.
945         (lto_splay_tree_lookup): Likewise.
946         (lto_splay_tree_id_equal_p): Likewise.
947         (lto_splay_tree_insert): Likewise.
948         (lto_splay_tree_new): Likewise.
949         (lto_resolution_read): Change id to unsigned HOST_WIDE_INT.
950         Use lto_splay_tree_id_equal_p and lto_splay_tree_lookup.
951         (create_subid_section_table): Use lto_splay_tree_lookup and
952         lto_splay_tree_insert.
953         (lto_file_read): Use lto_splay_tree_new.
955 2011-09-26   Andi Kleen  <ak@linux.intel.com>
957         * lto.c (lto_resolution_read): Remove id dumping.
958         (lto_section_with_id): Turn id HOST_WIDE_ID.
959         (create_subid_section_table): Dito.
961 2011-08-28  Dodji Seketeli  <dodji@redhat.com>
963         * lto-lang.c (lto_init): Likewise.  Also, avoid calling
964         linemap_add twice.
966 2011-08-11  Martin Jambor  <mjambor@suse.cz>
968         * lto.c (uniquify_nodes): Use main variant's BINFO too.
970 2011-08-08   Diego Novillo  <dnovillo@google.com>
972         * Make-lang.in (lto/lto.o): Add TREE_STREAMER_H.
973         * lto.c: Include tree-streamer.h.
975 2011-07-06  Richard Guenther  <rguenther@suse.de>
977         * lto-lang.c (lto_init):
978         Merge calls to build_common_tree_nodes and build_common_tree_nodes_2.
980 2011-06-11  Jan Hubicka  <jh@suse.cz>
982         PR lto/48246
983         * lto.c (lto_1_to_1_map): Don't create empty partitions.
984         (lto_balanced_map): Likewise.
986 2011-06-11  Jan Hubicka  <jh@suse.cz>
988         * lto.c (add_cgraph_node_to_partition_1): Break out from ...
989         (add_cgraph_node_to_partition) ... here; walk aliases.
990         (lto_1_to_1_map): Remove same body alias code.
991         (promote_fn): Likewise.
992         (lto_promote_cross_file_statics): Update comment.
995 2011-06-07  Diego Novillo  <dnovillo@google.com>
997         * lto.c (uniquify_nodes): Move code to register decls to
998         the loop that computes canonical types.
1000 2011-06-07  Richard Guenther  <rguenther@suse.de>
1002         * lto-lang.c (lto_init): Do not set
1003         size_type_node or call set_sizetype.
1005 2011-06-04  Diego Novillo  <dnovillo@google.com>
1007         * lto.c (lto_init): New.
1008         (lto_main): Call it.
1010 2011-06-03  Diego Novillo  <dnovillo@google.com>
1012         * lto.c (get_resolution): Move from lto-streamer-in.c.
1013         (lto_register_var_decl_in_symtab): Likewise.
1014         (lto_register_function_decl_in_symtab): Likewise.
1015         (uniquify_nodes): Call lto_register_var_decl and
1016         lto_register_function_decl_in_symtab after reading a new
1017         VAR_DECL or FUNCTION_DECL.
1019 2011-06-01  Richard Guenther  <rguenther@suse.de>
1021         * lto-lang.c (lto_register_canonical_types): New function.
1022         (lto_init): Register common nodes with the canonical type machinery.
1023         Do not play tricks with char_type_node.
1025 2011-05-26  Richard Guenther  <rguenther@suse.de>
1027         * lto.c (uniquify_nodes): Fix bug in one of the previous changes.
1029 2011-05-25  Nathan Froyd  <froydnj@codesourcery.com>
1031         * lto.c (lto_ft_typed): New function.
1032         (lto_ft_common): Call it.
1033         (lto_ft_constructor): Likewise.
1034         (lto_ft_expr): Likewise.
1035         (lto_fixup_prevailing_decls): Check for TS_COMMON before accessing
1036         TREE_CHAIN.
1038 2011-05-20  Richard Guenther  <rguenther@suse.de>
1040         * lto.c (lto_ft_common): Remove pointer-to chain teardown.
1041         (lto_ft_type): Move main-variant and pointer-to chain building ...
1042         (uniquify_nodes): ... here.  Compute TYPE_CANONICAL also here,
1043         in a separate final loop.
1045 2011-05-19  Richard Guenther  <rguenther@suse.de>
1047         * lto.c (uniquify_nodes): First register all types before
1048         fixing up the tree SCC.
1050 2011-05-11  Jan Hubicka  <jh@suse.cz>
1052         PR lto/48952
1053         * lto.c (do_whole_program_analysis): Do not register cgraph hooks.
1055 2011-05-11  Nathan Froyd  <froydnj@codesourcery.com>
1057         * lto.c (lto_ft_type): Use TYPE_MINVAL and TYPE_MAXVAL.  Adjust
1058         location of binfo field.
1059         (lto_fixup_prevailing_decls): Likewise.
1061 2011-05-10  Nathan Froyd  <froydnj@codesourcery.com>
1063         * lto-lang.c (def_fn_type): Don't call build_function_type, call
1064         build_function_type_array or build_varargs_function_type_array
1065         instead.
1067 2011-05-07  Eric Botcazou  <ebotcazou@adacore.com>
1069         * lto-lang.c (global_bindings_p): Return bool.
1071 2011-05-07  Jan Hubicka  <jh@suse.cz>
1073         * lto.c (lto_materialize_function): Use
1074         cgraph_function_with_gimple_body_p.
1075         (add_cgraph_node_to_partition): Do not re-add items to partition;
1076         handle thunks.
1077         (add_varpool_node_to_partition): Do not re-add items to partition.
1079 2011-05-03  Jan Hubicka  <jh@suse.cz>
1081         * lto.c (free_ltrans_partitions): Fix accidental commit.
1083 2011-05-03  Jan Hubicka  <jh@suse.cz>
1085         * lto.c (ltrans_partition_def): Remove GTY annotations.
1086         (ltrans_partitions): Move to heap.
1087         (new_partition): Update.
1088         (free_ltrans_partitions): New function.
1089         (lto_wpa_write_files): Use it.
1091 2011-04-29  Martin Jambor  <mjambor@suse.cz>
1093         * lto.c: Include ipa-utils.h.
1094         (lto_balanced_map): Update call to ipa_reverse_postorder.
1095         * Make-lang.in (lto/lto.o): Add IPA_UTILS_H to dependencies.
1097 2011-04-29  Michael Matz  <matz@suse.de>
1099         * lto.c (toplevel): Include tree-flow.h.
1100         (lto_read_in_decl_state): Don't merge types here.
1101         (tree_with_vars): New static hash table.
1102         (remember_with_vars): New static functions.
1103         (LTO_FIXUP_TYPE): New macro.
1104         (lto_ft_common, lto_ft_decl_minimal, lto_ft_decl_common,
1105         lto_ft_decl_with_vis, lto_ft_decl_non_common, lto_ft_function,
1106         lto_ft_field_decl, lto_ft_type, lto_ft_binfo, lto_ft_constructor,
1107         lto_ft_expr, lto_fixup_types, uniquify_nodes): New static functions.
1108         (lto_read_decls): Uniquify while reading in trees.
1109         (lto_fixup_data_t, LTO_FIXUP_SUBTREE,
1110         LTO_REGISTER_TYPE_AND_FIXUP_SUBTREE, no_fixup_p, lto_fixup_common,
1111         lto_fixup_decl_minimal, lto_fixup_decl_common, lto_fixup_decl_with_vis,
1112         lto_fixup_decl_non_common, lto_fixup_function, lto_fixup_field_decl,
1113         lto_fixup_type, lto_fixup_binfo, lto_fixup_constructor,
1114         lto_fixup_tree): Remove.
1115         (lto_fixup_state): Remove data argument.  Use
1116         lto_symtab_prevailing_decl.
1117         (LTO_SET_PREVAIL, LTO_NO_PREVAIL): New macros.
1118         (lto_fixup_prevailing_decls): New function.
1119         (lto_fixup_state_aux): Argument aux is unused.
1120         (lto_fixup_decls): Don't allocate pointer sets, don't use
1121         lto_fixup_tree, use lto_fixup_prevailing_decls.
1122         (read_cgraph_and_symbols): Allocate and remove tree_with_vars.
1123         * Make-lang.in (lto/lto.o): Depend on $(TREE_FLOW_H).
1125 2011-04-16  Eric Botcazou  <ebotcazou@adacore.com>
1127         * lto.c (lto_balanced_map): Fix typos in head comment.
1128         (lto_promote_cross_file_statics): Fix long lines and remove redundant
1129         test.
1131 2011-04-16  Jan Hubicka  <jh@suse.cz>
1133         * lto.c (lto_balanced_map): Update.
1135 2011-04-14  Jan Hubicka  <jh@suse.cz>
1137         * lto.c: Include ipa-inline.h
1138         (add_cgraph_node_to_partition, undo_partition): Use inline_summary
1139         accessor.
1140         (ipa_node_duplication_hook): Fix declaration.
1141         * Make-lang.in (lto.o): Update dependencies.
1143 2011-04-12  Nathan Froyd  <froydnj@codesourcery.com>
1145         * lto-tree.h (union lang_tree_node): Check for TS_COMMON before
1146         calling TREE_CHAIN.
1147         * lto.c (lto_fixup_common): Likewise.
1149 2011-04-08  Nathan Froyd  <froydnj@codesourcery.com>
1151         * lto-lang.c (handle_sentinel_attribute): Don't use TYPE_ARG_TYPES.
1152         (handle_type_generic_attribute): Likewise.
1154 2011-04-03  Michael Matz  <matz@suse.de>
1156         * lto.c (lto_materialize_function): Don't read and then discard
1157         sections in WPA mode.
1158         (lto_read_in_decl_state): Adjust call to lto_streamer_cache_get.
1160         * lto-lang.c (registered_builtin_fndecls): Remove.
1161         (lto_getdecls): Return NULL_TREE.
1162         (lto_builtin_function): Don't remember in registered_builtin_fndecls.
1164 2011-03-31  Richard Guenther  <rguenther@suse.de>
1166         PR lto/48246
1167         * lto.c (lto_wpa_write_files): Disable assert for non-empty
1168         partitions when checking is not enabled.
1170 2011-03-25  Kai Tietz  <ktietz@redhat.com>
1172         * lto.c (lto_resolution_read): Use filename_cmp instead
1173         of strcmp.
1174         (lto_read_section_data): Likewise.
1176 2011-03-25  Jeff Law  <law@redhat.com>
1178         * lto/lto-lang.c (def_fn_type): Add missing va_end.
1180 2011-03-21  Kai Tietz  <ktietz@redhat.com>
1182         PR target/12171
1183         * lto-lang.c (lto_attribute_table): Adjust table.
1185 2011-02-18  Jakub Jelinek  <jakub@redhat.com>
1187         PR bootstrap/47807
1188         * Make-lang.in (lto/lto-lang.o): Depend on $(LTO_STREAMER_H) instead
1189         of lto-streamer.h.
1191 2011-02-18  Richard Guenther  <rguenther@suse.de>
1193         PR lto/47798
1194         * lto-tree.h (lto_global_var_decls): Do not declare here.
1195         * lto-lang.c: Include lto-streamer.h.
1196         * Make-lang.in (lto-lang.o): Adjust dependencies.
1198 2011-02-10  Kai Tietz  <kai.tietz@onevision.com>
1200         PR lto/47241
1201         * lto.c (lto_read_section_data): Free
1202         fd_name in failure case.
1203         For mingw targets don't hash file-descriptor.
1204         (read_cgraph_and_symbols): Close current_lto_file
1205         in failure case.
1207 2011-01-11  Jan Hubicka  <jh@suse.cz>
1209         PR lto/45721
1210         PR lto/45375
1211         * lto.c (partition_cgraph_node_p, partition_varpool_node_p): Weakrefs
1212         are not partitioned.
1214 2010-12-22  Nathan Froyd  <froydnj@codesourcery.com>
1216         * lto-lang.c (handle_nonnull_attribute, handle_sentinel_attribute):
1217         Use prototype_p.
1219 2010-12-06  Richard Guenther  <rguenther@suse.de>
1221         PR lto/46796
1222         * lto-lang.c (lto_init): Give names to basic types.
1224 2010-11-30  Joseph Myers  <joseph@codesourcery.com>
1226         * lto-object.c: Don't include toplev.h.
1227         * Make-lang.in (lto/lto-object.o): Don't depend on toplev.h.
1229 2010-11-30  Joseph Myers  <joseph@codesourcery.com>
1231         * Make-lang.in (lto/lto-object.o): Depend on toplev.h instead of
1232         $(TOPLEV_H).
1234 2010-11-29  Joseph Myers  <joseph@codesourcery.com>
1236         * lto-endian.h: Delete.
1237         * lto-object.c: Don't include "libiberty.h".
1238         (O_BINARY): Don't define.
1239         * lto.c: Don't include "libiberty.h" or <sys/mman.h>.
1240         (O_BINARY): Don't define.
1242 2010-11-23  Richard Guenther  <rguenther@suse.de>
1244         * lto.c (read_cgraph_and_symbols): Remove newline from diagnostic.
1246 2010-11-23  Richard Guenther  <rguenther@suse.de>
1248         PR lto/46605
1249         * lto.c (read_cgraph_and_symbols): Bail out after errors.
1251 2010-11-17  Joseph Myers  <joseph@codesourcery.com>
1253         * lto.c (lto_main): Take no arguments.
1254         * lto.h (lto_main): Update prototype.
1256 2010-11-16  Ian Lance Taylor  <iant@google.com>
1258         * lto-object.c (lto_obj_file_open): Call
1259         simple_object_attributes_merge rather than
1260         simple_object_attributes_compare.
1262 2010-11-12  Joseph Myers  <joseph@codesourcery.com>
1264         * Make-lang.in (lto/lto.o): Use $(OPTS_H).
1265         * lto-lang.c (lto_handle_option): Take location_t parameter.
1267 2010-11-10  Joseph Myers  <joseph@codesourcery.com>
1269         * lto.c (lto_resolution_read): Start diagnostics with lowercase
1270         letters and remove trailing '.'.
1271         (lto_file_finalize): Start diagnostic with a lowercase letter.
1273 2010-11-02  Ian Lance Taylor  <iant@google.com>
1275         * lto-object.c: New file.
1276         * lto-elf.c: Remove file.
1277         * lto-macho.c: Remove file.
1278         * lto-macho.h: Remove file.
1279         * lto-coff.c: Remove file.
1280         * lto-coff.h: Remove file.
1281         * Make-lang.in (LTO_OBJS): Change lto/$(LTO_BINARY_READER).o to
1282         lto/lto-object.o.
1283         ($(LTO_EXE)): Remove $(LTO_USE_LIBELF)
1284         (lto/lto-objfile.o): New target.
1285         (lto/lto-elf.o, lto/lto-coff.o, lto/lto-macho.o): Remove targets.
1286         (lto/lto.o): Remove $(LIBIBERTY_H).
1288 2010-10-22  Jan Hubicka  <jh@suse.cz>
1290         * lto.c (add_cgraph_node_to_partition,
1291         add_varpool_node_to_partition): Add debug info.
1292         (lto_1_to_1_map, lto_balanced_map): Do not re-add already
1293         partitioned nodes.
1294         (do_whole_program_analysis): Set function flags before dumping.
1296 2010-10-22  Richard Guenther  <rguenther@suse.de>
1298         * lto.c (lto_fixup_type): Fixup TYPE_CANONICAL again, via
1299         the new gimple_register_canonical_type.
1301 2010-10-20  H.J. Lu  <hongjiu.lu@intel.com>
1303         PR bootstrap/45954
1304         * config-lang.in (boot_language): Set to $enable_lto.
1306 2010-10-18  Jakub Jelinek  <jakub@redhat.com>
1308         PR lto/45638
1309         * Make-lang.in (check-lto): New dummy target.
1311 2010-10-14  Eric Botcazou  <ebotcazou@adacore.com>
1313         * lto-elf.c (SHN_XINDEX): Define if not already defined.
1315 2010-10-08  Joseph Myers  <joseph@codesourcery.com>
1317         * lto-lang.c (lto_init_options): Change to
1318         lto_init_options_struct.  Update parameters.
1319         (LANG_HOOKS_INIT_OPTIONS): Don't define.
1320         (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define.
1322 2010-10-06  Jan Hubicka  <jh@suse.cz>
1324         * lto.c (lto_balanced_map): Fix accounting of program size.
1326 2010-10-06  Jan Hubicka  <jh@suse.cz>
1328         * lto.c (lto_balanced_map): Do not produce empty partitions.
1330 2010-10-06  Andi Kleen  <ak@linux.intel.com>
1332         * lto.c (lto_process_name): Add.
1333         (lto_main): Call lto_process_name.
1335 2010-10-06  Jan Hubicka  <jh@suse.cz>
1337         * lto.c (partition_cgraph_node_p, partition_varpool_node_p): Handle
1338         COMDATs required by the linker.
1340 2010-10-05  Ian Lance Taylor  <iant@google.com>
1342         * lto.c (lto_section_with_id): Make s a const pointer.
1344 2010-10-05  Jan Hubicka  <jh@suse.cz>
1346         * lto.c:  Include params.h.
1347         (add_cgraph_node_to_partition, add_varpool_node_to_partition): Do
1348         refcounting in aux field.
1349         (undo_partition, partition_cgraph_node_p, partition_varpool_node_p):
1350         New functions.
1351         (lto_1_to_1_map): Simplify.
1352         (lto_balanced_map): New function.
1353         (do_whole_program_analysis): Chose proper partitioning alg.
1354         * Make-lang.in (lto.o): Add dependency on params.h
1356 2010-10-04  Andi Kleen  <ak@linux.intel.com>
1358         * Make-lang.in (lto1): Add + to build rule.
1360 2010-10-03  Andi Kleen  <ak@linux.intel.com>
1362         * lto.c (lto_file_finalize): Replace gcc_assert for missing section
1363           with fatal_error.
1365 2010-09-28  Jan Hubicka  <jh@suse.cz>
1367         * lto-lang.c (handle_leaf_attribute): New function.
1368         (lto_attribute_tables): Add leaf.
1370 2010-09-25  Jie Zhang  <jie@codesourcery.com>
1372         * lto.c (lto_read_all_file_options): Start a new line after
1373         printing out file names.
1375 2010-09-24  Jan Hubicka  <jh@suse.cz>
1377         * lto.c (lto_promote_cross_file_statics): Use const_value_known_p.
1379 2010-09-20  Jan Hubicka  <jh@suse.cz>
1381         PR tree-optimize/45605
1382         * lto.c (lto_promote_cross_file_statics): Use const_value_known_p.
1384 2010-09-18  Gerald Pfeifer  <gerald@pfeifer.com>
1386         * lto-elf.c (lto_obj_file_open): Also provide filename when
1387         elf_begin fails.
1389 2010-09-17  Jan Hubicka  <jh@suse.cz>
1391         * lto.c (lto_promote_cross_file_statics): Use const_value_known.
1393 2010-09-17  Richard Guenther  <rguenther@suse.de>
1395         * lang.opt (flag_wpa): Also enable for the driver.
1397 2010-09-16  Jan Hubicka  <jh@suse.cz>
1399         * lto.c (lto_materialize_function): Do not tamper with STATIC and
1400         EXTERNAL flags. 
1402 2010-09-15  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
1404         * lto-tree.h (struct lang_type): Add variable_size GTY option.
1406 2010-09-08  Jan Hubicka  <jh@suse.cz>
1408         * lto.c (real_file_count, real_file_decl_data): New static vars.
1409         (read_cgraph_and_symbols): Use it.
1411 2010-09-08  Richard Guenther  <rguenther@suse.de>
1413         * lto.c (read_cgraph_and_symbols): Collect again after each
1414         file.
1416 2010-09-07  Jan Hubicka  <jh@suse.cz>
1418         * lto.c (promote_var, promote_fn): Set DECL_VISIBILITY_SPECIFIED.
1420 2010-09-03  Richard Guenther  <rguenther@suse.de>
1422         * lto-elf.c (validate_file): Always error if validation fails.
1424 2010-08-20  Jan Hubicka  <jh@suse.cz>
1426         * lto.c (lto_1_to_1_map): Be prepared for node to have no file data.
1427         (lto_wpa_write_files): Update comments.
1429 2010-08-20  H.J. Lu  <hongjiu.lu@intel.com>
1431         PR bootstrap/45357
1432         * lto.c (lto_materialize_function): Replace has_analyzed_clone
1433         with has_analyzed_clone_p.
1435 2010-08-20  Jan Hubicka  <jh@suse.cz>
1437         * lto.c (has_analyzed_clone_p): New function
1438         (lto_materialize_function): Use callgraph to determine if
1439         body is needed.
1440         (materialize_cgraph): Remove DECL_IS_BUILTIN check.
1442 2010-08-20  Nathan Froyd  <froydnj@codesourcery.com>
1444         * lto.c: Use FOR_EACH_VEC_ELT.
1446 2010-07-27  Andi Kleen  <ak@linux.intel.com>
1448         * Make-lang.in (lto.o): Add dependency to splay-tree.h
1450 2010-07-27  Joseph Myers  <joseph@codesourcery.com>
1452         * lto-lang.c (lto_handle_option): Update prototype and return
1453         value type.  Remove duplicate assignment to result.
1455 2010-07-27  Joseph Myers  <joseph@codesourcery.com>
1457         * lto-lang.c (lto_option_lang_mask, lto_complain_wrong_lang_p):
1458         New.
1459         (lto_init_options): Update prototype.
1460         (LANG_HOOKS_OPTION_LANG_MASK, LANG_HOOKS_COMPLAIN_WRONG_LANG_P):
1461         Define.
1463 2010-07-10  Andi Kleen  <ak@linux.intel.com>
1465         PR lto/44992
1466         * lto.c: Include splay-tree.h
1467         (lto_resolution_read): Change to walk file_ids tree and parse
1468         extra file_id in resolution file.
1469         (lto_section_with_id): Add.
1470         (create_subid_section_table): Add.
1471         (lwstate): Add.
1472         (lto_create_files_from_ids): Add.
1473         (lto_file_read): Change to handle sub file ids and create list
1474         of file_datas. Add output argument for count.
1475         (get_section_data): Pass file_data to lto_get_section_name.
1476         (lto_flatten_file): Add.
1477         (read_cgraph_and_symbols): Handle linked lists of file_datas.
1479 2010-07-10  Andi Kleen  <ak@linux.intel.com>
1481         * lto-coff.c (hash_name, eq_name): Move.
1482         (lto_obj_build_section_table): Call lto_obj_create_section_hash_table.
1483         * lto-elf.c: (hash_name, eq_name): Move.
1484         (lto_obj_build_section_table): Call lto_obj_create_section_hash_table.
1485         * lto-macho.c: (hash_name, eq_name): Move.
1486         (lto_obj_build_section_table): Call lto_obj_create_section_hash_table.
1487         * lto.c: (hash_name, eq_name): Move from lto-*.c
1488         (lto_obj_create_section_hash_table): Add.
1489         (free_with_string): Add.
1491 2010-07-08  Manuel López-Ibáñez  <manu@gcc.gnu.org>
1493         * lto-coff.c: Include diagnostic-core.h in every file that
1494         includes toplev.h.
1495         * lto-elf.c: Likewise.
1496         * lto-lang.c: Likewise.
1497         * lto-macho.c: Likewise.
1499 2010-07-07  Jakub Jelinek  <jakub@redhat.com>
1501         * lto-elf.c (ELFOSABI_NONE, ELFOSABI_LINUX): Define if not defined.
1502         (validate_file): Allow merging of ELFOSABI_NONE with ELFOSABI_LINUX
1503         objects.
1505 2010-07-05  Jan Hubicka  <jh@suse.cz>
1507         * lto.c (add_cgraph_node_to_partition): Forward declare; walk also
1508         nodes from same comdat group as well as all comdat functions referenced
1509         here.
1510         (add_varpool_node_to_partition, add_references_to_partition): New
1511         function.
1512         (lto_1_1_map): Skip COMDAT fnctions/variables; use
1513         add_varpool_node_to_partition; clear aux flags when done.
1514         (lto_promote_cross_file_statics): Do not promote stuff that gets
1515         duplicated to each ltrans.
1517 2010-07-04  Jan Hubicka  <jh@suse.cz>
1519         * lto.c (read_cgraph_and_symbols): Dump cgraph before merging.
1521 2010-06-13  Richard Guenther  <rguenther@suse.de>
1523         * lto.c (lto_fixup_type): Do not register or fixup TYPE_CANONICAL.
1525 2010-06-09  Kai Tietz  <kai.tietz@onevision.com>
1527         * lto.c (lto_resolution_read):  Pre-initialize local variable r.
1528         * lto-coff.c (coff_write_object_file): Add braces to if.
1530 2010-06-08  Laurynas Biveinis  <laurynas.biveinis@gmail.com>
1532         * lto.c (lto_read_in_decl_state): Use typed GC allocation.
1533         (lto_file_read): Likewise.
1534         (new_partition): Likewise.
1535         (read_cgraph_and_symbols): Likewise.
1537 2010-06-07  Joseph Myers  <joseph@codesourcery.com>
1539         * lto-lang.c (flag_no_builtin, flag_no_nonansi_builtin): Remove.
1540         (lto_handle_option): Don't set flag_signed_char here.
1542 2010-06-04  Richard Guenther  <rguenther@suse.de>
1544         PR lto/41584
1545         * lto.c (lto_1_to_1_map): Use the proper file_data for
1546         varpool nodes.
1548 2010-05-30  Jan Hubicka  <jh@suse.cz>
1550         * lto.c (promote_var, promote_fn, lto_wpa_write_files): Dump
1551         partitioning decisions.
1553 2010-05-29  Jan Hubicka  <jh@suse.cz>
1555         * lto.c (bitmap vector): Remove.
1556         (lto_cgraph_node_sets,  lto_varpool_node_sets): Remove.
1557         (ltrans_partition_def): New structure.
1558         (ltrans_partition): New type and VECtor.
1559         (new_partition): New function.
1560         (add_cgraph_node_to_partition): New function.
1561         (lto_1_to_1_map): Reorganize for partitions.
1562         (lto_add_inline_clones): Remove.
1563         (lto_add_all_inlinees): Remove.
1564         (lto_promote_cross_file_statics): Use partitions.
1565         (cmp_partitions): New function.
1566         (lto_wpa_write_files): Do not call lto_add_all_inlinees;
1567         use partitions; output files sorted by size.
1569 2010-05-29  Steven Bosscher  <steven@gcc.gnu.org>
1571         * Make-lang.in: Replace vec.h dependency with VEC_H.
1573 2010-05-28  Joseph Myers  <joseph@codesourcery.com>
1575         * lto-coff.c (coff_errmsg): Remove.
1576         (lto_coff_begin_section_with_type, lto_obj_append_data): Use %m in
1577         errors instead of coff_errmsg (-1).
1578         * lto-macho.c (mach_o_errmsg): Remove.
1579         (lto_obj_begin_section, lto_obj_append_data): Use %m in errors
1580         instead of mach_o_errmsg (-1).
1581         * lto.c (read_cgraph_and_symbols): Use %m in errors instead of
1582         xstrerror (errno).
1584 2010-05-28  Richard Guenther  <rguenther@suse.de>
1586         * lto.c (prefix_name_with_star): Removed.
1587         (strip_extension): Likewise.
1588         (get_filename_for_set): Likewise.
1589         (lto_write_ltrans_list): Fold into ...
1590         (lto_wpa_write_files): ... this.  Name LTRANS units
1591         by suffixing the ltrans output list filename.
1592         (do_whole_program_analysis): Adjust.
1594 2010-05-27  Joseph Myers  <joseph@codesourcery.com>
1596         * lto.c: Include diagnostic-core.h instead of diagnostic.h.
1597         (read_cgraph_and_symbols, lto_main): Use seen_error.
1598         * Make-lang.in (lto/lto.o): Update dependencies.
1600 2010-05-27  Eric Botcazou  <ebotcazou@adacore.com>
1602         PR lto/44230
1603         * lto.h (lto_eh_personality): New prototype.
1604         * lto.c: Include debug.h.
1605         (first_personality_decl): New static variable.
1606         (lto_materialize_function): Set it to DECL_FUNCTION_PERSONALITY of the
1607         first function for which it is non-null.
1608         (lto_eh_personality_decl): New static variable.
1609         (lto_eh_personality): New function.
1610         * lto-lang.c (LANG_HOOKS_EH_PERSONALITY): Redefine to above function.
1611         * Make-lang.in (lto/lto.o): Add dependency on debug.h.
1613 2010-05-26  Steven Bosscher  <steven@gcc.gnu.org>
1615         * lto-lang.c: Do not include expr.h.
1617 2010-05-24  Richard Guenther  <rguenther@suse.de>
1619         * lto-elf.c (lto_obj_build_section_table): Work around
1620         FreeBSD libelf issue.
1622 2010-05-22  Richard Guenther  <rguenther@suse.de>
1624         * lto.c (read_cgraph_and_symbols): Do not collect.
1626 2010-05-20  Jan Hubicka  <jh@suse.cz>
1628         * lto.c (promote_var, promote_fn): New functions.
1629         (lto_promote_cross_file_statics): Compute correctly boundary including
1630         static initializers of readonly vars.
1632 2010-05-18  Jan Hubicka  <jh@suse.cz>
1634         * lto.c (lto_1_to_1_map): Partition non-inline clones.
1635         (lto_promote_cross_file_statics): Deal with non-inline clones.
1637 2010-05-18  Jan Hubicka  <jh@suse.cz>
1639         * lto.c (lto_materialize_function): Announce function when
1640         reading body; allocate_struct_function only when reading body;
1641         do not finalize local statics; ggc_collect after reading;
1642         do not mark reachable node.
1643         (materialize_cgraph): Do not announce function.
1645 2010-05-11  Jan Hubicka  <jh@suse.cz>
1647         * lto.c (materialize_cgraph): Revert my previous patch.
1649 2010-05-11  Kai Tietz  <kai.tietz@onevision.com>
1651         * lto-coff.c (IMAGE_FILE_MACHINE_ADM64): Rename to
1652         IMAGE_FILE_MACHINE_AMD64.
1653         * lto-coff.c (IMAGE_FILE_MACHINE_ADM64): Likewise.
1655 2010-05-11  Jan Hubicka  <jh@suse.cz>
1657         * lto.c (lto_fixup_decls): Remove global var decls freeing here.
1658         (materialize_cgraph): Add it here.
1660 2010-05-11  Jan Hubicka  <jh@suse.cz>
1662         * lto.c (lto_fixup_decls): Free no longer needed lto_global_var_decls
1663         vector.
1665 2010-05-11  Jan Hubicka  <jh@suse.cz>
1667         * lto.c (lto_1_to_1_map): Remove some no longer needed checks.
1668         (lto_promote_cross_file_statics): Never promote DECL_EXTERNAL;
1669         use reachable_from_other_partition_p and
1670         referenced_from_other_partition_p test.
1672 2010-05-11  Kai Tietz  <kai.tietz@onevision.com>
1674         * lto-coff.c (validate_file): Add x64-coff support.
1675         * lto-coff.h (IMAGE_FILE_MACHINE_ADM64): New.
1676         (COFF_KNOWN_MACHINES): Add IMAGE_FILE_MACHINE_ADM64.
1677         * lto-lang.c (lto_build_c_type_nodes): Add check for
1678         'long long unsigned int' for x64-windows.
1679         (lto_init): Likewise.
1682 2010-05-07  Steven Bosscher  <steven@gcc.gnu.org>
1684         * lto.h (struct lto_file_struct): Document offset member.
1685         * lto-endian.h: New file.
1686         * lto-macho.h: New file.
1687         * lto-macho.c: New file.
1688         * Make-lang.in: Add rule for lto-macho.o.
1690 2010-05-07  Richard Guenther <rguenther@suse.de>
1692         PR lto/43857
1693         PR lto/43371
1694         * lang.opt (fresolution): Change to ...
1695         (fresolution=): ... this.
1696         * lto-lang.c (lto_handle_option): Adjust.
1698 2010-05-07  Richard Guenther  <rguenther@suse.de>
1700         * lto.c (DUMPBASE_SUFFIX): Remove.
1701         (lto_execute_ltrans): Move functionality to lto-wrapper.c.
1702         Rename to ...
1703         (lto_write_ltrans_list): ... only output the list of ltrans files.
1704         (lto_maybe_unlink): Remove.
1705         (do_whole_program_analysis): Do not execute LTRANS phase
1706         from here.
1708 2010-05-06  H.J. Lu  <hongjiu.lu@intel.com>
1710         * lto-lang.c (lto_handle_option): Add argument kind.
1712 2010-05-05  Jan Hubicka  <jh@suse.cz>
1714         * lto.c (lto_promote_cross_file_statics): Compute boundary based on
1715         refs.
1717 2010-05-05  Jan Hubicka  <jh@suse.cz>
1719         * lto.c (lto_1_to_1_map): Partition only needed nodes.
1721 2010-04-30  Jan Hubicka  <jh@suse.cz>
1723         * lto.c (get_filename_for_set): Look for cgraph node and if none found,
1724         use default name.
1725         (lto_wpa_write_files): Write any non-empty partition.
1727 2010-04-30  Jan Hubicka  <jh@suse.cz>
1729         * lto.c: Do not attempt to make constant pool references global.
1731 2010-04-28  Jan Hubicka  <jh@suse.cz>
1733         * lto/lto.c (lto_read_in_decl_state): Use GGC.
1734         (lto_wpa_write_files): Announce what we are writting.
1735         (all_file_decl_data): New.
1736         (read_cgraph_and_symbols): Use GGC; correct timevars.
1737         (do_whole_program_analysis): Collect.
1738         * lto/Make-lang.in (lto.o): Fix dependency.
1739         * Makefile.in (GTFILES): Add lto-streamer.h.
1740         * varpool.c (varpool_analyze_pending_decls): Use TV_VARPOOL.
1741         (varpool_assemble_pending_decls): Use VAROUT.
1742         * lto-streamer.h (lto_tree_ref_table): Annotate.
1743         (lto_in_decl_state): Annotate.
1744         (lto_file_decl_data): Annotate.
1746 2010-04-28  Jan Hubicka  <jh@suse.cz>
1748         * lto.c (lto_varpool_node_sets): New.
1749         (lto_1_to_1_map): Partition varpool too.
1750         (globalize_context_t, globalize_cross_file_statics,
1751         lto_scan_statics_in_ref_table, lto_scan_statics_in_cgraph_node,
1752         lto_scan_statics_in_remaining_global_vars): Remove.
1753         (lto_promote_cross_file_statics): Rewrite.
1754         (get_filename_for_set): Take vset argument.
1755         (lto_wpa_write_files): Pass around vsets.
1757 2010-04-27  Dave Korn  <dave.korn.cygwin@gmail.com>
1759         PR lto/42776
1760         * Make-lang.in (LTO_OBJS): Use LTO_BINARY_READER instead of
1761         hardcoding 'lto-elf.o'.
1762         ($(LTO_EXE)): Use LTO_USE_LIBELF instead of hardcoding '-lelf'.
1764         * lto-coff.h: New file.
1765         * lto-coff.c: Likewise.
1767 2010-04-26  Richard Guenther  <rguenther@suse.de>
1769         * lto.c (lto_fixup_type): Deal with non-type TYPE_CONTEXT.
1771 2010-04-26  Dave Korn  <dave.korn.cygwin@gmail.com>
1773         * lto.h (lto_elf_file_open): Rename prototype from this ...
1774         (lto_obj_file_open): ... to this.
1775         (lto_elf_file_close): Likewise ...
1776         (lto_obj_file_close): ... and likewise.
1777         (lto_elf_build_section_table): Likewise ...
1778         (lto_obj_build_section_table): ... and likewise.
1779         (lto_elf_begin_section): Likewise ...
1780         (lto_obj_begin_section): ... and likewise.
1781         (lto_elf_append_data): Likewise ...
1782         (lto_obj_append_data): ... and likewise.
1783         (lto_elf_end_section): Likewise ...
1784         (lto_obj_end_section): ... and likewise.
1785         * lto.c (lto_file_read): Update references to the above.
1786         (lto_wpa_write_files): Likewise.
1787         (lto_read_all_file_options): Likewise.
1788         (read_cgraph_and_symbols): Likewise.
1789         * lto-lang.c (LANG_HOOKS_BEGIN_SECTION): Likewise.
1790         (LANG_HOOKS_APPEND_DATA): Likewise.
1791         (LANG_HOOKS_END_SECTION): Likewise.
1792         * lto-elf.c (lto_elf_file_open): Rename from this ...
1793         (lto_obj_file_open): ... to this, updating any references.
1794         (lto_elf_file_close): Likewise ...
1795         (lto_obj_file_close): ... and likewise.
1796         (lto_elf_build_section_table): Likewise ...
1797         (lto_obj_build_section_table): ... and likewise.
1798         (lto_elf_begin_section): Likewise ...
1799         (lto_obj_begin_section): ... and likewise.
1800         (lto_elf_append_data): Likewise ...
1801         (lto_obj_append_data): ... and likewise.
1802         (lto_elf_end_section): Likewise ...
1803         (lto_obj_end_section): ... and likewise.
1805 2010-04-21  Jan Hubicka  <jh@suse.cz>
1807         * lto.c (lto_fixup_tree): Do not call wpa fixup.
1808         (materialize_cgraph): Likewise.
1810 2010-04-21  Jan Hubicka  <jh@suse.cz>
1812         * lto.c (lto_wpa_write_files): Update.
1813         (read_cgraph_and_symbols): Be more verbose.
1814         (materialize_cgraph): Likewise.
1815         (do_whole_program_analysis): Likewise.
1817 2010-04-21  Jan Hubicka  <jh@suse.cz>
1819         * lto.c (globalize_cross_file_statics): When function has address taken,
1820         it needs to be public.
1822 2010-04-20  Jan Hubicka  <jh@suse.cz>
1824         * lto.c (lto_add_inline_clones): Do not track inlined_decls.
1825         (lto_add_all_inlinees): Likewise.
1826         (lto_wpa_write_files): Likewise.
1828 2010-04-18  Eric Botcazou  <ebotcazou@adacore.com>
1830         * lto-lang.c (lto_init): Remove second argument in call to
1831         build_common_tree_nodes.
1833 2010-04-16  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1835         * lto-elf.c [!HAVE_ELF_GETSHDRSTRNDX] (elf_getshdrstrndx): New
1836         function.
1838 2010-03-09  Eric Botcazou  <ebotcazou@adacore.com>
1840         PR bootstrap/43276
1841         * lto-elf.c: Define EM_* constants if not already defined.
1843 2010-03-03  Eric Botcazou  <ebotcazou@adacore.com>
1845         * lto-elf.c (is_compatible_architecture): New static function.
1846         (DEFINE_VALIDATE_EHDR): Use it to validate the architecture.
1848 2010-02-11  Richard Guenther  <rguenther@suse.de>
1850         PR driver/43021
1851         * lto-elf.c (lto_elf_file_open): Handle file@offset case more
1852         appropriately.
1854 2010-01-11  Andy Hutchinson  <hutchinsonandy@gcc.gnu.org>
1856         * lto.c (O_BINARY): Define.
1857         (lto_read_section_data): Open file in binary mode.
1858         * lto-elf.c (O_BINARY): Define.
1859         (lto_elf_file_open): Open file in binary mode. 
1861 2010-01-08  Richard Guenther  <rguenther@suse.de>
1863         PR lto/42528
1864         * lto-lang.c (lto_handle_option): Handle -f[un]signed-char.
1865         (lto_init): Do not init char_type_node in a standard way
1866         but according to flag_signed_char.
1868 2010-01-03  H.J. Lu  <hongjiu.lu@intel.com>
1870         PR lto/41564
1871         * lto.c (DUMPBASE_SUFFIX): New.
1872         (lto_execute_ltrans): Append a sequence number to -dumpbase
1873         for LTRANS.
1875 2010-01-02  H.J. Lu  <hongjiu.lu@intel.com>
1877         PR lto/42580
1878         * lto-elf.c (lto_elf_file_open): Stop if the command line
1879         option file is missing.
1881 2009-12-15  Richard Guenther  <rguenther@suse.de>
1883         * lto.c (lto_fixup_field_decl): Fixup DECL_FIELD_OFFSET.
1884         (lto_post_options): Do not disable debuginfo.
1886 2009-12-14  Dmitry Gorbachev  <d.g.gorbachev@gmail.com>
1888         * Make-lang.in ($(LTO_EXE)): Use $(LINKER).
1890 2009-12-11  Richard Guenther  <rguenther@suse.de>
1892         PR lto/42037
1893         * lto.c (lto_resolution_read): Properly grow the vector.
1895 2009-12-11  Richard Guenther  <rguenther@suse.de>
1897         PR lto/41915
1898         * lto-lang.c (lto_init_options): Initialize flag_complex_method
1899         to the C99 default.  Do not set flag_unit_at_a_time.
1901 2009-11-28  Jakub Jelinek  <jakub@redhat.com>
1903         * lto-lang.c (handle_nonnull_attribute): Remove unused attr_arg_num
1904         variable.
1906 2009-11-19  Rafael Avila de Espindola  <espindola@google.com>
1908         PR bootstrap/42096
1909         * lto-elf.c (lto_elf_file_open): Use lto_parse_hex.
1910         * lto.c (lto_parse_hex): New.
1911         (lto_resolution_read): Use lto_parse_hex.
1912         * lto.h (lto_parse_hex): New.
1914 2009-11-17  Rafael Avila de Espindola  <espindola@google.com>
1916         * lto-elf.c (lto_file_init): Add offset argument.
1917         (lto_elf_file_open): Record the offset.
1918         * lto.c (lto_resolution_read): Change file_name into a lto_file
1919         argument. Check offsets.
1920         (lto_file_read): Update call to lto_resolution_read.
1921         * lto.h (lto_file_struct): Add the offset field.
1923 2009-11-16  Rafael Avila de Espindola  <espindola@google.com>
1925         * lto-elf.c (lto_elf_file_open): Use strtoll to parse the offset.
1927 2009-11-14  Jan Hubicka  <jh@suse.cz>
1929         * lto.c (read_cgraph_and_symbols): Set also ipa_transforms_to_apply.
1931 2009-11-12  Rafael Avila de Espindola  <espindola@google.com>
1933         * lang.opt (fresolution): Renamed from resolution.
1934         * lto-lang.c (lto_handle_option): Handle new option name.
1935         * lto.c (lto_resolution_read): Add more checks. Discard rest of line.
1937 2009-11-04  Richard Guenther  <rguenther@suse.de>
1938             Rafael Avila de Espindola  <espindola@google.com>
1940         * lto-elf.c (lto_elf_build_section_table): Add the base offset.
1941         (lto_elf_file_open): Handle offsets in arguments name@offest.
1943 2009-10-30  Richard Guenther  <rguenther@suse.de>
1945         PR lto/41858
1946         * lto.c (lto_file_read): Do not set file_data->fd.
1947         (lto_read_section_data): Use a single-entry file-descriptor cache.
1948         Do not check the result of xmalloc.
1949         (free_section_data): Do not use file_data->fd.
1950         (lto_read_all_file_options): Likewise.
1952 2009-10-22  Richard Guenther  <rguenther@suse.de>
1954         * lto.c (lto_fixup_jump_functions): Remove.
1955         (lto_fixup_decls): Do not fixup jump functions.
1956         (read_cgraph_and_symbols): Schedule cgraph merging after
1957         summary reading.  Schedule type and decl fixup before
1958         summary reading.
1960 2009-10-22  Richard Guenther  <rguenther@suse.de>
1962         * lto.c (lto_fixup_data_t): Remove free_list member.
1963         (lto_fixup_tree): Do not insert into free_list.
1964         (free_decl): Remove.
1965         (lto_fixup_decls): Remove free-list handling.
1967 2009-10-22  Jan Hubicka  <jh@suse.cz>
1969         * lto.c (lto_fixup_jump_functions): New function.
1970         (lto_fixup_decls): Use it.
1972 2009-10-16  Richard Guenther  <rguenther@suse.de>
1974         PR lto/41715
1975         * lto.c (lto_fixup_tree): Revert last change.
1977 2009-10-14  Richard Guenther  <rguenther@suse.de>
1979         * lto.c (lto_fixup_tree): In case the prevailing decl is not
1980         compatible with the one we replace wrap it around a
1981         VIEW_CONVERT_EXPR.
1983 2009-10-09  Richard Guenther  <rguenther@suse.de>
1985         PR lto/41635
1986         PR lto/41636
1987         * lto.c (read_cgraph_and_symbols): Do not assert we can open
1988         a file.
1989         * lto-elf.c (init_shdr##BITS): Fix i18n problems.
1990         (init_ehdr##BITS): Likewise.
1992 2009-10-08  Joseph Myers  <joseph@codesourcery.com>
1994         * lto-elf.c (init_shdr##BITS, lto_elf_begin_section_with_type,
1995         init_ehdr##BITS, lto_elf_file_close): Remove trailing "." from
1996         diagnostics.
1997         * lto-lang.c (lto_post_options): Remove trailing "." from
1998         diagnostics.
2000 2009-10-08  Richard Guenther  <rguenther@suse.de>
2002         * lto.c (read_cgraph_and_symbols): Free the gimple type merging
2003         hash tables.
2005 2009-10-07  Joseph Myers  <joseph@codesourcery.com>
2007         * lto.c: Only include <sys/mman.h> if HAVE_MMAP_FILE.
2009 2009-10-07  Jan Hubicka  <jh@suse.cz>
2011         * lto.c (read_cgraph_and_symbols): Mark functions neccesary only at
2012         ltrans stage; explain why this is needed and should not.
2014 2009-10-05  Richard Guenther  <rguenther@suse.de>
2016         PR lto/41552
2017         PR lto/41487
2018         * lto.c (lto_read_decls): Do not register deferred decls.
2019         (read_cgraph_and_symbols): Delay symbol and cgraph merging
2020         until after reading the IPA summaries.
2022 2009-10-02  Rafael Avila de Espindola  <espindola@google.com>
2024         * Make-lang.in (lto/lto-lang.o): Don't depend on lto/common.h.
2025         (lto-lang.c): Don't include lto/common.h.
2027 2009-10-02  Rafael Avila de Espindola  <espindola@google.com>
2029         * Make-lang.in (LTO_OBJS): Remove lto/common.o.
2030         (lto/common.o): Remove.
2031         * common.c: Remove.
2032         * common.h (lto_kind_str): Remove.
2033         (lto_visibility_str): Remove.
2034         (lto_resolution_str): Make it static.
2036 2009-10-01  Diego Novillo  <dnovillo@google.com>
2038         * lto.c (lto_read_decls): Add comment.
2039         Call internal_error instead of gcc_assert.
2040         (lto_resolution_read): Likewise.
2041         (lto_add_all_inlinees): Tidy.
2042         * Make-lang.in: Fix copyright boilerplate.
2043         (lto.pdf): New.
2044         (lto.install-pdf): New.
2045         * lto-tree.h: Fix copyright boilerplate.
2046         * lang-specs.h: Likewise.
2047         Remove ".lto" entry from compilers fragment.
2048         * lto-elf.c: Move inclusion of gelf.h after config.h.
2049         Tidy formatting everywhere.
2050         * lto.h: Fix copyright boilerplate.
2051         Tidy formatting everywhere.
2052         * common.c: Likewise.
2053         * config-lang.in: Likewise.
2054         * common.h: Likewise.
2055         * lto-lang.c: Likewise.
2057 2009-10-01  Richard Guenther  <rguenther@suse.de>
2059         * lto.c (lto_read_section_data): Use plain lseek/read.
2061 2009-10-01  Richard Guenther  <rguenther@suse.de>
2063         * lto.c (LTO_MMAP_IO): Define if we can mmap files and
2064         use sysconf to query the system page size.
2065         (lto_file_read): Implement fallback using stdio.
2066         (free_section_data): Likewise.
2068 2009-09-29  Diego Novillo  <dnovillo@google.com>
2070         * lto-lang.c (lto_init): Really fix call to
2071         build_common_builtin_nodes.
2073 2009-09-29  Diego Novillo  <dnovillo@google.com>
2075         * lto-lang.c (lto_init): Fix call to
2076         build_common_builtin_nodes.
2078 2009-09-29  Richard Guenther  <rguenther@suse.de>
2080         PR lto/40754
2081         * lto-elf.c (init_shdr##BITS): Properly specify alignment
2082         in bytes.
2083         (first_data_block): New static variable.
2084         (lto_elf_append_data): Align the first data block in each
2085         section.
2087 2009-09-28  Diego Novillo  <dnovillo@google.com>
2089         * lto-lang.c: Tidy.  Remove stale FIXME lto markers.
2090         * lto.c (strip_extension): New.
2091         (get_filename_for_set): Call it.  Do not call make_cwd_temp_file.
2092         (lto_execute_ltrans): Tidy.
2093         Do not pass -fwpa nor -fltrans-* to LTRANS.
2094         * opts.c: Tidy formatting and remove stale FIXME lto markers.
2095         * tree.c (need_assembler_name_p): Call
2096         lang_hooks.decls.may_need_assembler_name_p if set.
2097         * varasm.c (default_binds_local_p_1): Remove check for
2098         flag_ltrans.
2099         * varpool.c (decide_is_variable_needed): Do not test for
2100         in_lto_p.
2102 2009-09-22  Richard Guenther  <rguenther@suse.de>
2104         PR lto/39276
2105         * lto.c (lto_execute_ltrans): Perform ltrans phase manually.
2106         * Make-lang.in: Remove ltrans-driver stuff.
2107         * config-lang.in: Likewise.
2108         * lang.opt (fltrans-driver): Remove.
2109         * lto-lang.c (lto_init_options): Remove code initializing
2110         ltrans_driver.
2111         * ltrans-driver: Remove.
2113 2009-09-21  Diego Novillo  <dnovillo@google.com>
2115         * lto-lang.c (lto_define_builtins): Remove superfluous
2116         calls to targetm.init_builtins and build_common_builtin_nodes.
2117         (lto_init): Add targetm.arm_eabi_unwinder as parameter to
2118         build_common_builtin_nodes.
2119         * lto.c (lto_materialize_function): Do nothing if NODE is a
2120         clone.
2122 2009-09-03  Diego Novillo  <dnovillo@google.com>
2124         * lto-elf.c (validate_file): Replace call to
2125         elf_getshstrndx with call to elf_getshdrstrndx.
2127 2009-08-19  Richard Guenther  <rguenther@suse.de>
2129         * lto-lang.c (lto_init): Merge char_type_node with the
2130         appropriately signed variant.
2132 2009-08-19  Richard Guenther  <rguenther@suse.de>
2134         PR lto/41071
2135         * lto.c (lto_fixup_common): Re-build the pointer-to chain part one.
2136         (lto_fixup_type): Re-build the pointer-to chain part two.
2138 2009-08-19  Richard Guenther  <rguenther@suse.de>
2140         PR lto/41071
2141         * lto.c (lto_fixup_type): Re-build the type variant chain.
2143 2009-08-19  Richard Guenther  <rguenther@suse.de>
2145         PR lto/41071
2146         * lto.c (lto_fixup_constructor): New function.
2147         (lto_fixup_tree): Replace all types.  Properly fixup
2148         constructors and constants.
2150 2009-08-14  Richard Guenther  <rguenther@suse.de>
2152         * lto.c (read_cgraph_and_symbols): Exchange TREE_CHAIN use
2153         for DECL_LANG_SPECIFIC.
2155 2009-08-13  Richard Guenther  <rguenther@suse.de>
2157         PR lto/41032
2158         * lto-lang.c (LANG_HOOKS_TYPES_COMPATIBLE_P): Define to NULL.
2160 2009-07-30  Richard Guenther  <rguenther@suse.de>
2162         PR lto/40903
2163         * lto.c (read_cgraph_and_symbols): After fixing up decls choose
2164         the largest decl for output and free TREE_CHAIN for further
2165         use.
2167 2009-07-24  Diego Novillo  <dnovillo@google.com>
2169         * Make-lang.in: Add empty lto.install-plugin target.
2171 2009-07-13  Diego Novillo  <dnovillo@google.com>
2173         * lto.c (lto_fixup_tree): Handle IMPORTED_DECL.
2175 2009-07-11  Richard Guenther  <rguenther@suse.de>
2177         * lto-lang.c (lto_write_globals): Wrapup global decls.
2179 2009-07-10  Richard Guenther  <rguenther@suse.de>
2181         * lto-lang.c (lto_init): Allocate one more location to make
2182         BUILTINS_LOCATION correct.
2184 2009-07-09  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
2186         * lto.c (free_section_data): Cast computed_offset to caddr_t.
2188 2009-07-06  Diego Novillo  <dnovillo@google.com>
2190         * lto.c (lto_fixup_type): Fixup TYPE_SIZE and
2191         TYPE_SIZE_UNIT.
2193 2009-07-06  Diego Novillo  <dnovillo@google.com>
2195         * lto.c (preload_common_nodes): Remove.
2196         (lto_read_in_decl_state): Call lto_streamer_cache_get.
2197         (lto_read_decls): Call lto_data_in_create and
2198         lto_data_in_delete.
2199         (free_decl): Do not call ggc_free.
2200         (lto_main): Call lto_init_reader.
2201         * lto-lang.c (lto_type_for_size): Handle intTI_type_node.
2202         (lto_init): Initialize main_identifier_node if needed.
2203         Make ptrdiff_type_node be integer_type_node.
2205 2009-06-19  Diego Novillo  <dnovillo@google.com>
2207         * lto.c: Remove code guarded by #ifdef LTO_STREAM_DEBUGGING.
2208         Remove code guarded by #ifdef GLOBAL_STREAMER_TRACE.
2209         Remove code guarded by #ifdef LOCAL_TRACE.
2211 2009-06-18  Diego Novillo  <dnovillo@google.com>
2213         * lto.c: Update license to GPLv3.
2214         * lto-elf.c: Likewise.
2215         * common.c: Likewise.
2216         * lto-lang.c: Likewise.
2217         * lto.h: Remove superfluous include files.  Update all
2218         users.
2220 2009-06-17  Diego Novillo  <dnovillo@google.com>
2222         * lto.c (read_cgraph_and_symbols): Call input_cgraph.
2224 2009-06-02  Diego Novillo  <dnovillo@google.com>
2226         * lto.c (lto_1_to_1_map): Ignore nodes that have not been
2227         read in.
2228         (materialize_cgraph): Only materialize nodes that have a
2229         representation on file.
2231 2009-06-01  Diego Novillo  <dnovillo@google.com>
2233         * lto-lang.c (lto_handle_option): Hanlde OPT_Wabi.
2235 2009-05-31  Diego Novillo  <dnovillo@google.com>
2237         * lto-lang.c (lto_type_for_mode): Handle all the modes
2238         handled in c_common_type_for_mode.
2240 2009-05-21  Diego Novillo  <dnovillo@google.com>
2242         * lto-elf.c: Always include <gelf.h>.
2243         * config-lang.in (target_libs): Remove.
2244         (build_by_default): Set to no.
2246 2009-05-15  Diego Novillo  <dnovillo@google.com>
2248         * lto.c (lto_materialize_function): Assert that DECL is
2249         not a builtin.
2250         (materialize_cgraph): Don't try to materialize builtin
2251         functions.
2252         * lto-section-out.c (write_symbol_vec): Do not write
2253         builtin functions.
2255 2009-05-13  Diego Novillo  <dnovillo@google.com>
2257         * lto-lang.c (LANG_HOOKS_GET_ALIAS_SET): Define.
2259 2009-05-07  Diego Novillo  <dnovillo@google.com>
2261         * lto.c (lto_resolution_read): Add type casts for C++ warnings.
2262         (LTO_REGISTER_TYPE_AND_FIXUP_SUBTREE): Define.
2263         (lto_fixup_type): Call it for TYPE_POINTER_TO,
2264         TYPE_REFERENCE_TO, TYPE_CONTEXT and TYPE_CANONICAL.
2265         (lto_fixup_tree): Call gimple_register_type when *TP is a
2266         type.
2267         (lto_main): Call bitmap_obstack_initialize.
2269 2009-04-22  Diego Novillo  <dnovillo@google.com>
2271         * lto.c (free_section_data): Tidy.
2272         (lto_1_to_1_map): Tidy.
2273         (lto_add_all_inlinees): Tidy.
2274         (prefix_name_with_star): New.
2275         (get_filename_for_set): New.
2276         (lto_wpa_write_files): Call cgraph_node_set_needs_ltrans_p
2277         to determine what cgraph node sets to write.
2278         Call get_filename_for_set to compute temporary file
2279         names.
2280         (lto_execute_ltrans): Do not execute LTRANS on files with
2281         names that start with '*'.
2282         Move logic to execute LTRANS together so that LTRANS is
2283         invoked only if there are any files to compile.
2284         (do_whole_program_analysis): Only remove output files
2285         that do not start with '*'.
2287 2009-04-06  Diego Novillo  <dnovillo@google.com>
2289         * lto-lang.c (lto_post_options): Set flag_excess_precision_cmdline.
2290         * lto.c (read_cgraph_and_symbols): Set cgraph_function_flags_ready.
2291         (lto_add_all_inlinees): Tidy.
2293 2009-03-26  Diego Novillo  <dnovillo@google.com>
2295         * lto.c: Include gimple.h.
2296         (lto_read_in_decl_state): Call gimple_register_type for
2297         every type in every stream.
2298         (lto_fixup_common): Call gimple_register_type if T has a
2299         type.
2300         (do_whole_program_analysis): Call print_lto_report.
2301         (lto_main): Call print_lto_report after cgraph_optimize.
2302         * Make-lang.in (lto.o): Add dependency on GIMPLE_H.
2304 2009-03-24  Diego Novillo  <dnovillo@google.com>
2306         * Make-lang.in (lto-lang.o): Add dependency on TARGET_H and EXPR_H.
2307         (lto.o): Add dependency on GIMPLE_H.
2309 2009-03-10  Simon Baldwin  <simonb@google.com>
2311         * lto.c (lto_read_all_file_options): Close any open file descriptor
2312         contained in file_data before freeing.
2314 2009-02-24  Rafael Avila de Espindola  <espindola@google.com>
2316         * lto.c (lto_add_inline_clones): Don't add the master clone. Check
2317         for a decl in the original bitmap, not a node.
2318         (lto_add_all_inlinees): Remove original nodes that are not needed.
2319         (lto_scan_statics_in_cgraph_node): Don't care if the node is the master.
2321 2009-02-24  Diego Novillo  <dnovillo@google.com>
2323         * lto.c (lto_materialize_function): Update
2324         lto_stats.num_function_bodies.
2325         (get_section_data): Initialize *LEN to 0.
2326         (lto_1_to_1_map): Update lto_stats.num_cgraph_partitions.
2327         (lto_wpa_write_files): Update lto_stats.num_cgraph_nodes.
2328         Update lto_stats.num_output_files.
2329         (read_cgraph_and_symbols): Update lto_stats.num_input_files.
2330         (materialize_cgraph): Update lto_stats.num_input_cgraph_nodes.
2331         (lto_main): Initialize lto_stats.
2332         If flag_lto_report is set, call print_lto_report.
2334 2009-02-19  Diego Novillo  <dnovillo@google.com>
2336         Revert
2338         2009-02-19  Rafael Avila de Espindola  <espindola@google.com>
2340                 * lto.c (lto_add_inline_clones): Don't add the
2341                 master clone. Check for a decl in the original
2342                 bitmap, not a node.
2343                 (lto_add_all_inlinees): Remove original nodes
2344                 that are not needed.
2345                 (lto_scan_statics_in_cgraph_node): Don't care if
2346                 the node is the master.
2347                 (lto_promote_cross_file_statics): Use a new
2348                 context.seen_node_decls for each set
2350 2009-02-19  Rafael Avila de Espindola  <espindola@google.com>
2352         * lto.c (lto_add_inline_clones): Don't add the master clone. Check
2353         for a decl in the original bitmap, not a node.
2354         (lto_add_all_inlinees): Remove original nodes that are not needed.
2355         (lto_scan_statics_in_cgraph_node): Don't care if the node is the master.
2356         (lto_promote_cross_file_statics): Use a new context.seen_node_decls
2357         for each set
2359 2009-02-18  Diego Novillo  <dnovillo@google.com>
2361         * lto.c (lto_wpa_write_files): Use timers TV_WHOPR_WPA
2362         and TV_WHOPR_WPA_IO.
2363         (lto_execute_ltrans): Use timer TV_WHOPR_WPA_LTRANS_EXEC.
2364         (read_cgraph_and_symbols): Use timer TV_IPA_LTO_DECL_IO.
2365         (materialize_cgraph): Use timer TV_IPA_LTO_GIMPLE_IO.
2366         Use timer TV_WHOPR_WPA or TV_WHOPR_LTRANS or TV_LTO
2367         depending on command line flags.
2368         (do_whole_program_analysis): Use timer TV_WHOPR_WPA.
2369         (lto_main): Remove timer uses.
2371 2009-02-18  Rafael Avila de Espindola  <espindola@google.com>
2373         * lto.c (lto_materialize_function): Don't set DECL_EXTERN to 0.
2374         (lto_wpa_write_files): Update calls to renamed functions.
2376 2009-02-17  Diego Novillo  <dnovillo@google.com>
2378         PR 39203
2379         * lto-lang.c (lto_post_options): Disable -fwhole-program
2380         when running LTRANS.
2382 2009-02-10  Diego Novillo  <dnovillo@google.com>
2384         * lto.c (read_cgraph_and_symbols): Fix comment.
2386 2009-02-10  Diego Novillo  <dnovillo@google.com>
2388         * lto.c (read_cgraph_and_symbols): Read options from all
2389         IL files.
2391 2009-02-10  Diego Novillo  <dnovillo@google.com>
2393         * lto.c (read_cgraph_and_symbols): Factor out of lto_main.
2394         (materialize_cgraph): Likewise.
2395         (do_whole_program_analysis): Likewise.
2396         (lto_main): Call read_cgraph_and_symbols,
2397         materialize_cgraph and do_whole_program_analysis.
2399 2009-02-10  Simon Baldwin  <simonb@google.com>
2401         * lto.c: Include lto-opts.h.
2402         * (lto_main): Clear file options at loop start, read any saved
2403         options from the first file handled, and re-issue options.
2404         * Makefile.in (lto.o): Add dependency on lto-opts.h.
2406 2009-02-02  Diego Novillo  <dnovillo@google.com>
2408         * lto.c (lto_main): Stop LTO_TIMER and use
2409         TV_WHOPR_WPA_LTRANS_EXEC when launching LTRANS.
2411 2009-01-30  H.J. Lu  <hongjiu.lu@intel.com>
2413         PR lto/38995
2414         * lto-elf.c (init_shdr##BITS): Set the sh_addralign field
2415         to POINTER_SIZE.
2417 2009-01-29  Ramana Radhakrishnan  <ramana.r@gmail.com>
2419         * Make-lang.in (LTO_EXE): Link with all 
2420         BACKENDLIBS and not only GMPLIBS
2422 2009-01-28  H.J. Lu  <hongjiu.lu@intel.com>
2424         PR bootstrap/38992
2425         * lto-elf.c: Include gelf.h instead of libelf.h.
2426         (lto_elf_file_close): Replace elfx_update_shstrndx with
2427         gelf_getehdr, elf_getscn, gelf_getshdr, gelf_update_shdr and
2428         gelf_update_ehdr.
2430 2009-01-28  H.J. Lu  <hongjiu.lu@intel.com>
2432         PR middle-end/38996
2433         * lto-elf.c (DEFINE_INIT_EHDR): Initialize e_version.
2435 2009-01-26  Diego Novillo  <dnovillo@google.com>
2437         * lto-lang.c (LANG_HOOKS_TYPES_COMPATIBLE_P): Update.
2439 2009-01-26  Diego Novillo  <dnovillo@google.com>
2441         * lto-lang.c (lto_types_compatible_p): Move to gimple.c
2442         and rename into gimple_types_compatible_p.
2444 2009-01-12  Rafael Avila de Espindola  <espindola@google.com>
2446         * lto-lang.c (lang_hooks): Remove the const qualifier.
2448 2009-01-06  Diego Novillo  <dnovillo@google.com>
2450         * ltrans-driver: Mark 'all' target as phony.
2452 2008-12-31  Diego Novillo  <dnovillo@google.com>
2454         * ltrans-driver: Execute a NOP action for target 'all'.
2456 2008-12-19  Diego Novillo  <dnovillo@google.com>
2458         * lto.c (lto_1_to_1_map): Tidy.
2460 2008-12-19  Diego Novillo  <dnovillo@google.com>
2462         * lto-elf.c (lto_elf_file_open): When FILENAME cannot
2463         be opened, show its name.
2464         * ltrans-driver: If $verbose is set, do not use parallelism.
2466 2008-12-17  Rafael Avila de Espindola  <espindola@google.com>
2468         * lto.c (lto_fixup_function): New.
2469         (lto_fixup_tree): Call lto_fixup_function.
2471 2008-12-14  Doug Kwan  <dougkwan@google.com>
2473         * lto.c (lto_1_to_1_map): Create a cgraph node set for any global
2474         variables if there is no function.
2476 2008-12-10  Simon Baldwin  <simonb@google.com>
2478         * ltrans-driver: Always run make in silent mode, to avoid make's
2479         trace on stdout interfering with lto-wrapper output.
2481 2008-12-10  Doug Kwan  <dougkwan@google.com>
2483         * lto.c (lto_add_inline_clones): Do not force master clones of
2484         inlined functions already in SET to be static inline.
2486 2008-12-04  Doug Kwan  <dougkwan@google.com>
2488         * lto.c (globalize_context_t): New type to store states in
2489         globalization of cross-file statics.
2490         (globalize_cross_file_statics): New.
2491         (lto_scan_statics_in_ref_table): Walk tree to look for reachable
2492         static decls that need to be fixed up.
2493         (lto_scan_statics_in_cgraph_node): Change call interface to use
2494         a globalize_context_t CONTEXT for all states used.
2495         (lto_scan_statics_in_remaining_global_vars): New.
2496         (lto_promote_cross_file_statics): Use new call interface of
2497         LTO_SCAN_STATICS_IN_CGRAPH_NODE.  Handle remaining externally
2498         visible vars in the last set.
2500 2008-12-03  Diego Novillo  <dnovillo@google.com>
2502         * lto.c (lto_fixup_tree): Do not emit an error when
2503         PREVAILING throw but T doesn't.
2505 2008-12-02  Doug Kwan  <dougkwan@google.com>
2507         * lto.c (lto_scan_statics_in_ref_table): New function factored out
2508         from code in ...
2509         (lto_scan_statics_in_cgraph_node): Handle both file-scope static
2510         variables and functions.
2511         (lto_promote_cross_file_statics): Rename bitmaps to SEEN_DECLS
2512         and GLOBAL_DECLS from SEEN_VARS and GLOBAL_VARS.
2514 2008-11-29  Diego Novillo  <dnovillo@google.com>
2516         * lto.c: Include timevar.h.
2517         (lto_materialize_function): Tidy.  Add comments.
2518         (lto_wpa_write_files): Tidy.
2519         (lto_execute_ltrans): Tidy.
2520         (lto_main): Add local variable LTO_TIMER.  Initialize it
2521         to one of TV_WHOPR_WPA, TV_WHOPR_LTRANS or TV_LTO.
2522         Start and stop the timer.
2523         Tidy comments.
2524         * Make-lang.in (lto.o): Add dependency on timevar.h.
2525         * ltrans-driver: React to -v and -save-temps.
2526         Use simple heuristic to determine how much parallelism to
2527         use when executing make.
2529 2008-11-12  Doug Kwan  <dougkwan@google.com>
2531         * lto.c (lto_bitmap_obstack): Remove var.
2532         (lto_materialize_function): Do nothing instead of marking function
2533         body in file if flag_wpa is true.
2534         (lto_add_all_inlinees): Use bitmap functions in lto-utils.c.
2535         (lto_scan_statics_in_cgraph_node): New function.
2536         (lto_promote_cross_file_statics): Same.
2537         (lto_wpa_write_files): Call lto_promote_cross_file_statics.
2538         Use bitmap functions in lto-utils.c.  Remove unsued label OUT.
2539         * Make-lang.in (lto/lto.o): Add lto-utils.h to dependency list.
2541 2008-11-09  Diego Novillo  <dnovillo@google.com>
2543         * lto/lto.c (lto_fixup_tree): Change error message locus
2544         information to include location of mismatching
2545         declaration.
2546         Use TREE_NO_WARNING to avoid repeated messages.
2547         (lto_main): If lto_fixup_decls emitted any errors, exit.
2548         * lto/lto-lang.c: Don't include libfuncs.h and except.h
2549         (lto_init_options): Don't enable exceptions by default.
2550         (lto_eh_runtime_type): Move to lto-function-in.c
2551         (lto_init_eh): Likewise.
2552         (lto_init): Don't call lto_init_eh.
2553         * lto/Make-lang.in (lto-lang.o): Remove dependency on
2554         libfuncs.h and except.h.
2556 2008-10-30  Diego Novillo  <dnovillo@google.com>
2558         * lto.c (lto_read_decls): Declare debug_main only if
2559         LTO_STREAM_DEBUGGING is enabled.
2561 2008-10-30  Simon Baldwin  <simonb@google.com>
2563         * lto.c (lto_wpa_write_files): Create intermediate files with
2564         make_cwd_temp_file().
2565         (lto_maybe_unlink): New.  Delete intermediate WPA files unless
2566         WPA_SAVE_LTRANS is set.
2567         (lto_main): Call lto_maybe_unlink() for intermediate WPA files.
2568         * ltrans-driver: Do not strip directory from output files.
2570 2008-10-29  Doug Kwan  <dougkwan@google.com>
2572         * lto.c (free_decl): Call lto_symtab_clear_resolution when freeing
2573         DECL.
2574         * Make-lang.in (LTO_OBJS): Remove lto/lto-symtab.o
2575         (lto/lto-symtab.o): Remove rule.
2576         * lto-tree.h (struct lang_identifier): Remove LTO specific fields.
2577         (struct lang_decl): Remove RESOLUTION and add DUMMY in struct.
2578         (LANG_IDENTIFIER_CAST, LTO_IDENTIFIER_DECL, LTO_DECL_RESOLUTION):
2579         Remove macros.
2580         lto-symtab.c (File): Move up one level.
2581         lto-lang.c (cgraph.h): Remove include.
2582         (input_overwrite_node, input_node, input_edge, input_cgraph_1,
2583         input_cgraph): Move to lto-cgraph.c in gcc directory above.
2584         (LANG_HOOKS_INPUT_CGRAPH): Remove use of macro.
2586 2008-10-24 Rafael Espindola  <espindola@google.com>
2588         * lto-function-in.c (get_resolution): Return LDPR_PREEMPTED_IR for
2589         non prevailing weak symbols.
2591 2008-10-24 Rafael Espindola  <espindola@google.com>
2593         * lto-lang.c (input_cgraph_1): Iterate over nodes, not cgraph_nodes.
2595 2008-10-24 Rafael Espindola  <espindola@google.com>
2597         * lto-lang.c (input_node): Avoid casts from pointers to ints of
2598         different types.
2600 2008-10-23  Simon Baldwin  <simonb@google.com>
2602         * lto-lang.c (input_node): Save the node reference, rather than the
2603         node pointer, in node->inlined_to.
2604         (input_cgraph_1): Convert node references into node pointers.
2606 2008-10-22  Diego Novillo  <dnovillo@google.com>
2607             Rafael Espindola  <espindola@google.com>
2609         * lto.c (lto_resolution_read): Tidy.
2610         * lto-symtab.c (lto_symtab_prevailing_decl): Do not
2611         abort if RET is NULL.
2613 2008-10-22  Doug Kwan  <dougkwan@google.com>
2615         * lto.c (lto_fixup_tree): Check for NOTHROW conflict only if
2616         exceptions flag is given.
2617         * lto-lang.c: (lto_init_options) Set default exceptions flag.
2618         (lto_init_eh): Remove exceptions flag initialization.
2619         (lto_init): Only call lto_init_eh if exceptions flag is set. 
2621 2008-10-21  Diego Novillo  <dnovillo@google.com>
2623         * lto.c: Tidy some formatting.
2624         * lto.h: Likewise.
2626 2008-10-21  Simon Baldwin  <simonb@google.com>
2628         * lto-symtab.c: (lto_same_type_p): Types cannot be equal if one of
2629         them is NULL (but not the other).
2631 2008-10-17  Diego Novillo  <dnovillo@google.com>
2633         * ltrans-driver: Divert output from make to a temporary file.
2634         Show it if the call to make failed.
2636 2008-10-15  Diego Novillo  <dnovillo@google.com>
2638         * lto.c (lto_wpa_write_files): Reformat do-while loop.
2639         Do not print TEMP_FILENAME
2640         * ltrans-driver: Call make with -s.
2642 2008-10-15  Diego Novillo  <dnovillo@google.com>
2644         * lto-symtab.c (lto_symtab_merge_decl): Do not force
2645         TREE_STATIC on global symbols.
2647 2008-10-14  Ollie Wild  <aaw@google.com>
2649         * Make-lang.in (LTRANS_DRIVER_INSTALL_NAME): Remove.
2650         (LTRANS_DRIVER_EXE): Add.
2651         (lto.all.cross): Add LTRANS_DRIVER_EXE.
2652         (lto.all.encap): Add LTRANS_DRIVER_EXE.
2653         (lto.install.common): Remove ltrans-driver.
2654         (lto.mostlyclean): Add LTRANS_DRIVER_EXE.
2655         (LTRANS_DRIVER_EXE): New build rule.
2656         * config-lang.in (compilers): Add ltrans-driver.
2658 2008-10-14  Diego Novillo  <dnovillo@google.com>
2660         * Make-lang.in (LTRANS_DRIVER_INSTALL_NAME): Disable transformation
2661         of program name.
2663 2008-10-13  Ollie Wild  <aaw@google.com>
2665         * lang-spec.h (@lto): Replace lto1_options with cc1_options.
2666         * lto.c (lto_execute_ltrans): Add "-fno-wpa -fltrans -xlto" to CFLAGS.
2667         * ltrans-driver (LTRANS_FLAGS): Remove.
2669 2008-10-08  Doug Kwan  <dougkwan@google.com>
2671         * lto.c (lto_fixup_tree): Remove ATTRIBUTE_UNUSED from DATA.
2672         Handle new tree codes RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE
2673         and TREE_BINFO.  Also move code handling FUNCTION_DECL and VAR_DECL
2674         from lto_fixup_state to here.
2675         (lto_fixup_state): Take an lto_fixup_data_t object DATA instead of
2676         just a free-list.  Fix up types also.  Move decl merging code to
2677         lto_fixup_tree.
2678         (lto_fixup_state_aux): Change AUX to point to an lto_fixup_data_t
2679         object.
2680         (lto_fixup_decls): Use another pointer set to avoid multiple
2681         walking of nodes except for DECLs to be replaced.  Pass an
2682         lto_fixup_data_t object to tree-walker.
2684 2008-10-08 Rafael Espindola  <espindola@google.com>
2686         * lto-symtab.c (lto_symtab_set_resolution): New.
2687         (lto_symtab_merge_decl): Use lto_symtab_set_resolution and
2688         lto_symtab_get_resolution.
2689         (lto_symtab_prevailing_decl): Return decl for non public decls.
2690         (lto_symtab_get_resolution): New.
2691         * lto.c (lto_fixup_tree, lto_fixup_state): Remove unecessary checks.
2693 2008-10-06 Rafael Espindola  <espindola@google.com>
2695         * lto-lang.c: Include cgraph.h.
2696         (input_overwrite_node, input_node, input_edge, input_cgraph_1,
2697         input_cgraph): Moved from lto-cgraph.c.
2698         (LANG_HOOKS_INPUT_CGRAPH): New.
2700 2008-10-03 Rafael Espindola  <espindola@google.com>
2702         * lto.c (lto_fixup_tree, lto_fixup_state): Fix the FIXME.
2704 2008-10-03 Rafael Espindola  <espindola@google.com>
2706         * lto-symtab.c (lto_symtab_overwrite_decl): Remove. Remove all calls.
2707         (lto_symtab_merge_decl): Update  LTO_IDENTIFIER_DECL the reflect the
2708         prevailing definition. Don't mark TREE_NOTHROW differences.
2709         * lto.c (lto_fixup_tree): New.
2710         (lto_fixup_state): New.
2711         (lto_fixup_state_aux): New.
2712         (free_decl): New.
2713         (lto_fixup_decls): New.
2714         (lto_main): Call lto_fixup_decls.
2716 2008-10-02  Ollie Wild  <aaw@google.com>
2718         * lang.opt (fltrans): Moved from common.opt.  Remove RejectNegative
2719         and Init.
2720         (fwpa): Moved from common.opt.  Remove RejectNegative and Init.
2721         * lto-lang.c (lto_post_options): Add validation and fixups for
2722         -fltrans and -fwpa.
2724 2008-10-02 Rafael Espindola  <espindola@google.com>
2726         * lto-symtab.c (lto_symtab_merge_var, lto_symtab_merge_fn,
2727         lto_symtab_merge_decl): Return void.
2728         (lto_symtab_prevailing_decl): New.
2730 2008-09-30 Rafael Espindola  <espindola@google.com>
2732         * lto-symtab.c (lto_symtab_compatible): Remove the check for already
2733         defined symbols.
2734         (lto_symtab_overwrite_decl): Copy LTO_DECL_RESOLUTION.
2735         (lto_symtab_merge_decl): Store symbol resolution in LTO_DECL_RESOLUTION.
2736         Check for already defined symbols.
2737         * lto-tree.h (lang_decl): Remove dummy and add resolution fields.
2738         (LTO_IDENTIFIER_RESOLUTION): Remove.
2739         (LTO_DECL_RESOLUTION): New.
2741 2008-09-30 Rafael Espindola  <espindola@google.com>
2743         * lto.c (lto_read_decls): Use new input_tree signature.
2745 2008-09-26  Doug Kwan  <dougkwan@google.com>
2747         * lto.c (lto_main): Call lto_fixup_nothrow_decls to fix up function
2748         bodies affected by exception attribute merging of DECLs.
2749         * lto-symtab.c (lto_symtab_merge_decl): Handle exception attribute
2750         merging. 
2752 2008-09-25  Rafael Espindola  <espindola@google.com>
2754         * Make-lang.in (PLUGIN_API_H, LTO_TREE_H): New.
2755         (lto/lto-lang.o, lto/lto.o, lto/lto-symtab.o) Use LTO_TREE_H.
2756         * lto-symtab.c (lto_symtab_compatible): New.
2757         (lto_symtab_overwrite_decl): New.
2758         (lto_symtab_merge_decl): Refactor to use the above functions
2759         and the resolution from lang_identifier.
2760         * lto-tree.h: Include plugin-api.h.
2761         (lang_identifier): Add resolution.
2762         (LTO_IDENTIFIER_RESOLUTION): New.
2764 2008-09-25  Ollie Wild  <aaw@google.com>
2766         * lang.opt (fltrans-output-list=): New option.
2767         * lto.c (lto_execute_ltrans): Output file names to ltrans_output_list.
2769 2008-09-25 Rafael Espindola  <espindola@google.com>
2771         * lto.c (lto_resolution_read): Initialize ret;
2773 2008-09-24  Ollie Wild  <aaw@google.com>
2775         * lto.c (sys/mman.h): Move include.
2776         (lto_wpa_write_files): Return a list of written files.
2777         (lto_execute_ltrans): New function.
2778         (lto_main): Call lto_execute_ltrans.
2779         (ltrans-driver): New file.
2780         * lto-lang.c (DEFAULT_LTRANS_DRIVER): New macro.
2781         (DEAULT_LTRANS_DRIVER_LEN): New macro.
2782         (lto_init_options): Initialize ltrans_driver.
2783         (lto_handle_option): Fix incorrect default output value.
2784         * lang.opt (fltrans-driver=): New option.
2785         * Make-lang.in (LTRANS_DRIVER_INSTALL_NAME): New variable.
2786         (lto.install-common): Add lto/ltrans-driver.
2788 2008-09-24 Rafael Espindola  <espindola@google.com>
2790         * Make-lang.in (LTO_OBJS): Add lto/common.o.
2791         (lto/lto.o): Depend on lto/common.h.
2792         (lto/common.o): New.
2793         * lang.opt (resolution): New.
2794         * lto-lang.c (resolution_file_name): New.
2795         (lto_handle_option): Handle OPT_resolution.
2796         * lto-symtab.c (lto_symtab_merge_decl): Add a resolution argument.
2797         (lto_symtab_merge_var,lto_symtab_merge_fn): Add a resolution argument.
2798         pass it to lto_symtab_merge_decl.
2799         * lto.c: Include common.h.
2800         (lto_read_decls): Add resolutions and resolutions_size arguments.
2801         Initialize data_in.globals_resolution and
2802         data_in.globals_resolution_size.
2803         (index_and_symbol_resolution): New.
2804         (lto_resolution_read): New.
2805         (lto_file_read): Add argument resolution_file.
2806         Read resolution.
2807         * lto.h (resolution_file_name): New.
2809 2008-09-23 Rafael Espindola  <espindola@google.com>
2811         * common.c: Update description.
2812         * common.h: Update description.
2814 2008-09-23 Rafael Espindola  <espindola@google.com>
2816         * common.c: Moved from lto-plugin.
2817         * common.h: Moved from lto-plugin.
2819 2008-09-22  Doug Kwan  <dougkwan@google.com>
2821         * lto.c (VEC(bitmap,heap)): Declare.
2822         (lto_materialize_function): Handle WAP mode specially.
2823         (lto_add_inline_clones): New.
2824         (lto_add_all_inlinees): Changle algorithm and to use bitmaps.  Also
2825         return a bitmap of inlined decls.
2826         (lto_wpa_write_files): Handle all DECLs brought in by inlining.
2827         (lto_main): Call reset_inline_failed to reset inlining states.
2828         Check call-graph after WPA inlining.
2829         * lto-lang.c (lto_init): Do not clear flag_generate_lto
2830         unconditionally.
2832 2008-09-19  Doug Kwan  <dougkwan@google.com>
2834         lto.c (lto_main): Remove unsued wrapper code.
2835         lang-specs.h (@lto): Use lto1_options instead of cc1_options.
2837 2008-09-19  Rafael Espindola  <espindola@google.com>
2839         * lto-symtab.c: Include lto-tree-in.h.
2840         * lto-tree.h (lto_symtab_merge_var, lto_symtab_merge_fn): Remove.
2841         * lto.h (lto_symtab_merge_var, lto_symtab_merge_fn): Remove
2842         * Make-lang.in (lto/lto-symtab.o): Add lto-tree-in.h.
2844 2008-09-17  Paolo Bonzini  <bonzini@gnu.org>
2845             Rafael Avila de Espindola  <espindola@google.com>
2847         * lto-lang.c (COMPOUND_LITERAL_EXPR_DECL_STMT,
2848         COMPOUND_LITERAL_EXPR_DECL): Remove.
2849         (emit_local_var): Remove.
2850         (lto_expand_expr): Remove.
2851         (lto_staticp): Remove.
2852         (LANG_HOOKS_EXPAND_EXPR): Remove.
2853         (LANG_HOOKS_STATICP): Remove.
2855 2008-09-11  Diego Novillo  <dnovillo@google.com>
2857         * lto-lang.c: Include except.h and libfuncs.h.
2858         (lto_init_eh): New.
2859         (lto_init): Call it.
2860         Set flag_generate_lto to 0.
2861         * Make-lang.in (lto-lang.o): Add dependency on except.h
2862         and libfuncs.h.
2864 2008-09-09  Bill Maddox  <maddox@google.com>
2866         * lto-lang.c: Include header file expr.h.
2867         (COMPOUND_LITERAL_EXPR_DECL_STMT,
2868         COMPOUND_LITERAL_EXPR_DECL): Copied from c-common.h.
2869         (emit_local_var):  Copied from c-semantics.c.
2870         (lto_expand_expr, lto_staticp): Copied from c_expand_expr
2871         and c_staticp in c-common.c.
2872         (LANG_HOOKS_EXPAND_EXPR,LANG_HOOKS_STATICP):  Redefined.
2874 2008-09-08  Diego Novillo  <dnovillo@google.com>
2876         * lto-lang.c (lto_global_bindings_p): Return 1 during
2877         IPA passes.
2879 2008-09-07  Diego Novillo  <dnovillo@google.com>
2881         * lto.c: Tidy formatting.
2883 2008-08-04  Bill Maddox  <maddox@google.com>
2885         * lto-symtab.c (lto_symtab_merge_decl): Add comment.
2886         
2887 2008-09-03  Doug Kwan  <dougkwan@google.com>
2889         lto.c (lto_add_all_inlinees): Reset FAILED_REASON of edges to
2890         CIF_OK instead of NULL.
2892 2008-09-02  Diego Novillo  <dnovillo@google.com>
2893             Simon Baldwin  <simonb@google.com>
2895         * lto-lang.c (lto_type_for_size): Rewrite.  Adapt from
2896         c_common_type_for_size.
2897         (lto_type_for_mode): Remove ATTRIBUTE_UNUSED markers.
2898         (lto_init): Call linemap_add.
2899         (signed_and_unsigned_types): Remove.
2901 2008-08-29  Diego Novillo  <dnovillo@google.com>
2903         * lto-lang.c (handle_noreturn_attribute): New local function.
2904         (handle_const_attribute): New local function.
2905         (handle_malloc_attribute): New local function.
2906         (handle_pure_attribute): New local function.
2907         (handle_novops_attribute): New local function.
2908         (handle_nonnull_attribute): New local function.
2909         (handle_nothrow_attribute): New local function.
2910         (handle_sentinel_attribute): New local function.
2911         (handle_type_generic_attribute): New local function.
2912         (handle_format_attribute): New local function.
2913         (handle_format_arg_attribute): New local function.
2914         (lto_attribute_table): Declare.
2915         (lto_format_attribute_table): Declare.
2916         (lto_init_attributes): New local function.
2917         (lto_define_builtins): Call it.
2918         Call targetm.init_builtins and build_common_builtin_nodes.
2919         (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE): Define.
2920         (LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE): Define.
2922 2008-08-28  Diego Novillo  <dnovillo@google.com>
2924         * Make-lang.in (lto-lang.o): Replace tree-gimple.h with
2925         $(GIMPLE_H).
2926         (lto-symtab.o): Add dependency on $(GIMPLE_H).
2927         * lto-lang.c: Include gimple.h instead of tree-gimple.h.
2928         * lto-symtab.c: Include gimple.h.
2929         * lto-tree.h (chain_next): Replace GENERIC_NEXT with
2930         TREE_CHAIN.
2932 2008-08-27  Doug Kwan  <dougkwan@google.com>
2934         * lto.c (vec.h, bitmap.h, pointer-set.h, ipa-prop.h, ggc.h,
2935         gt-lto-lto.h): New includes.
2936         (lto_materialize_function): Do not read in function body in WPA mode.
2937         Format a line to fit in 80 columns.
2938         (lto_cgraph_node_sets): New garbage collected variable.
2939         (lto_1_to_1_map, lto_add_all_inlinees, lto_wpa_write_files):
2940         New functions.
2941         (lto_main): Initialize bitmap obstack.  Add code to handle WPA mode.
2942         * Make-lang.in (LTO_H): Replace filename lto-section-in.h with 
2943         variable LTO_SECTION_IN_H.
2944         (lto/lto.o): Include gt-lto-lto-c.h ggc.h ,VEC_H, BITMAP_H,
2945         pointer-set.h and IPA_PROP_H. Also replace filename lto-section-in.h
2946         with variable LTO_SECTION_IN_H.
2947         * config-lang.in (gtfiles): Add lto/lto.c.
2948         * lto-symtab.c (lto_symtab_merge_decl): Set DECL_CONTEXT of
2949         merged DECL_RESULT correctly.
2951 2008-08-26  Bill Maddox  <maddox@google.com>
2953         * lto-lang.c  Include tree-gimple.h.
2954         (lto_mark_addressable): Call mark_addressable rather than
2955         asserting.
2956         (lto_post_options): Suppress debug info generation.
2957         * Make-lang.in: Add dependency of lto-lang.o on tree-gimple.h.
2958         
2959 2008-08-25  Bill Maddox <maddox@google.com>
2961         * lto-symtab.c (lto_symtab_merge_decl): Remove a suspect
2962         assertion and leave an explanatory comment in its place.
2963         
2964 2008-08-21  Doug Kwan  <dougkwan@google.com>
2966         * lto.c (preload_common_nodes): Call lto_get_common_nodes to get a list
2967         of common nodes instead of computing locallly.
2968         (lto_read_in_decl_state): New.
2969         (lto_read_decls): Change code for udpate in struct lto_decl_header.
2970         Read global and per-function in-decl states.
2971         * Make-lang.in (LTO_H): Update dependency.
2972         (lto/lto.o): Same.
2973         (lto-symtab.c): Merge   (revision 139039)
2974         * lto-symtab.c (lto_symtab_merge_decl): Merge DECL_RESULT.
2976 2008-08-21  Rafael Espindola  <espindola@google.com>
2978         * config-lang.in (target_libs): New.
2980 2008-08-20  Bill Maddox  <maddox@google.com>
2982         * lto.c (current_lto_file): Remove GTY marker from static
2983         variable.  Remove include of file gt-lto-lto.h.
2984         * Make-lang.in: Remove dependency of lto/lto.o on
2985         gt-lto-lto.h.
2986         * lto-elf.c (lto_file_close): Removed.
2987         (lto_elf_file_open): Use XCNEW instead of GGC_CNEW to
2988         allocate lto_elf_file object.
2989         (lto_elf_file_close): Free lto_elf_file object after close.
2990         * lto.h (struct lto_file_struct): Remove GTY marker.
2991         * config-lang.in: Remove lto/lto.h and lto/lto.c from
2992         gtfiles.
2993         
2994 2008-08-20  Bill Maddox  <maddox@google.com>
2996         * lto.c (lto_read_decls): Provide dummy argument to input_tree
2997         to conform to its new signature.
2998         * lto-symtab.c (lto_symtab_merge_decl): Do not invoke ggc_free
2999         on discarded node here, now called in global_vector_fixup.
3000         
3001 2008-08-09  Bill Maddox  <maddox@google.com>
3003         * lto.c (preload_common_nodes): Verify that fileptr_type_node
3004         has not been set to a front-end-specific value.
3005         
3006 2008-08-05  Doug Kwan  <dougkwan@google.com>
3007         
3008         * Make-lang.in (lto-symtab.o): Add missing dependencies to fix
3009         build breakage.
3011 2008-07-30  Bill Maddox  <maddox@google.com>
3013         * lto.c (lto_materialize_function): Call lto_original_decl_name.
3014         Remove obsolete comments.
3015         (lto_read_decls): Remove initialization of deleted field data_in.global.
3016         Tidy up comments.
3017         (lto_main): Remove redundant initialization of section_hash_table.
3018         * lto-elf.c: Removed obsolete comments.
3019         * lto.h: Tidy up comments.
3020         * lto-symtab.c (lto_least_common_multiple): New function.
3021         (lto_symtab_merge_decl): Merge variable alignments in some cases.
3022         Tidy up comments.
3024 2008-07-25  Diego Novillo  <dnovillo@google.com>
3025             Bill Maddox  <maddox@google.com>
3027         * lto.c: Re-order include files.
3028         Include lto-section-out.h.
3029         (preload_common_nodes): Add debugging output.
3030         Add new local INDEX_TABLE.
3031         Call preload_common_node.
3032         * Make-lang.in (lto.o): Add dependency on lto-section-out.h
3034 2008-07-13  Bill Maddox  <maddox@google.com>
3036         * lto.c (lto_read_decls): Cast pointer to const char * to avoid
3037         unwanted scaling during pointer addition.
3039 2008-07-11  Bill Maddox  <maddox@google.com>
3040             Diego Novillo  <dnovillo@google.com>
3042         * lto.c (lto_read_decls): Fix C++ compatibility warnings.
3043         Make code const-correct.
3044         (lto_file_read): Fix C++ compatibility warnings.
3045         (lto_read_section_data):  Fix C++ compatibility warnings.
3046         (lto_get_section_data): Use CONST_CAST to avoid warning when
3047         const pointer passed to free.
3048         * lto-elf.c (lto_elf_build_section_table): Fix C++
3049         compatibility warnings.
3050         (lto_elf_append_data):  Fix C++ compatibility warnings.  Use CONST_CAST
3051         to avoid warning assigning const pointer to d_buf field of Elf_Data.
3052         (lto_get_current_out_file):  Fix C++ compatibility warnings.
3054 2008-07-11  Diego Novillo  <dnovillo@google.com>
3056         * Make-lang.in (lto-warn): Define.
3058 2008-07-03  Simon Baldwin  <simonb@google.com>
3060         * lto.c (lto_read_decls): Wrapped debug-only data items within #ifdef
3061         LTO_STREAM_DEBUGGING.
3063 2008-06-27  Ollie Wild  <aaw@google.com>
3065         * lto-elf.c (lto-section-out.h): New include.
3066         (struct lto_elf_file): Remove bits member.  Add scn, shstrtab_stream,
3067         and data members.
3068         (cached_file_attrs): New static variable.
3069         (lto_elf_get_shdr, lto_elf_free_shdr): Remove elf_file parameter.
3070         Use cached_file_attrs for checking bits.
3071         (lto_elf_build_section_table): Remove elf_file argument from
3072         lto_elf_get_shdr and lto_elf_free_shdr calls.
3073         (DEFINE_INIT_SHDR): New macro.
3074         (init_shdr32, init_shdr64): New functions defined via the
3075         DEFINE_INIT_SHDR macro.
3076         (lto_elf_begin_section_with_type): New function.
3077         (lto_elf_begin_section): New function.
3078         (lto_elf_append_data): New function.
3079         (lto_elf_end_section): New function.
3080         (DEFINE_VALIDATE_EHDR): New macro.
3081         (validate_ehdr32, validate_ehdr64): New functions defined via the
3082         DEFINE_VALIDATE_EHDR macro.
3083         (validate_file): New function.
3084         (DEFINE_INIT_EHDR): New macro.
3085         (init_ehdr32, init_ehdr64): New functions defined via the
3086         DEFINE_INIT_EHDR macro.
3087         (init_ehdr): New function.
3088         (lto_elf_file_open): Add support for writable files.  Move some
3089         validation logic to validate_file.
3090         (lto_elf_file_close): Add support for writable files.  Write file data
3091         and free data blocks.
3092         (current_out_file): New static variable.
3093         (lto_set_current_out_file): New function.
3094         (lto_get_current_out_file): New function.
3095         * lto.c (lto_main): Add writable argument to lto_elf_file_open calls.
3096         Add temporary initialization for testing ELF serialization.
3097         * lto.h (lto-section-out.h): New include.
3098         (struct lto_file_struct): Slight modification to comment.
3099         (lto_elf_file_open): Add writable parameter.
3100         (lto_elf_begin_section): New function declaration.
3101         (lto_elf_append_data): New function declaration.
3102         (lto_elf_end_section): New function declaration.
3103         (lto_set_current_out_file, lto_get_current_out_file): New function
3104         declarations.
3105         * lto-lang.c (LANG_HOOKS_BEGIN_SECTION): Set as lto_elf_begin_section.
3106         (LANG_HOOKS_APPEND_DATA): Set as lto_elf_append_data.
3107         (LANG_HOOKS_END_SECTION): Set as lto_elf_end_section.
3108         * Make-lang.in (LTO_H): Add lto-section-out.h.
3110 2008-06-12  Ollie Wild  <aaw@google.com>
3112         * lto.h (struct lto_file_vtable_struct): Remove.
3113         (struct lto_file_struct): Remove vtable member.
3114         * lto-elf.c (lto_file_init): Remove vtable argument.
3115         (lto_elf_map_optional_lto_section): Remove.
3116         (lto_elf_unmap_section): Remove.
3117         (lto_elf_file_vtable): Remove.
3118         (lto_elf_file_open): Remove lto_elf_file_vtable argument from
3119         lto_file_init call.
3120         (lto_elf_find_section_data): Remove.
3122 2008-06-11  Ollie Wild  <aaw@google.com>
3124         * lto.c (lto_file_read): Add const qualifier to data variable.
3126 2008-06-11  Diego Novillo  <dnovillo@google.com>
3128         Merge from lto-streamber sub-branch.
3130         2008-06-04  Ollie Wild  <aaw@google.com>
3132                 * lto.c: Remove inclusion of dwarf2.h and dwarf2out.h.
3133                 * Make-lang.in (lto.o): Remove dependency on dwarf2.h.
3135         2008-05-28  Bill Maddox  <maddox@google.com>
3137                 Replace the DWARF reader in the LTO front-end.
3139                 * lto.c: Include lto-tree-in.h, lto-tags.h.
3140                 (enum DWARF2_class, DW_cl_constant, struct
3141                 DWARF2_form_data, struct lto_context,
3142                 lto_fd_init, lto_info_fd_init,
3143                 lto_abbrev_fd_init, lto_info_fd_close,
3144                 lto_file_init, lto_file_close,
3145                 lto_file_corrupt_error, lto_abi_mismatch_error,
3146                 LTO_CHECK_INT_VAL, LTO_READ_TYPE,
3147                 lto_read_uleb128, lto_read_sleb128,
3148                 lto_read_initial_length, lto_abbrev_read_attrs,
3149                 lto_abbrev_read, lto_abbrev_read_lookup,
3150                 lto_read_section_offset,
3151                 lto_read_comp_unit_header, find_cu_for_offset,
3152                 lto_get_file_name,
3153                 lto_resolve_reference,lto_read_form,
3154                 attribute_value_as_int,
3155                 make_signed_host_wide_int,
3156                 attribute_value_as_constant, lto_cache_hash,
3157                 lto_cache_eq, lto_cache_store_DIE,
3158                 lto_cache_lookup_DIE, lto_find_integral_type,
3159                 lto_find_integral_type_1,
3160                 LTO_BEGIN_READ_ATTRS_UNCHECKED,
3161                 LTO_BEGIN_READ_ATTRS, LTO_END_READ_ATTRS,
3162                 lto_unsupported_attr_error, lto_get_identifier,
3163                 lto_read_referenced_type_DIE,
3164                 lto_read_compile_unit_DIE,
3165                 lto_read_array_type_DIE,
3166                 lto_read_structure_union_class_type_DIE,
3167                 lto_read_enumerator_DIE,
3168                 lto_read_enumeration_type_DIE,
3169                 lto_read_only_for_child_DIEs,
3170                 lto_read_only_for_child_DIEs,
3171                 lto_read_member_DIE, lto_read_abbrev,
3172                 lto_read_variable_formal_parameter_constant_DIE,
3173                 lto_get_body): Removed.
3174                 (preload_common_nodes): New function.
3175                 (lto_read_decls): Convert for new global streamer.
3176                 (lto_materialze_file_data,
3177                 lto_read_subroutine_type_subprogram_die,
3178                 lto_read_unspecified_parameters_DIE,
3179                 lto_read_typedef_DIE,
3180                 lto_read_pointer_reference_type_DIE,
3181                 lto_read_subrange_type_DIE,
3182                 lto_read_base_type_DIE,
3183                 lto_read_const_volatile_restrict_type_DIE,
3184                 lto_read_namespace_DIE,
3185                 lto_read_unspecified_type_DIE, lto_read_DIE,
3186                 lto_read_child_DIEs, lto_collect_child_DIEs):
3187                 Removed.
3188                 (lto_info_read, lto_set_cu_context): Removed.
3189                 (lto_file_read): Convert for new global streamer.
3190                 (lto_resolve_type_ref, lto_read_DIE_at_ptr,
3191                 lto_resolve_var_ref, lto_resolve_fn_ref,
3192                 lto_resolve_field_ref, lto_resolve_typedecl_ref,
3193                 lto_resolve_namespacedecl_ref): Removed.
3194                 (lto_file_init, lto_file_close): Moved to lto-elf.c.
3195                 * lto-tree.h (lto_symtab_merge_var,
3196                 lto_symtab_mergee_fun): Declare here.
3197                 * lto-elf.c (lto_file_init, lto_file_close): Moved from lto.c.
3198                 (lto_elf_file_open): Removed code to read DWARF debug sections.
3199                 * lto.h (lto_context, DWARF2_attr, DWARF2_abbrev,
3200                 DWARF2_CompUnit, lto_die_ptr,
3201                 lto_die_cache_entry, lto_fd, lto_info_fd,
3202                 lto_abbrev_fd): Removed.
3203                 (lto_file): Removed debug_info and debug_abbrev fields.
3204                 (lto_ref): Removed.
3205                 (lto_file_init, lto_file_close,
3206                 lto_resolve_type_ref, lto_resolve_var_ref,
3207                 lto_resolve_fn_ref, lto_resolve_field_ref,
3208                 lto_resolve_typedecl_ref,
3209                 lto_resolve_namespacedecl_ref,
3210                 lto_get_file_name): Removed declarations.
3211                 (lto_symtab_merge_var, lto_symtab_merge_fn):
3212                 Declarations moved to lto-tree.h.
3213                 * lto-symtab.c (lto_compatible_attributes_p):
3214                 Lobotomize this, as it barfs on "Hello, world!".
3215                 * lto-section-out.c: Include lto-tree-out.h.
3216                 (lto_hash_global_slot_node,
3217                 lto_eq_global_slot_node, preload_common_nodes,
3218                 write_global_stream, write_global_references):
3219                 New functions.
3220                 (produce_asm_for_decls): Convert for new global streamer.
3221                 * lto-section-out.h (lto_hash_global_slot_node,
3222                 lto_eq_global_slot_node): Declare.
3224 2008-06-07  Kenneth Zadeck <zadeck@naturalbridge.com>
3225             Jan Hubicka  <jh@suse.cz>
3226         
3227         * lto.c (sys/mman.h, tree-pass.h): New includes.
3228         (lto_materialize_constructors_and_inits,
3229         lto_materialize_function): Keeps length of section.
3230         (lto_materialize_cgraph): Removed.
3231         (lto_read_decls): Initialize fd field.
3232         (lto_file_read): Different return type and removed much code to
3233         lto_main.
3234         (page_mask): New variable.
3235         (lto_read_section_data, get_section_data, free_section_data): New
3236         functions.
3237         (lto_main): Now calls pass manager, sets the hooks so that the ipa
3238         passes can get the section data. 
3239         
3240 2008-05-27  Kenneth Zadeck <zadeck@naturalbridge.com>
3242         * lto.h (lto_read_decls): Made local.
3243         (lto_input_function_body, lto_input_constructors_and_inits, 
3244         lto_input_cgraph): Declarations moved to lto-section-in.h.
3245         * lto-section-in.c: Moved to .. .
3246         * lto-cgraph-in.c: Ditto.
3247         * lto-section-in.h: Ditto.
3248         * lto-function-in.c: Ditto.
3249         * lto-lang.c (lto_handle_option): Added ATTRIBUTE_UNUSED to parms.
3250         (lto_insert_block): Removed.
3251         (LANG_HOOKS_INSERT_BLOCK): Removed.
3252         * Make-lang.in (lto-cgraph-in.o, lto-function-in.o,
3253         lto-section-in.o): Rules moved to lto/Makefile.in.
3254         
3256 2008-05-16  Ollie Wild  <aaw@google.com>
3258         * lto-lang.c (tree-inline.h): Include.
3259         (lto_post_options): New function.
3260         (LANG_HOOKS_POST_OPTIONS): Define.
3261         * lto-cgraph-in.c (overwrite_node): Set node->global.insns.
3262         * lto-function-in.c (input_bb): Set TREE_BLOCK (stmt).
3264 2008-05-13  Diego Novillo  <dnovillo@google.com>
3266         * lto-function-in.c (input_ssa_names): Call
3267         make_ssa_name_fn instead of make_ssa_name.
3269 2008-05-12  Diego Novillo  <dnovillo@google.com>
3271         * lto-cgraph-in.c (overwrite_node): Update references to
3272         inline summary fields.
3273         * lto-function-in.c (input_expr_operand): Do not handle
3274         STRUCT_FIELD_TAG.
3276 2008-05-09  Ollie Wild  <aaw@google.com>
3278         * lang.opt: New file.
3279         * lto-lang.c (lto_init_options): New function.
3280         (lto_handle_option): New function.
3281         (lto_init): Move initialization of flag_unit_at_a_time to
3282         lto_init_options.
3283         (LANG_HOOKS_INIT_OPTIONS): Define.
3284         (LANG_HOOKS_HANDLE_OPTION): Define.
3286 2008-04-29  Ollie Wild  <aaw@google.com>
3288         * lto.c (lto_read_namespace_DIE): New function.
3289         (lto_read_DIE): Add lto_read_namespace_DIE callback.  Cache
3290         NAMESPACE_DECL DIE's.
3291         (lto_resolve_namespacedecl_ref): New function.
3292         * lto.h (lto_resolve_namespacedecl_ref): New function.
3293         * lto-section-in.c (lto_read_decls): Read namespace declarations.
3294         * lto-section-in.h (struct lto_file_decl_data): Add namespace_decls
3295         and num_namespace_decls.
3296         * lto-function-in.c (input_expr_operand): Add NAMESPACE_DECL case.
3297         * lto-lang.c (lto_init_ts): New function.
3298         (LANG_HOOKS_INIT_TS): Set as lto_init_ts.
3300 2008-04-16  Ollie Wild  <aaw@google.com>
3302         * lto-function-in.c (input_type_ref): Updated function description.
3304 2008-04-16  Ollie Wild  <aaw@google.com>
3306         * lto-function-in.c (input_type_ref_1): New function.
3307         (input_type_ref): Split into two functions.
3308         (input_function): Add support for type contexts.
3310 2008-04-16  Ollie Wild  <aaw@google.com>
3312         * lto.c (lto_materialize_function): Use DECL_ASSEMBLER_NAME to compute
3313         section name
3315 2008-04-16  Ollie Wild  <aaw@google.com>
3317         * lto.c (lto_read_compile_unit_DIE): Add DW_LANG_C_plus_plus to the
3318         list of supported languages.
3320 2008-03-25  Kenneth Zadeck <zadeck@naturalbridge.com>
3322         Merge with mainline @133491.
3324 2008-03-05  Kenneth Zadeck <zadeck@naturalbridge.com>
3325             Jan Hubicka  <jh@suse.cz>
3327         * lto.c (lto_info_fd_init, lto_info_fd_close): Get rid of
3328         fd->unmaterialized_fndecls.
3329         (lto_get_file_name, lto_materialize_cgraph): New function.
3330         (lto_materialize_constructors_and_inits,
3331         lto_materialize_function): Read info directly from elf file.
3332         (lto_file_read): Made local and initialize dictionary so that
3333         other lto sections can be read without reprocessing the elf file.
3334         (lto_main): Read all functions after all files have been processed
3335         for their types, globals and cgraph.  
3336         * Make-lang.in (lto.o, lto-cgraph-in.c, lto-section-in): Changed
3337         dependencies.
3338         * lto-elf.c (lto_elf_file): Removed strtab, symtab fields.
3339         (hash_name, eq_name, lto_elf_build_section_table): New functions.
3340         (lto_elf_read_symtab): Removed function.
3341         (lto_elf_file_open): Removed call to lto_elf_read_symtab.
3342         * lto.h (lto_info_fd_struct): Removed unmaterialized_fndecls.
3343         (lto_file_read): Made local.
3344         (lto_get_file_name, lto_elf_build_section_table,
3345         lto_input_cgraph): 
3346         New function.
3347         * lto-section-in.c (lto_read_section_data, lto_get_section_data):
3348         New functions.
3349         (lto_read_decls): Get the file name.
3350         * lto-cgraph-in.c: New file.
3351         * lto-function-in.c (tag_to_expr): Stops at LTO_tree_last_tag.
3352         (input_expr_operand, lto_read_body): Set lto_debug_context.tag_names.
3353         (input_labels): Fixed latent sizeof issue.
3354         (input_function): Build stmt array to set call sites into cgraph
3355         edges.
3356         (lto_read_body): Reset cfun->curr_properties.
3357         * lto_section_in.h (lto_section_slot): New structure.
3358         (section_hash_table.lto_file_decl_data): New field.
3360         
3361 2008-02-09  Kenneth Zadeck <zadeck@naturalbridge.com>
3363         * lto.c (lto_read_variable_formal_parameter_const): Remove code to
3364         reconstruct static initializers.
3365         (lto_get_body, lto_materialize_function): Add lto_section_type as
3366         a parameter.
3367         (lto_materialize_constructors_and_inits,
3368         lto_materialize_file_data): New function.
3369         (lto_materialize_function,
3370         lto_read_subroutine_type_subprogram_DIE): Renamed unmap_fn_body to
3371         unmap_section and map_fn_body to map_section.
3372         (lto_set_cu_context): Process functions and static inits
3373         differently.
3374         * Make-lang.in (LTO_H, lto/lto-function-in.o,
3375         lto/lto-section-in.o): Update dependencies.
3376         * lto/lto-elf.c (lto_elf_map_optional_lto_section): Add
3377         lto_section_type parameter.
3378         (lto_elf_unmap_fn_body): Renamed to lto_elf_unmap_section.
3379         * lto.h (lto_file_vtable_struct): Removed two of the fields and 
3380         renamed the other two so that there is only one map function and
3381         one unmap function and each takes a section type parameter.
3382         (lto_read_function_body): Renamed to lto_input_function_body and
3383         added file_data parameter.
3384         (lto_read_var_init): Removed.
3385         (lto_input_constructors_and_inits): New function.
3386         * lto-section-in.c (lto_read_decls): New function.
3387         * lto-function-in.c (data_in): Moved fields field_decls, fn_decls,
3388         var_decls, type_decls, types to lto_file_decl_data.
3389         (input_type_ref, input_expr_operand, lto_read_body): Get
3390         field_decls, fn_decls, var_decls, type_decls, types from different
3391         structure.
3392         (input_globals, input_constructor, lto_read_var_init): Removed.
3393         (input_constructors_or_inits): New function.
3394         (lto_read_function_body, lto_input_constructors_and_inits):
3395         Renamed to lto_input_function_body and takes file_data parameter.
3396         * lto-section-in.h (lto_file_decl_data): New structure.
3397         
3398 2008-01-28  Kenneth Zadeck <zadeck@naturalbridge.com>
3400         * lto-function-in.c (input_globals.c): Changed input type to
3401         lto_function_header.
3402         (input_bb): Removed code to deserialize the stmt number.
3403         (input_function): Renumber all stmts after they are input.
3404         (lto_read_body, lto_read_function_body, lto_read_var_init):
3405         Changed to used new header format and enum section_type.
3406         *lto-lang.c (success): Removed. 
3407         
3408 2008-01-28  Nathan Froyd  <froydnj@codesourcery.com>
3410         * lto-elf.c (lto_elf_lookup_sym): Remove unused function.
3411         (lto_elf_free_sym): Likewise.
3413         * lto-elf.c (lto_elf_read_var_init): Remove unused function.
3414         (lto_elf_build_init): Likewise.
3416 2008-01-14  Kenneth Zadeck <zadeck@naturalbridge.com>
3418         * lto-read.c: Renamed to lto-function-in.c.
3419         (input_1_unsigned): Moved to lto-section-in.c and renamed
3420         lto_input_1_unsigned.
3421         (input_uleb128): Moved to lto-section-in.c and renamed
3422         lto_input_uleb128.
3423         (input_widest_uint_uleb128): Moved to lto-section-in.c and renamed
3424         lto_input_widest_uint_uleb128.
3425         (input_sleb128): Moved to lto-section-in.c and renamed
3426         lto_input_sleb128.
3427         (input_integer): Moved to lto-section-in.c and renamed
3428         lto_input_integer.
3429         (debug_in_fun): Moved to lto-section-in.c and renamed
3430         lto_debug_in_fun.
3431         (input_block): Moved to lto-section-in.h and renamed
3432         lto_input_block.
3433         (input_expr_operand): Fixed to allow lists with more than one
3434         element.
3435         * lto-section-in.h: New file.
3436         * lto-section-in.c: New file with changes from above.
3437         * Make-lang.in (lto-read.o): Renamed lto-function-in.c.
3438         (lto-section-in.o): New rule.
3439         
3440 2007-12-29  Nathan Froyd  <froydnj@codesourcery.com>
3442         * lto-read.c (input_expr_operand): Mark static and external
3443         VAR_DECLs as needed.
3445 2007-12-29  Nathan Froyd  <froydnj@codesourcery.com>
3447         * lto-read.c (input_integer): Use the correct shift amount.
3449 2007-12-29  Nathan Froyd  <froydnj@codesourcery.com>
3451         * lto-lang.c (lto_pushdecl): Do nothing instead of aborting.
3452         (LANG_HOOKS_NAME): Define.
3454 2007-12-27  Nathan Froyd  <froydnj@codesourcery.com>
3456         * lto.c (lto_find_integral_type): Define as a macro.  Rename the
3457         original function to...
3458         (lto_find_integral_type_1): ...this.  Consult UNSIGNEDP if we
3459         don't have a base type.
3460         (lto_read_enumeration_type_DIE): Examine the values of the
3461         enumeration to determine whether we can use an unsigned type for
3462         the base type of the enumeration.
3464 2007-12-24  Nathan Froyd  <froydnj@codesourcery.com>
3466         * lto.c (lto_read_structure_union_class_type_DIE): Set TYPE_MODE
3467         and TYPE_ALIGN on UNION_TYPEs as soon as possible.
3469 2007-12-22  Nathan Froyd  <froydnj@codesourcery.com>
3471         * lto-lang.c (lto_types_compatible_p): New function.
3472         (LANG_HOOKS_TYPES_COMPATIBLE_P): Define.
3474 2007-12-22  Nathan Froyd  <froydnj@codesourcery.com>
3475             Kenneth Zadeck <zadeck@naturalbridge.com>
3477         * lto-read.c (input_expr_operand): Fixed uninitialize var warning.
3478         (input_local_vars): Read in DECL_INITIAL and context for local
3479         statics that need to be put in unexpanded_vars_list.
3481 2007-12-21  Nathan Froyd  <froydnj@codesourcery.com>
3483         * lto-read.c (input_real): Use a separate null-terminated buffer
3484         for calling real_from_string.
3485         (input_expr_operand): If we take the address of a FUNCTION_DECL,
3486         tell cgraph that it's needed.
3488 2007-12-19  Doug Kwan  <dougkwan@google.com>
3490         * lto.c (lto_read_base_type_DIE): Handle complex integer types.
3492 2007-12-18  Nathan Froyd  <froydnj@codesourcery.com>
3494         * lto.c (lto_read_DIE): Call lto_read_only_for_child_DIEs instead.
3495         (lto_file_read): Reset the members of 'context' every time we read
3496         a toplevel DIE, with special attention to last_param_type.
3498 2007-12-18  Nathan Froyd  <froydnj@codesourcery.com>
3500         * lto.c (lto_read_subroutine_type_subprogram_DIE): Initialize
3501         'declaration'.  Set the assembler name for non-public functions.
3503 2007-12-17  Kenneth Zadeck <zadeck@naturalbridge.com>
3505         * lto_read.c (data_in.unexpanded_indexes): New array.
3506         (input_local_var): Added code to read in unexpanded_var_list
3507         indexes for variables.  Only read in DECL_CHAIN field for
3508         parameters.
3509         (input_local_vars): Added code to rebuild unexpanded_var_list in
3510         order using unexpanded_indexes.
3511         (input_function): Added code to set DECL_CONTEXT for functions.
3513 2007-12-13  Doug Kwan  <dougkwan@google.com>
3515         * lto.c (lto_read_pointer_reference_type_DIE): Handle optional name
3516         in pointer and reference types.
3518 2007-12-13  Nathan Froyd  <froydnj@codesourcery.com>
3520         * lto-read.c (input_expr_operand): Use DECL_RESULT when reading a
3521         RESULT_DECL.
3523 2007-12-13  Nathan Froyd  <froydnj@codesourcery.com>
3525         * lto.c (lto_read_array_type_DIE): Return the cached DIE if we've
3526         already read the DIE.
3527         (lto_get_body): New function, split out from...
3528         (lto_materialize_function): ...here.  Call it.
3529         (lto_read_subroutine_type_subprogram_DIE): Call lto_get_body to
3530         determine DECL_EXTERNAL.
3531         * lto-symtab.c (lto_symtab_merge_decl): Merge the DECL_RESULTs of
3532         FUNCTION_DECLs when necessary.  Use the type of the actual
3533         function definition if we are unable to easily merge types.  Ignore
3534         spurious DECL_MODE mismatches on VAR_DECLs.  Merge DECL_MODEs when
3535         necessary.
3537 2007-12-13  Nathan Froyd  <froydnj@codesourcery.com>
3539         * lto-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Define.
3541 2007-12-12  Bill Maddox  <maddox@google.com>
3543         Revert
3544         2007-12-07  Bill Maddox  <maddox@google.com>
3546         * lto.c (lto_str_fd_init): New function.
3547         (lto_str_fd_close): New function.
3548         (lto_file_init): Call lto_str_fd_init.
3549         (lto_file_close): Call lto_str_fd_close.
3550         (lto_str_read): New function. Read debug string table.
3551         (lto_str_lookup): New function. Get string for debug
3552         string table offset.
3553         (lto_read_form): Recognize DW_FORM_strp.
3554         (lto_file_read): Invoke lto_str_read.
3556         * lto-elf.c (lto_elf_file_open): Read raw section data
3557         for the .debug_str section, if present.
3559         * lto.h (struct lto_str_fd_struct): New struct.
3560         (struct lto_file_struct): Added new field DEBUG_STR
3561         to hold the file descriptor for the debug string table.
3562         
3563 2007-12-07  Bill Maddox  <maddox@google.com>
3565         * lto.c (lto_str_fd_init): New function.
3566         (lto_str_fd_close): New function.
3567         (lto_file_init): Call lto_str_fd_init.
3568         (lto_file_close): Call lto_str_fd_close.
3569         (lto_str_read): New function. Read debug string table.
3570         (lto_str_lookup): New function. Get string for debug
3571         string table offset.
3572         (lto_read_form): Recognize DW_FORM_strp.
3573         (lto_file_read): Invoke lto_str_read.
3575         * lto-elf.c (lto_elf_file_open): Read raw section data
3576         for the .debug_str section, if present.
3578         * lto.h (struct lto_str_fd_struct): New struct.
3579         (struct lto_file_struct): Added new field DEBUG_STR
3580         to hold the file descriptor for the debug string table.
3582 2007-12-07  Nathan Froyd  <froydnj@codesourcery.com>
3584         * lto-read.c (input_cfg): Call init_empty_tree_cfg_for_function.
3585         Grow the basic_block_info and label_to_block_map vectors if
3586         necessary.  Read in the block chain.
3588 2007-12-06  Nathan Froyd  <froydnj@codesourcery.com>
3590         * lto.c (lto_read_DIE): Set TYPE_ALIAS_SET where necessary.
3592 2007-12-06  Nathan Froyd  <froydnj@codesourcery.com>
3594         * lto.c (lto_read_form): Add DW_cl_address for DW_AT_const_value.
3596 2007-12-06  Nathan Froyd  <froydnj@codesourcery.com>
3598         * lto-read.c (input_expr_operand): Don't check for MTAGs.
3599         (lto_read_body): Don't declare PROP_alias.
3601 2007-12-06  Nathan Froyd  <froydnj@codesourcery.com>
3603         * lto-symtab.c (lto_symtab_merge_decl): Handle FUNCTION_DECLs without
3604         argument type information.
3606 2007-12-03  Nathan Froyd  <froydnj@codesourcery.com>
3608         * lto.c (lto_read_variable_formal_parameter_constant_DIE): Set
3609         TREE_THIS_VOLATILE if the associated type is a volatile type.
3610         (lto_materialize_function): Remove call to init_ssa_operands.
3611         * lto-read.c (input_expr_operand): Add SSA_NAME_VAR as a referenced
3612         variable when reading an SSA_NAME.  Do the same when reading a
3613         RESULT_DECL, a RETURN_EXPR, or an MTAG.
3614         (input_cfg): Call init_ssa_operands.
3615         (input_ssa_names): Set the default def of an SSA_NAME if necessary.
3616         Move call to init_tree_ssa...
3617         (lto_read_body): ...here.  Use push_cfun and pop_cfun.  Call
3618         add_referenced_var on any variables referenced from the body of the
3619         function.  Inform the rest of the compiler we are in SSA form and
3620         inform later passes about the current properties.
3622 2007-11-30  Nathan Froyd  <froydnj@codesourcery.com>
3624         * lto.c (lto_materialize_function): Add FIXME.
3626 2007-11-29  Nathan Froyd  <froydnj@codesourcery.com>
3628         * lto-lang.c (enum built_in_attribute): New enum.
3629         (flag_no_builtin, flag_no_nonansi_builtin, flag_isoc94, flag_isoc99,
3630         built_in_attributes): New variables.
3631         (def_builtin_1): New function.
3632         (lto_define_builtins): #define DEF_BUILTIN and include builtins.def.
3634 2007-11-28  Nathan Froyd  <froydnj@codesourcery.com>
3636         * lto.c (lto_read_variable_formal_parameter_constant_DIE): Set
3637         DECL_SOURCE_LOCATION for debugging purposes.
3638         (lto_read_member_DIE): Set DECL_SOURCE_LOCATION.  If we have read a
3639         bitfield, use the type specified by the DIE for TREE_TYPE and defer
3640         laying out the decl until later.
3641         (lto_read_subroutine_type_subprogram_DIE): Compare the function's
3642         name with DECL_ASSEMBLER_NAME.  Set DECL_SOURCE_LOCATION and
3643         TREE_ADDRESSABLE.
3644         * lto-read.c (input_expr_operand): Set TREE_ADDRESSABLE on the
3645         operand of an ADDR_EXPR.
3646         * lto-lang.c (enum lto_builtin_type): New enum.
3647         (builtin_type): New typedef.
3648         (builtin_types, string_type_node, const_string_type_node,
3649         wint_type_node, intmax_type_node, uintmax_type_node,
3650         signed_size_type_node): New variables.
3651         (def_fn_type, builtin_type_for_size, lto_define_builtins,
3652         lto_build_c_type_nodes): New functions.
3653         (lto_init): Initialize builtin types.
3654         (lto_set_decl_assembler_name): Let the target machine mangle the
3655         name if the decl is TREE_PUBLIC, otherwise uniquify it.
3657 2007-11-21  Nathan Froyd  <froydnj@codesourcery.com>
3659         * lto.c (lto_read_variable_formal_parameter_constant_DIE): Don't
3660         set TREE_ADDRESSABLE.  Do set DECL_COMDAT.  Set TREE_READONLY if
3661         the type is a constant type.  Set the assembler name and inform
3662         the rest of the compiler about the new decl if the decl is not
3663         public.
3664         (lto_read_subroutine_type_subprogram_DIE): Don't check for equivalency
3665         of DECL_ASSEMBLER_NAME when determining if we have a builtin.  Don't
3666         try to read in function bodies for functions that already have bodies.
3667         * lto-symtab.c (lto_same_type_p): Check for unbounded array
3668         equivalency.
3669         (lto_symtab_merge_decl): Don't merge decls that aren't TREE_PUBLIC.
3670         Check for whether we matched a builtin function type before calling
3671         lto_same_type_p on the generated type.  Permit cases where the
3672         declaration of an array is unbounded, but the definition is bounded.
3673         Don't combine TREE_PUBLIC flags.  Copy over DECL_SIZE and
3674         DECL_SIZE_UNIT if necessary.
3676 2007-11-16  Kenneth Zadeck <zadeck@naturalbridge.com>
3678         * lto-read.c (input_expr_operand): Get types right 
3679         for COMPLEX_CST.
3681 2007-11-16  Kenneth Zadeck <zadeck@naturalbridge.com>
3683         * lto-read.c (make_new_block, input_cfg): Properly set
3684         n_basic_blocks.
3685         
3686 2007-11-16  Nathan Froyd  <froydnj@codesourcery.com>
3688         * lto.c (lto_read_array_type_DIE): Handle DIEs with DW_AT_GNU_vector
3689         set properly by building a VECTOR_TYPE instead of an ARRAY_TYPE.
3691 2007-11-16  Nathan Froyd  <froydnj@codesourcery.com>
3693         * lto.c (lto_read_base_type_DIE): Use make_bitfield_integer_type to
3694         construct the integer type for bitfields.
3696 2007-11-16  Kenneth Zadeck <zadeck@naturalbridge.com>
3698         * lto-read.c (data_in.current_node_has_loc): Removed.
3699         (input_line_info): Returns true if node needs line set.
3700         (set_line_info): Always sets line if called.
3701         (clear_line_info): Removed reference to current_node_needs_loc.
3702         (input_expr_operand): Keeps track locally if current node needs a loc.
3703         (input_local_var): Added code to handle DECL_INITIAL for
3704         static local vars. Only set loc if necessary.
3705         
3706 2007-11-15  Nathan Froyd  <froydnj@codesourcery.com>
3708         * lto.c (lto_read_subroutine_type_subprogram_DIE): Fix thinko'd
3709         DECL_CONTEXT.
3711 2007-11-15  Nathan Froyd  <froydnj@codesourcery.com>
3713         * lto.c: Include langhooks.h.
3714         (lto_find_integral_type): Rework logic to handle the case where
3715         got_byte_size is true, but the bitsize requested and that of the
3716         base_type doesn't match.
3717         (lto_read_variable_formal_parameter_constant_DIE): Only check for
3718         asm_name if we are creating a VAR_DECL.
3719         (lto_materialize_function): Set DECL_EXTERNAL if we can't find a
3720         definition.
3721         (lto_read_subroutine_type_subprogram_DIE): Check for a builtin
3722         function reference and use the builtin's decl if so.  Set the
3723         DECL_CONTEXT of the RESULT_DECL for the function.
3724         * lto-lang.c (registered_builtin_fndecls): New variable.
3725         (lto_getdecls): Return it.
3726         (lto_builtin_function): Chain the new decl onto
3727         registered_builtin_fndecls.
3729 2007-11-15  Kenneth Zadeck <zadeck@naturalbridge.com>
3730             
3731         * lto-read.c (process_tree_flags, lto_static_init_local):
3732         Renamed to ADD_CLASS_EXPR_FLAG. ADD_CLASS_DECL_FLAG New Macro.
3733         (input_line_info, clear_line_info): Fixed new line number code.
3734         (input_expr_operand): Added type to SWITCH_EXPR.
3735         (lto_read_body): Properly initialized data_in.
3736         Clear line info when leaving.
3737         
3738 2007-11-13  Diego Novillo  <dnovillo@google.com>
3740         * lto.c (lto_read_variable_formal_parameter_constant_DIE):
3741         Initialize ARTIFICIAL.
3742         (lto_read_subroutine_type_subprogram_DIE): Initialize
3743         SAVED_SCOPE.
3744         * lto-read.c (set_line_info): Remove ; from calls to
3745         LINEMAP_POSITION_FOR_COLUMN.
3747 2007-11-13  Kenneth Zadeck <zadeck@naturalbridge.com>
3749         * lto-read.c (input_type_ref): Renamed from get_type_ref.
3750         (input_expr_operand, input_local_var): Renamed get_type_ref to 
3751         input_type_ref.
3752         (input_expr_operand): Get the types correct for 
3753         vector-cst.  Get SSA_NAME_DEF_STMT correct for return_exprs.
3754         
3755 2007-11-13  Doug Kwan  <dougkwan@google.com>
3757         * lto-read.c (input_widest_uint_uleb128): New function.
3758         (input_tree_flags, process_tree_flags, input_line_info,
3759         input_expr_operand, input_local_var, input_phi, input_ssa_names):
3760         Change to use lto_flags_type and BITS_PER_LTO_FLAGS_TYPES instead of
3761         unsigned HOST_WIDE_INT and HOST_BITS_PER_WIDE_INT.
3762         (lto_static_init_local): Add code to assert that lto_flags_type is
3763         wide enough.
3765 2007-11-13  Nathan Froyd  <froydnj@codesourcery.com>
3767         * lto.c (lto_read_array_type_DIE): Handle DW_AT_GNU_vector.
3768         (lto_read_subroutine_type_subprogram_DIE): Handle
3769         DW_AT_static_link and DW_AT_specification.  Return the
3770         specification if present.
3771         (lto_read_base_type_DIE): Handle DW_ATE_complex_float.
3772         
3773 2007-11-13  Nathan Froyd  <froydnj@codesourcery.com>
3775         * lto-lang.c: Include target.h.
3776         (registered_builtin_types): New variable.
3777         (lto_type_for_mode): Increase number of modes handled.
3778         (lto_builtin_function): Fix argument list and return the decl.
3779         (lto_register_builtin_type): New function.
3780         (lto_init): Initialize target builtins and language-independent
3781         nodes.
3782         (LANG_HOOKS_REGISTER_BUILTIN_TYPE): Define.
3784 2007-11-13  Kenneth Zadeck <zadeck@naturalbridge.com>
3786         * lto-read.c (input_expr_operand): Added code to properly handle
3787         index filed. Added new RANGE_EXPR case.
3788         
3789 2007-11-11  Kenneth Zadeck <zadeck@naturalbridge.com>
3791         * lto-read.c (ADD_FUNC_FLAG): Deleted macro.
3792         (data_in): Added current_node_has_loc field.
3793         (input_line_info, set_line_info, clear_line_info): Added a support
3794         for USE_MAPPED_LOCATION and not adding line numbers to nodes that
3795         did not have on on the source side.
3796         (input_expr_operand): Make sure that GIMPLE_MODIFY_STMTS get line
3797         numbers too.
3799 2007-11-09  Doug Kwan  <dougkwan@google.com>
3801         * lto-read.c (input_expr_operand): Change type of operand 2 of
3802         BIT_FIELD_REF expression to be bitsizetype instead of sizetype.
3804 2007-11-09  Nathan Froyd  <froydnj@codesourcery.com>
3806         * lto.c: Include lto-tree.h.  Effect small spaces->tabs cleanup.
3807         (lto_read_variable_formal_parameter_constant_DIE): Transfer bits
3808         from a DW_AT_specification or DW_AT_abstract_origin attribute to
3809         the new decl we are creating.  Move informing the middle end about
3810         the new decl to...
3811         (lto_main): ...here.  Inform the middle end about global variables
3812         after we have read in all the input files.
3813         * lto-symtab.c (lto_symtab_merge_decl): We really do need to merge
3814         variables with internal linkage, so delete the check for internal
3815         linkage.  Combine TREE_PUBLIC flags.
3817 2007-11-08  Nathan Froyd  <froydnj@codesourcery.com>
3819         * lto.c (lto_read_subroutine_type_subprogram_DIE): Handle
3820         DW_AT_decl_line.
3821         * lto-symtab.c (lto_symtab_merge_decl): Handle redefinition of a
3822         builtin specially.  Move check for attribute compatibility
3823         earlier.
3825 2007-11-07  Nathan Froyd  <froydnj@codesourcery.com>
3827         * Make-lang.in (lto/lto.o): Depend on gt-lto-lto.h.
3828         * config-lang.in (gtfiles): Add lto.h and lto.c.
3829         * lto-elf.c: Include ggc.h.
3830         (lto_elf_file_open): Allocate elf_file from GC memory.
3831         * lto.c: Include tree-ssa-operands.h and gt-lto-lto.h
3832         (lto_info_fd_init): Allocate the die_cache and unmaterialized_fndecls
3833         in GC memory.
3834         (lto_info_fd_close): Free unmaterialized_fndecls from GC memory.
3835         (lto_file_close): Free file from GC memory.
3836         (lto_cache_store_DIE): Allocate the new entry in GC memory.
3837         (lto_read_member_DIE): Fix declaration.
3838         (lto_read_subroutine_type_subprogram_DIE): unmaterialized_fndecls lives
3839         in GC memory.
3840         (current_lto_file): New variable.
3841         (lto_main): Use it.
3842         (DWARF2_attr, DWARF2_abbrev, lto_die_ptr, DWARF2_CompUnit,
3843         lto_die_cache_entry): Move to...
3844         * lto.h: ...here and add GTY markers as appropriate.  Delete forward
3845         declarations accordingly.
3846         (struct lto_file_struct): Declare.
3847         (lto_file_vtable): Use it instead of lto_file.
3849 2007-11-06 Alon Dayan  <alond@il.ibm.com>
3850            Kenneth Zadeck <zadeck@naturalbridge.com>
3852          * lto-read.c (process_flags, lto_static_init_local):
3853          read flags of VAR_DECL and FUNCTION_DECL of size>1.
3854          change global array num_flags_for_code to flags_length_for_code.
3855          (set_line_info): Make decls work in USE_MAPPED_LOCATION mode.
3856         
3857 2007-11-05  Nathan Froyd  <froydnj@codesourcery.com>
3859         * lto.c (lto_read_structure_union_class_type_DIE): Use proper record
3860         layout functions to compute information about the newly constructed
3861         type.
3863 2007-11-02  Nathan Froyd  <froydnj@codesourcery.com>
3865         * lto-read.c (input_expr_operand): Change the LTO_return_expr1
3866         case to use DECL_RESULT if necessary.
3868 2007-11-01  Kenneth Zadeck <zadeck@naturalbridge.com>
3870         * lto-read.c (input_tree_list): Removed.
3871         (input_tree_flags): Added parameter to force flags no matter what
3872         tree code.
3873         (input_expr_operand): Added parameter to input_tree_flags.
3874         Added case for IDENTIFIER_NODE and TREE_LIST.  Changed ASM to call
3875         input_expr_operand rather than input_tree_lists.
3876         (input_local_var): Use input_expr_operand to read attributes
3877         rather then input_tree_list.
3878         (input_phi, input_ssa_names): Added parameter to input_tree_flags.
3880 2007-10-31  Nathan Froyd  <froydnj@codesourcery.com>
3882         * lto.c (lto_read_typedef_DIE): Fix comment typo.
3883         (lto_resolve_typedecl_ref): Fetch the referred-to type and build a fake
3884         TYPE_DECL for it.
3885         * lto-read.c (lto_read_body): Use correct sizes for calculating
3886         type_decls_offset and types_offset.
3888 2007-10-30  Nathan Froyd  <froydnj@codesourcery.com>
3890         * lto-tree.h (union lang_tree_node): Change GTY description to chain
3891         with GENERIC_NEXT.
3892         * config-lang.in (gtfiles): Add lto-lang.c.
3893         * lto-lang.c: Include gt-lto-lto-lang.h.
3894         * Make-lang.in (lto/lto-lang.o): Add dependency on gt-lto-lto-lang.h
3895         (lto/lto-symtab.o): Depend on LTO_H instead of TREE_H.
3896         (lto/lto-read.o): Likewise.
3898 2007-10-29  Kenneth Zadeck <zadeck@naturalbridge.com>
3900         * lto-read.c (data_in): Added type_decls and current_col fields.
3901         (string_slot): New type to hold canonized file name.
3902         (hash_string_slot_node, eq_string_slot_node, canon_file_name, 
3903         input_line_info, set_line_info, clear_line_info): New functions.
3904         (file_name_hash_table): New hash table.
3905         (input_local_var, input_labels, input_local_vars_index, 
3906         input_local_var, input_local_vars, input_ssa_names): Reorganized parameters.
3907         (input_uleb128): Changed type of byte var.
3908         (input_expr_operand): Large number of changes to get line numbers
3909         correct.  Added TYPE_DECL case.
3910         (input_globals): Added code to get TYPE_DECLs processed.
3911         (input_local_var): Added code to process line numbers and
3912         TREE_CHAIN and DECL_CONTEXT.
3913         (input_function, input_constructor): Added call to
3914         clear_line_number.
3915         (lto_static_init_local): Added code to get line numbers correct.
3916         (lto_read_body): Added code to get TYPE_DECLS read and to change
3917         parameters to the calls above that had their parms reorganized.
3919         
3920 2007-10-29  Nathan Froyd  <froydnj@codesourcery.com>
3922         * lto.h (lto_resolve_typedecl_ref): Declare.
3923         * lto.c (lto_resolve_typedecl_ref): New function.
3925 2007-10-29  Mark Mitchell  <mark@codesourcery.com>
3926             Nathan Froyd  <froydnj@codesourcery.com>
3928         * lto.c (lto_read_subroutine_type_subprogram_DIE): Read the child
3929         DIEs even if we find an abstract origin for this DIE.
3931 2007-10-29  Nathan Froyd  <froydnj@codesourcery.com>
3933         * lto.c (lto_read_subroutine_type_subprogram_DIE): Build the
3934         RESULT_DECL slightly earlier.  Only remember the decl for later
3935         if we successfully merge declarations.
3937 2007-10-24  Kenneth Zadeck <zadeck@naturalbridge.com>
3939         * lto-read.c (input_expr_operand): Give label_values the proper
3940         context and provide switch statements with a default type.
3941         
3942 2007-10-23  Nathan Froyd  <froydnj@codesourcery.com>
3944         * lto-read.c (lto_read_body): Move call to init_ssa_operands...
3945         * lto.c (lto_materialize_function): ...to here.
3947 2007-10-22  Nathan Froyd  <froydnj@codesourcery.com>
3949         * lto.h (struct lto_info_fd): Add field unmaterialized_fndecls.
3950         * lto.c (lto_info_fd_init): Initialize it.
3951         (lto_info_fd_close): Free it.
3952         (lto_materialize_function): New function.
3953         (lto_read_subroutine_type_subprogram_DIE): Save the result decl on
3954         unmaterialized_fndecls.
3955         (lto_file_read): Read in all the function bodies after we have read
3956         all of the DWARF info.
3957         * lto-read.c (lto_read_body): Call init_ssa_operands if we are
3958         reading a function body.
3960 2007-10-20  Kenneth Zadeck <zadeck@naturalbridge.com>
3962         * lto-read.c (input_tree_flags): Renamed from input_flags to be
3963         semetric with output_tree_flags.  Added call to log flags.
3964         (process_tree_flags): Renamed from process_flags.  Fixed a lot of
3965         type issues to make everything consistent with flags being
3966         unsigned HOST_WIDE_INTS.
3967         (input_expr_operand): Added call to
3968         recompute_tree_invariant_for_addr_expr.
3969         (input_local_var): Added debugging for tree_chains.  Now calls
3970         input_tree_flags.
3971         (input_phi): Made flags unsigned HOST_WIDE_INT.
3972         (input_ssa_names): Now calls input_tree_flags.
3973         (lto_read_body): Now sets cfun.
3974         (lto_read_function_body): Now sets current_function_pointer.
3975         
3976 2007-10-19  Nathan Froyd  <froydnj@codesourcery.com>
3978         * lto.c (lto_read_variable_formal_parameter_constant_DIE): Check
3979         definitively whether SPECIFICATION or ABSTRACT_ORIGIN exist before
3980         inspecting fields within.
3981         (lto_read_DIE_at_ptr): Delete check for null result; let callers
3982         handle this appropriately.
3984 2007-10-19  Nathan Froyd  <froydnj@codesourcery.com>
3986         * lto.c (lto_read_variable_formal_parameter_constant_DIE): Handle
3987         DW_AT_abstract_origin properly.  Ensure that we're not dealing with
3988         both DW_AT_abstract_origin and DW_AT_specification.
3989         (lto_read_subroutine_type_subprogram_DIE): Handle
3990         DW_AT_abstract_origin.
3991         (lto_read_DIE): Use lto_read_only_for_child_DIEs for labels.
3992         (lto_read_DIE_at_ptr): Define as static to match declaration.
3993         Lookup the PTR in the cache before reading it from the file.
3994         (lto_resolve_var_ref): Adjust accordingly.
3995         (lto_resolve_fn_ref): Adjust accordingly.  Tweak comment.
3996         (lto_resolve_field_ref): Adjust accordingly.  Tweak comment.
3998 2007-10-19  Nathan Froyd  <froydnj@codesourcery.com>
4000         * lto.c (lto_read_DIE_at_ptr): New function.
4001         (lto_resolve_var_ref): Use it.
4002         (lto_resolve_fn_ref): Use it.
4003         (lto_resolve_field_ref): Use it.
4004         (lto_read_variable_formal_parameter_constant_DIE): Follow
4005         DW_AT_specification and return the associated decl when appropriate.
4007 2007-10-18  Nathan Froyd  <froydnj@codesourcery.com>
4009         * lto-lang.c (lto_type_for_mode): Move after lto_type_for_size.
4010         Implement for scalar integer modes.
4011         (lto_init): Initialize size_type_node.
4013 2007-10-18  Kenneth Zadeck <zadeck@naturalbridge.com>
4015         * lto-read.c (input_expr_operand): Remove ssa name asserts.
4016         (input_local_var): Add chaining for params.
4017         (input_ssa_names): Add cfun parameter.
4018         (input_function): Remove unnecessary else.
4020 2007-10-17  Nathan Froyd  <froydnj@codesourcery.com>
4022         * lto.c (lto_read_only_for_child_DIEs): Mark die parameter as unused.
4023         (lto_resolve_var_ref): Use proper types.
4024         (lto_resolve_fn_ref): Likewise.
4025         (lto_resolve_field_ref): Likewise.
4027 2007-10-17  Nathan Froyd  <froydnj@codesourcery.com>
4029         * lto-read.c (input_expr_operand): Remove case.
4031 2007-10-17  Nathan Froyd  <froydnj@codesourcery.com>
4033         * lto.c (lto_read_only_for_child_DIEs): New function.
4034         (lto_read_DIE): Use it for lexical_block and inlined_subroutine DIEs.
4035         * lto-elf.c (lto_elf_map_lto_section): Remove.
4036         (lto_elf_file_vtable): Use lto_elf_map_optional_lto_section instead.
4037         * lto-read.c (input_expr_operand): Assert that we never read a NULL
4038         SSA_NAME.  Add missing case for mechanical codes.
4039         (input_cfg): Use basic_block_info_for_function instead of
4040         basic_block_info.
4042 2007-10-16  Kenneth Zadeck <zadeck@naturalbridge.com>
4044         * lto-read.c (input_sleb128, input_integer): Use proper casts.
4045         (input_list): Renamed input_tree_list and modified to follow same
4046         protocol as lto-function-out.c:output_tree_list.
4047         (input_expr_operand): Make asm operands use input_tree_list.
4048         (input_local_var): Now uses input_tree_list.
4049         (lto_read_body): Change placement for setting context of debug_labels.
4050         
4051         
4052 2007-10-16  Kenneth Zadeck <zadeck@naturalbridge.com>
4054         * lto-read.c (input_real): Output debugging in proper order.
4055         (input_integer): Compute bit lengths properly.
4056         (input_list): Clean up declaration.
4057         (input_expr_operand): Change calls to input_real to match fix.
4058         Make reading of LTO_bit_field_ref1 match output.
4059         (input_local_var): Make reading of attributes match what is being
4060         written.
4061         (dump_debug_stream): Also print char in hex.
4062         (debug_out_fun): Fix signed unsigned mismatch.
4063         
4064 2007-10-10  Nathan Froyd  <froydnj@codesourcery.com>
4066         * lto.c (lto_read_form): Handle DW_AT_MIPS_linkage_name and
4067         DW_AT_GNU_vector specially, as they are not contiguous with the
4068         specified set of attribute names.  Use class_mask to check for
4069         errors at the end of the function
4070         (lto_resolve_var_ref): Read the DIE if it is not cached.
4071         (lto_resolve_fn_ref): Likewise.
4072         (lto_resolve_field_ref): Likewise.
4074 2007-10-05  Nathan Froyd  <froydnj@codesourcery.com>
4076         * lto.c: Include dwarf2out.h.
4077         (lto_cache_store_DIE): Assert that we never change the value.
4078         (LTO_BEGIN_READ_ATTRS): Print an informative error message.
4079         (lto_read_compile_unit_DIE): Handle DW_AT_entry_pc.
4080         (lto_read_array_type_DIE): Don't error on ndims == 0; build a
4081         sensible type instead.
4082         (lto_read_structure_union_class_type_DIE): Store the newly
4083         created type prior to reading the members of the structure to
4084         avoid infinite recursion.  Avoid computing types and alignments
4085         for structures whose sizes are unknown.
4086         (lto_read_variable_formal_parameter_const): Handle DW_AT_artificial
4087         and set DECL_ARTIFICIAL accordingly.  Ignore DW_AT_abstract_origin,
4088         DW_AT_const_value, and DW_AT_specification.
4089         (lto_read_subroutine_type_subprogram_DIE): Handle DW_AT_declaration.
4090         Return early if we have already constructed the function type.
4091         (lto_read_typedef_DIE): Check to see if the type has been cached
4092         already.  Cache the type before reading any children.
4093         (lto_read_const_volatile_restrict_type_DIE): Handle DW_AT_name.
4094         (lto_read_DIE): Unset context->skip_non_parameters around reading
4095         the DIE.
4096         (lto_resolve_fn_ref): Delete trailing whitespace.
4098 2007-09-11  Kenneth Zadeck <zadeck@naturalbridge.com>
4100         * lto-read.c (input_expr_operand): Added type for STRING_CST.
4101         
4102 2007-09-10  Nathan Froyd  <froydnj@codesourcery.com>
4104         * lto-read.c (lto_read): Set the type of the newly created CALL_EXPR.
4106 2007-09-07  Nathan Froyd  <froydnj@codesourcery.com>
4108         * lto-lang.c (signed_and_unsigned_types): New variable.
4109         (lto_type_for_size): Consult signed_and_unsigned_types to find
4110         an approprite type, creating it if necessary.
4111         (lto_set_decl_assembler_name): Add actual method body.
4113 2007-09-06  Jim Blandy  <jimb@codesourcery.com>
4115         * lto.c (lto_read_variable_formal_parameter_constant_DIE): If we
4116         can't find a var init for this variable, leave its DECL_INITIAL.
4117         * lto-elf.c (lto_elf_map_optional_lto_section): Renamed from
4118         lto_elf_map_fn_body.
4119         (lto_map_lto_section): New function.
4120         (lto_elf_file_vtable): Use lto_elf_map_lto_section for function
4121         bodies, and lto_elf_map_optional_lto_section for variable
4122         initializers.
4123         (lto_elf_find_section_data): Quietly return NULL if the section is
4124         missing.
4125         (lto_elf_file_open): Check for a NULL from lto_elf_find_section_data.
4127         * lto-elf.c (lto_elf_find_section_data): Remove dead code.
4129         * lto-read.c (lto_read_body): Doc fix.
4131 2007-08-29  Kenneth Zadeck <zadeck@naturalbridge.com>
4133         * lto-read.c (fun_in): Renamed to data_in.
4134         (input_expr_operand, input_local_var, input_string_internal,
4135         input_string, input_real, input_list, get_label_decl, 
4136         get_type_ref, input_expr_operand, input_globals, input_labels,
4137         input_local_vars_index, input_local_var, input_local_vars, 
4138         input_cfg, input_phi, input_ssa_names, input_bb, ): Renamed fun_in to data_in.
4139         (input_constructor): New function.
4140         (lto_read_function_body): Renamed to lto_read_body and generalized
4141         to handle both functions and constructors.
4142         (lto_read_function_body, lto_read_var_init): New function.
4143         
4144         
4145 2007-08-28  Kenneth Zadeck <zadeck@naturalbridge.com>
4147         * lto-read.c (input_expr_operand): Assert that there really is a
4148         FUNCTION_DECL.
4149         (input_globals): Removed checks on 0 section.
4150         
4151 2007-08-28  Kenneth Zadeck <zadeck@naturalbridge.com>
4153         * lto-read.c (fun_in): Added local_decls_index and
4154         local_decls_index_d.  
4155         (input_expr_operand): Changed inputting of PARM_DECLs and VAR_DECLs.
4156         (input_globals): Enabled code to handle FIELD_DECLs.
4157         (input_local_vars_index, input_local_vars): New function.
4158         (input_local_var): Changed to allow locals to be input randomly.
4159         (lto_read_function_body): Added code to input the
4160         local_decls_index and to free various structures.
4161         
4162 2007-08-17  Jim Blandy  <jimb@codesourcery.com>
4164         * lto.c (lto_read_variable_formal_parameter_constant_DIE): Remove
4165         ATTRIBUTE_UNUSED from 'die' formal.
4167         Use enum LTO_tags where appropriate, instead of 'unsigned int'.
4168         * lto-read.c (input_record_start): Fix return type, type of 'tag'.
4169         (input_list): Fix type of 'tag'.
4170         (input_expr_operand): Fix type of 'tag' argument.  Update
4171         declaration.  Fix type of 'ctag'.  Add default case to switch,
4172         since the type of the switched value is now an enum.
4173         (input_local_vars): Fix type of 'tag'.
4174         (input_bb): Fix type of 'tag' argument.
4175         (input_function): Fix type of 'tag' argument.
4177 2007-08-16  Jim Blandy  <jimb@codesourcery.com>
4179         * lto.c (lto_read_member_DIE): Record the tree we create in
4180         fd->die_cache.  (Our 'die' argument is no longer unused.)
4181         (lto_resolve_field_ref): New function.
4182         * lto.h (lto_resolve_field_ref): New declaration.
4184 2007-08-15  Jim Blandy  <jimb@codesourcery.com>
4186         * lto-read.c (lto_read_var_init): Mark arguments as unused.
4188 2007-08-07  Jim Blandy  <jimb@codesourcery.com>
4190         * lto.c (lto_read_form): Complete attr_classes table.
4191         (DWARF2_form_data): Doc fix.
4192         
4193 2007-08-05  Mark Mitchell  <mark@codesourcery.com>
4195         * lto.h (lto_file_vtable): Remove read_var_init.  Add map_var_init
4196         and unmap_var_init.
4197         (lto_read_var_init): Declare.
4198         * lto.c (lto_read_variable_formal_parameter_constant_DIE): Use new
4199         interface for reading variable initializers.
4200         * lto-elf.c (lto_elf_read_var_init): Remove.
4201         (lto_elf_file_vtable): Update initializer.
4202         (lto_elf_read_var_init): Add comment about unused-ness.
4203         * lto-read.c (lto_read_var_init): New.
4205         * lto.c (lto_read_form): Add entry for DW_AT_inline.
4207 2007-08-02  Kenneth Zadeck <zadeck@naturalbridge.com>
4209         * lto-read.c (lto_read_function_body): Moved declaration of fn
4210         outside of ifdef.
4211         
4212 2007-08-01  Kenneth Zadeck <zadeck@naturalbridge.com>
4214         * lto-read.c (input_uleb128, input_string_internal, input_real,
4215         input_integer, input_record_start, input_list, get_type_ref,
4216         input_flags, input_expr_operand, input_expr_operand,
4217         input_expr_operand, input_local_vars, input_cfg, input_phi,
4218         input_ssa_names, input_bb, input_function): Added semicolons.
4220         
4221 2007-07-31  Kenneth Zadeck <zadeck@naturalbridge.com>
4223         * lto-read.c (input_globals): Remove debugging.
4224         (input_function): Set DECL_ARGUMENTS.
4226         
4227 2007-07-31  Kenneth Zadeck <zadeck@naturalbridge.com>
4229         * lto-read.c (input_expr_operand): Fixed code for COND_EXEC,
4230         RETURN_EXPR, MODIFY_EXPR and processing of flags.
4231         (input_phi): Made work with operands other than SSA_NAMES and
4232         fixed processing of flags.
4233         (input_ssa_names): Initialize SSA_NAME_DEF_STMT to empty stmt.
4234         (input_flags): New function.
4235         * lto-lang.c (lto_init): Changed state of in_lto_p.
4236         
4237         
4238 2007-07-24  Mark Mitchell  <mark@codesourcery.com>
4240         * lto-tree.h (lto_varargs_cookie): Remove.
4241         * lto.c (lto_context): Add last_parm_type, varargs_p, skip_all,
4242         skip_non_parameters, skip_parameters.
4243         (lto_varargs_cookie): Remove.
4244         (lto_read_variable_formal_parameter_constant_DIE): Keep track of
4245         parameter types.
4246         (lto_read_abbrev): New function.
4247         (lto_read_subroutine_type_subprogram_DIE): Make two passes over
4248         child DIEs.
4249         (lto_read_unspecified_parameters_DIE): Set context->varargs_p.
4250         (lto_read_DIE): Use lto_read_abbrev.  Honor skip_* flags.
4251         (lto_file_read): Initialize new context fields.
4252         * lto-lang.c (lto_type_for_mode): Return NULL_TREE.
4253         (lto_unsigned_type): Remove.
4254         (lto_signed_type): Likewise.
4255         (lto_signed_or_unsigned_type): Likewise.
4256         (lto_init): Do not create lto_varargs_cookie.
4257         (LANG_HOOKS_UNSIGNED_TYPE): Do not define.
4258         (LANG_HOOKS_SIGNED_TYPE): Likewise.
4259         (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Likewise.
4261 2007-07-19  Jan Hubicka  <jh@suse.cz>
4263         * lto-read.c (lto_read_function_body): Produce empty scope block
4264         to avoid crash.
4266 2007-07-18  Mark Mitchell  <mark@codesourcery.com>
4268         * lto.c (lto_read_variable_formal_parameter_constant_DIE): Do not
4269         process local variables.
4270         (lto_read_subroutine_type_subprogram_DIE): Read child DIEs.
4272 2007-07-13  Kenneth Zadeck <zadeck@naturalbridge.com>
4274         * lto-read.c (input_list, input_expr_operand): Added struct
4275         function parameter.
4276         (init_cfg, finalize_cfg): Removed function.
4277         (input_expr_operand): Added SSA_NAME and GIMPLE_MODIFY_STMT cases.
4278         (input_labels, input_local_vars): Now takes input_block parameter rather than
4279         synthsyzing it.
4280         (input_cfg, input_phi, input_ssa_names): New functions.
4281         (input_bb): Now passes in input_blocks.  Does not construct cfg
4282         and processes the list of phi functions.
4283         (input_function): Now builds both the cfg and ssa_names table.
4284         (lto_read_function_body): Processes new header fields to construct
4285         streams for the ssa_names and cfg and their debugging.
4286         * lto/lto-lang.c (lto_init): Set in_lto_p.
4287         
4288         
4289 2007-06-28  Mark Mitchell  <mark@codesourcery.com>
4291         * lto.h (lto_file_vtable): Add read_var_init.
4292         * lto.c (lto_read_variable_formal_parameter_constant_DIE): Read
4293         initializers.
4294         (lto_main): Remove bogus asserts.
4295         * lto-elf.c (tm.h): Include it.
4296         (libiberty.y): Likewise.
4297         (lto_elf_file): Add strtab and symtab.  Rename
4298         string_table_section_index to sec_strtab.
4299         (lto_elf_file_vtable): Add lto_elf_read_var_init.
4300         (lto_elf_get_shdr): New function.
4301         (lto_elf_free_shdr): Likewise.
4302         (lto_elf_find_section_data): Use them.
4303         (lto_elf_read_symtab): New function.
4304         (lto_elf_lookup_sym): Likewise.
4305         (lto_elf_free_sym): Likewise.
4306         (lto_elf_file_open): Tidy.  Call lto_elf_read_symtab.
4307         (lto_elf_built_init): New function.
4308         (lto_elf_read_var_init): Likewise.
4309         * Make-lang.in (lto/lto-elf.o): Depend on $(TM_H).
4311 2007-06-26  Kenneth Zadeck <zadeck@naturalbridge.com>
4313         * lto-read (make_new_block): Initialize the stmt_list.
4314         (lto_static_init_local): Add debugging for missing codes.
4315         
4316 2007-06-26  Mark Mitchell  <mark@codesourcery.com>
4318         * lto.c (lto_read_subroutine_type_subprogram_DIE): Handle
4319         unprototyped functions. 
4321 2007-06-23  Mark Mitchell  <mark@codesourcery.com>
4323         * lto.c (lto_read_variable_formal_parameter_constant_DIE):
4324         Handle DW_AT_MIPS_linkage_name.
4325         (lto_read_subroutine_type_subprogram): Likewise.  Correct
4326         compilation errors.
4327         (lto_main): Remove incorrect assertions.
4328         * lto-symbtab.c: Build function types out of TREE_LISTs.
4330         * lto-elf.c (<libelf>): Check for HAVE_LIBELF_H.
4331         
4332         * Make-lang.in (LTO_OBJS): Depend on attribs.o.
4333         
4334 2007-06-21  Kenneth Zadeck <zadeck@naturalbridge.com>
4336         * lto/lto-tree.h (lang_decl, lang_type, language_function): Added
4337         dummy since ggc does not like empty structs.
4338         * lto/lto-elf.c (libelf.h): Changed to libelf/libelf.h.
4339         * lto/lto-read.c (ADD_CLASS_FLAG, ADD_EXPR_FLAG): Changed
4340         expr->common to expr->base.
4341         (make_new_block): Moved stmt_list to proper place.
4344 2007-03-14 Robert Kennedy  <jimbob@google.com>
4346         Eliminate use of lang_hooks.set_decl_assembler_name from LTO
4347         * lto.c (lto_read_subroutine_type_subprogram_DIE) Get DECL
4348         assembler name from DWARF.
4349         * lto-lang.c (lto_set_decl_assembler_name) New function.
4351 2006-09-10  Mark Mitchell  <mark@codesourcery.com>
4353         * lto.h (lto_file_vtable): New structure.
4354         (lto_file): Add vtable pointer.
4355         (lto_file_init): Add vtable paramter.
4356         (lto_read_function_body): New function.
4357         (lto_symtab_merge_fn): New function.
4358         * lto.c (lto_file_init): Add vtable parameter.
4359         (lto_read_form): Fill in entries for DW_AT_prototyped,
4360         DW_AT_frame_base.
4361         (lto_read_subroutine_type_subprogram_DIE): New function.
4362         (lto_read_DIE): Fill in entries for DW_TAG_subroutine_type and
4363         DW_TAG_subprogram.
4364         * lto-elf.c (lto_elf_vile_vtable): New variable.
4365         (lto_elf_file_open): Pass it to lto_file_init.
4366         (lto_elf_map_fn_body): New function.
4367         (lto_elf_unmap_fn_body): Likewise.
4368         * lto-read.c: New file.
4369         * lto-symtab.c (lto_symtab_merge_fn): New function.
4370         * lto-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Define to
4371         tree_rest_of_compilation.
4372         * Make-lang.in (LTO_OBJS): Add lto-read.o
4373         (lto-read.o): New target.
4375 2006-09-03  Mark Mitchell  <mark@codesourcery.com>
4377         * lto.c (<inttypes.h>): Don't include it.
4378         (lto_context): Don't typedef it.
4379         (lto_resolve_reference): New function.
4380         (lto_read_form): Use it.
4381         (lto_resolve_type_ref): New function.
4382         (lto_resolve_var_ref): Likewise.
4383         (lto_resolve_fn_ref): Likewise.
4384         * lto.h (<inttypes.h>): Include it.
4385         (lto_context): New type.
4386         (lto_ref): New structure.
4387         (lto_resolve_type_ref): Declare.
4388         (lto_resolve_var_ref): Likewise.
4389         (lto_resolve_fn_ref): Likewise.
4391 2006-08-18  Mark Mitchell  <mark@codesourcery.com>
4393         * lang-specs.h: New file.
4395 2006-08-14  Mark Mitchell  <mark@codesourcery.com>
4397         * lto.c (lto_info_fd_init): Allocate the DIE cache.
4398         (lto_info_fd_close): Deallocate it.
4399         (lto_die_cache_entry): New structure.
4400         (lto_cache_hash): New function.
4401         (lto_cache_eq): Likewise.
4402         (lto_cache_store_DIE): Likewise.
4403         (lto_cache_lookup_DIE): Likewise.
4404         (lto_read_referenced_type_DIE): Use the cache.
4405         (lto_read_pointer_type_DIE): Robustify.
4406         (lto_read_DIE): Use the cache.
4407         * lto.h (hashtab.h): Include.
4408         (lto_info_fd): Add DIE cache.
4409         * Make-lang.in (LTO_H): New variable.
4410         (lto/lto-lang.o): Use LTO_H.
4411         (lto/lto-elf.o): Likewise.
4412         (lto/lto-symtab.o): Likewise.
4414 2006-07-09  Mark Mitchell  <mark@codesourcery.com>
4416         * lto.c (lto_abi_mismatch_error): New function.
4417         (lto_abbrev_read): Initialize num_abbrevs.
4418         (lto_read_form): Specify allowed form classes for
4419         DW_AT_declaration.  Adjust for change to lto_set_cu_context.
4420         (lto_read_variable_formal_parameter_constant_DIE): Handle
4421         DW_AT_declaration.  Call lto_symtab_merge_var.
4422         (lto_read_pointer_type_DIE): New function.
4423         (lto_read_base_type_DIE): Use build_nonstandard_integer_type.  Do
4424         not creat TYPE_DECLs for types that already have them.
4425         (lto_read_DIE): Add lto_read_pointer_type_DIE.
4426         (lto_set_cu_context): Make cu_start point to the header, not the
4427         first DIE.
4428         (lto_file_read): Adjust for change to lto_set_cu_context.
4429         * Make-lang.in (LTO_OBJS): Add lto-symtab.o.
4430         (lto/lto-symtab.o): New rule.
4431         * lto-tree.h (lang_identifier): Add decl field.
4432         (LANG_IDENTIFIER_CAST): New macro.
4433         (LTO_IDENTIFIER_DECL): Likewise.
4434         (lto_symtab_merge_var): Declare.
4435         * lto-symtab.c: New file.
4437 2006-07-02  Daniel Berlin  <dberlin@dberlin.org>
4439         * lto.c (lto_context): Add current_cu and info_fd members.
4440         (DWARF2_CompUnit): New structure.
4441         (lto_read_DIE): Take lto_info_fd *.
4442         (lto_read_child_DIEs): Ditto.
4443         (lto_file_corrupt_error): Constify argument.
4444         (lto_set_cu_context): New function
4445         (lto_info_fd_init): Ditto.
4446         (lto_info_fd_close): Ditto.
4447         (lto_file_init): Use lto_info_fd_init.
4448         (lto_file_close): Use lto_info_fd_close.
4449         (lto_read_initial_length): Pass in pointer to header size.
4450         (lto_read_comp_unit_header): Correct cu_length to
4451         real length from beginning of header.  Take lto_info_fd * as
4452         argument.
4453         (find_cu_for_offset): New function.
4454         (lto_read_form): Change first argument to lto_info_fd *.
4455         Add FORM_CONTEXT argument.
4456         Handle DW_FORM_ref_addr.
4457         (lto_read_tag_DIE): Change first argument to lto_info_fd *.     
4458         (LTO_BEGIN_READ_ATTRS_UNCHECKED): Save old context.
4459         Swap contexts if necessary for form.
4460         (LTO_BEGIN_READ_ATTRS): Cast fd to right type for
4461         lto_file_corrupt_error.
4462         (LTO_END_READ_ATTRS): Swap contexts back if it had changed.
4463         (lto_read_referenced_type_DIE): Change first argument to
4464         lto_info_fd *.  Access lto_fd fields through base pointer.
4465         (lto_read_compile_unit_DIE): Change first argument to an
4466         lto_info_fd *.
4467         (lto_read_variable_formal_parameter_constant_DIE): Ditto.
4468         (lto_read_base_type_DIE): Ditto.
4469         (lto_read_child_DIEs): Ditto.
4470         (lto_read_DIE): Ditto.  Change type of function pointer.
4471         (lto_info_read): New function.
4472         (lto_set_cu_context): Ditto.
4473         (lto_file_read): Use lto_info_read, walk resulting CU's
4474         (lto_main): Update for lto_info_fd change.
4475         * lto-elf.c (lto_elf_file_open): Cast lto_info_fd to lto_fd where
4476         necessary.
4477         * lto.h (DWARF2_CompUnit): New structure.
4478         (lto_info_fd): Ditto.
4479         (lto_file): Change debug_info to be an lto_info_fd.
4480         
4481 2006-06-25  Mark Mitchell  <mark@codesourcery.com>
4483         * lto.c (toplev.h): Include it.
4484         (dwarf2.h): Likewise.
4485         (tree.h): Likewise.
4486         (tm.h): Likewise.
4487         (cgraph.h): Likewise.
4488         (ggc.h): Likewise.
4489         (inttypes.h): Likewise.
4490         (DWARF2_attr): New type.
4491         (DWARF2_abbrev): Likewise.
4492         (DWARF2_class): Likewise.
4493         (DWARF2_form_data): Likewise.
4494         (lto_context): Likewise.
4495         (lto_fd_init): New function.
4496         (lto_abbrev_fd_init): Likewise.
4497         (lto_abbrev_fd_close): Likewise.
4498         (lto_file_init): Use them.
4499         (lto_file_close): New function.
4500         (lto_file_corrupt_error): Likewise.
4501         (LTO_CHECK_INT_VAL): New macro.
4502         (lto_check_size_t_val): New function.
4503         (lto_check_int_val): Likewise.
4504         (LTO_READ_TYPE): New macro.
4505         (lto_read_ubyte): New function.
4506         (lto_read_uhalf): Likewise.
4507         (lto_read_uword): Likewise.
4508         (lto_read_uleb128): Likewise.
4509         (lto_read_initial_length): Likewise.
4510         (lto_abbrev_read_attrs): Likewise.
4511         (lto_abbrev_read): Likewise.
4512         (lto_abbrev_lookup): Likewise.
4513         (lto_read_section_offset): Likewise.
4514         (lto_read_comp_unit_header): Likewise.
4515         (lto_read_form): Likewise.
4516         (LTO_BEGIN_READ_ATTRS_UNCHECKED): New macro.
4517         (LTO_BEGIN_READ_ATTRS): Likewise.
4518         (LTO_END_READ_ATTRS): Likewise.
4519         (lto_unsupported_attr_error): New function.
4520         (lto_get_identifier): Likewise.
4521         (lto_read_referenced_type_DIE): Likewise.
4522         (lto_read_compile_unit_DIE): Likewise.
4523         (lto_read_variable_formal_parameter_constant_DIE): Likewise.
4524         (lto_read_base_type_DIE): Likewise.
4525         (lto_read_DIE): Likewise.
4526         (lto_read_child_DIEs): Likewise.
4527         (lto_file_read): Read DIEs.
4528         (lto_main): Ask middle end to emit entities.
4529         * lto-tree.h (lang_identifier): Inherit from tree_identifier.
4530         * lto-elf.c (lto_elf_file_open): Adjust for interface changes.
4531         (lto_elf_file_close): Likewise.
4532         * lto.h (lto_file): Declare.
4533         (DWARF2_abbrev): Likewise.
4534         (lto_fd): New type.
4535         (lto_abbrev_fd): Likewise.
4536         (lto_file): Use new types.
4537         (lto_file_close): Declare.
4538         * lto-lang.c (lto_init): Always use unit-at-a-time mode.
4539         
4540 2006-06-18  Mark Mitchell  <mark@codesourcery.com>
4542         * lto.h: New file.
4543         * lto.c: New file.
4544         * lto-elf.c: New file.
4545         * lto-lang.c (flags.h): Include it.
4546         (lto.h): Likewise.
4547         (lto_init): New function.
4548         (lto_write_globals): Remove.
4549         (LANG_HOOKS_WRITE_GLOBALS): Define to lhd_do_nothing. 
4550         (LANG_HOOKS_INIT): Define.
4551         (LANG_HOOKS_PARSE_FILE): Likewise.
4552         * Make-lang.in (LTO_OBJS): Add lto.o and lto-elf.o.
4553         (LTO_EXE): Link with libelf.
4554         (lto/lto-lang.o): Update dependencies.
4555         (lto/lto.o): New target.
4556         (lto/lto-elf.o): Likewise.
4558 2006-06-12  Mark Mitchell  <mark@codesourcery.com>
4560         * config-lang.in: New file.
4561         * Make-lang.in: Likewise.
4562         * lto-tree.h: Likewise.
4563         * lto-lang.c: Likewise.