On Wed, Jun 13, 2018 at 3:44 AM, Jan Hubicka <hubi...@ucw.cz> wrote: > Hi, > this patch adds lto-streamer-out dump file which journal what is streamed > into the output file and why. For example compiling: > > #include <stdio.h> > main() > { > fprintf (stderr, "Error\n"); > } > > We get > > Creating compressed section .gnu.lto_.profile.3e57b5d44bc7b5b7 > Creating output block for icf > Creating compressed section .gnu.lto_.icf.3e57b5d44bc7b5b7 > Creating output block for jmpfuncs > Streaming SCC of <addr_expr 0x7ffff7287240> > Streaming <addr_expr 0x7ffff7287240> to jmpfuncs > Streaming <string_cst 0x7ffff725ce00> to jmpfuncs > Encoding indexable <array_type 0x7ffff7279b28> as 0 > Encoding indexable <pointer_type 0x7ffff7279bd0> as 1 > Finished SCC of <addr_expr 0x7ffff7287240> > > Streaming SCC of <integer_cst 0x7ffff72816f0 0> > Finished SCC of <integer_cst 0x7ffff72816f0 0> > > Streaming SCC of <integer_cst 0x7ffff7281270 6> > Encoding indexable <integer_type 0x7ffff70ff150 ssizetype> as 2 > Finished SCC of <integer_cst 0x7ffff7281270 6> > > Creating compressed section .gnu.lto_.jmpfuncs.3e57b5d44bc7b5b7 > Creating output block for inline > Creating compressed section .gnu.lto_.inline.3e57b5d44bc7b5b7 > Creating compressed section .gnu.lto_.pureconst.3e57b5d44bc7b5b7 > > Streaming body of main > Creating output block for function_body > Streaming SCC of <result_decl 0x7ffff70f4960 D.2398> > Streaming <result_decl 0x7ffff70f4960 D.2398> to function_body > Encoding indexable <integer_type 0x7ffff70ff000 sizetype> as 0 > Encoding indexable <integer_type 0x7ffff70ff0a8 bitsizetype> as 1 > Encoding indexable <integer_type 0x7ffff70ff5e8 int> as 2 > Encoding indexable <function_decl 0x7ffff7283500 main> as 0 > Finished SCC of <result_decl 0x7ffff70f4960 D.2398> > > Streaming SCC of <block 0x7ffff7216d80> > Streaming <block 0x7ffff7216d80> to function_body > Finished SCC of <block 0x7ffff7216d80> > > Encoding indexable <pointer_type 0x7ffff724e540> as 3 > Streaming gimple stmt stderr.0_1 = stderr; > Streaming SCC of <mem_ref 0x7ffff7282b68> > Streaming <mem_ref 0x7ffff7282b68> to function_body > Encoding indexable <pointer_type 0x7ffff72853f0> as 4 > Streaming <addr_expr 0x7ffff7287320> to function_body > Encoding indexable <var_decl 0x7ffff72377e0 stderr> as 0 > Finished SCC of <mem_ref 0x7ffff7282b68> > > Streaming gimple stmt fwrite ("Error\n", 1, 6, stderr.0_1); > Streaming SCC of <addr_expr 0x7ffff725cf20> > Streaming <addr_expr 0x7ffff725cf20> to function_body > Encoding indexable <pointer_type 0x7ffff7285150> as 5 > Encoding indexable <function_decl 0x7ffff7197300 __builtin_fwrite> as 1 > Finished SCC of <addr_expr 0x7ffff725cf20> > > Streaming SCC of <addr_expr 0x7ffff725ce20> > Streaming <addr_expr 0x7ffff725ce20> to function_body > Streaming <string_cst 0x7ffff725ce00> to function_body > Encoding indexable <array_type 0x7ffff7279b28> as 6 > Encoding indexable <pointer_type 0x7ffff7279bd0> as 7 > Finished SCC of <addr_expr 0x7ffff725ce20> > > Streaming SCC of <integer_cst 0x7ffff7281270 6> > Encoding indexable <integer_type 0x7ffff70ff150 ssizetype> as 8 > Finished SCC of <integer_cst 0x7ffff7281270 6> > > Encoding indexable <function_type 0x7ffff718f9d8> as 9 > Streaming gimple stmt return 0; > Creating compressed section .gnu.lto_main.3e57b5d44bc7b5b7 > Finished streaming main > Encoding indexable <function_decl 0x7ffff7283500 main> as 0 > Encoding indexable <var_decl 0x7ffff72377e0 stderr> as 0 > Encoding indexable <function_decl 0x7ffff7197300 __builtin_fwrite> as 1 > Creating compressed section .gnu.lto_.symbol_nodes.3e57b5d44bc7b5b7 > Creating compressed section .gnu.lto_.refs.3e57b5d44bc7b5b7 > Creating output block for decls > Creating compressed section .gnu.lto_.decls.3e57b5d44bc7b5b7 > Outputting global stream > 0: <array_type 0x7ffff7279b28> > Streaming SCC of <array_type 0x7ffff7279b28> > Streaming <array_type 0x7ffff7279b28> to decls > Streaming <integer_type 0x7ffff7279a80> to decls > Streaming <integer_type 0x7ffff70ff3f0 char> to decls > Streaming <identifier_node 0x7ffff70fe140 char> to decls > Finished SCC of <array_type 0x7ffff7279b28> > > 1: <pointer_type 0x7ffff7279bd0> > Streaming SCC of <pointer_type 0x7ffff7279bd0> > Streaming <pointer_type 0x7ffff7279bd0> to decls > Finished SCC of <pointer_type 0x7ffff7279bd0> > > 2: <integer_type 0x7ffff70ff150 ssizetype> > 0: <function_decl 0x7ffff7283500 main> > Streaming SCC of <function_decl 0x7ffff7283500 main> > Streaming <function_decl 0x7ffff7283500 main> to decls > Streaming <optimization_node 0x7ffff70e8000> to decls > Streaming <target_option_node 0x7ffff70e7018> to decls > Streaming <identifier_node 0x7ffff7208fa0 main> to decls > Streaming <translation_unit_decl 0x7ffff70f49d8 > /home/hubicka/example.c> to decls > Streaming <identifier_node 0x7ffff727a5a0 /home/hubicka/example.c> to > decls > Streaming <function_type 0x7ffff7279738> to decls > Streaming <function_type 0x7ffff710b540> to decls > Finished SCC of <function_decl 0x7ffff7283500 main> > > 1: <function_decl 0x7ffff7197300 __builtin_fwrite> > Streaming SCC of <function_decl 0x7ffff7197300 __builtin_fwrite> > Streaming <function_decl 0x7ffff7197300 __builtin_fwrite> to decls > Streaming <identifier_node 0x7ffff7195320 fwrite> to decls > Streaming <identifier_node 0x7ffff71952d0 __builtin_fwrite> to decls > Streaming <function_type 0x7ffff718f9d8> to decls > Streaming <tree_list 0x7ffff711f7a8> to decls > Streaming <tree_list 0x7ffff711f780> to decls > Streaming <tree_list 0x7ffff711f758> to decls > Streaming <tree_list 0x7ffff711f730> to decls > Streaming <tree_list 0x7ffff7193a28> to decls > Streaming <identifier_node 0x7ffff710c910 nonnull> to decls > Finished SCC of <function_decl 0x7ffff7197300 __builtin_fwrite> > > 0: <var_decl 0x7ffff72377e0 stderr> > Streaming SCC of <var_decl 0x7ffff72377e0 stderr> > Streaming <var_decl 0x7ffff72377e0 stderr> to decls > Streaming <identifier_node 0x7ffff7261d20 stderr> to decls > Streaming <pointer_type 0x7ffff724e540> to decls > Streaming <record_type 0x7ffff7247930 _IO_FILE> to decls > Streaming <field_decl 0x7ffff7255558 _unused2> to decls > Streaming <identifier_node 0x7ffff7254910 _unused2> to decls > Streaming <array_type 0x7ffff724e930> to decls > Streaming <integer_type 0x7ffff724e888> to decls > Streaming <field_decl 0x7ffff72554c0 _mode> to decls > Streaming <identifier_node 0x7ffff72548c0 _mode> to decls > Streaming <field_decl 0x7ffff7255428 __pad5> to decls > Streaming <identifier_node 0x7ffff7254870 __pad5> to decls > Streaming <integer_type 0x7ffff72107e0 size_t> to decls > Streaming <identifier_node 0x7ffff723da50 size_t> to decls > Streaming <field_decl 0x7ffff7255390 __pad4> to decls > Streaming <identifier_node 0x7ffff7254820 __pad4> to decls > Streaming <field_decl 0x7ffff72552f8 __pad3> to decls > Streaming <identifier_node 0x7ffff72547d0 __pad3> to decls > Streaming <field_decl 0x7ffff7255260 __pad2> to decls > Streaming <identifier_node 0x7ffff7254780 __pad2> to decls > Streaming <field_decl 0x7ffff72551c8 __pad1> to decls > Streaming <identifier_node 0x7ffff7254730 __pad1> to decls > Streaming <field_decl 0x7ffff7255130 _offset> to decls > Streaming <identifier_node 0x7ffff72545f0 _offset> to decls > Streaming <integer_type 0x7ffff72422a0 __off64_t> to decls > Streaming <identifier_node 0x7ffff7243050 __off64_t> to decls > Streaming <field_decl 0x7ffff7255098 _lock> to decls > Streaming <identifier_node 0x7ffff72544b0 _lock> to decls > Streaming <pointer_type 0x7ffff724e7e0> to decls > Streaming <void_type 0x7ffff724e348 _IO_lock_t> to decls > Streaming <identifier_node 0x7ffff72511e0 _IO_lock_t> to decls > Streaming <field_decl 0x7ffff7255000 _shortbuf> to decls > Streaming <identifier_node 0x7ffff72540a0 _shortbuf> to decls > Streaming <array_type 0x7ffff724e738> to decls > Streaming <integer_type 0x7ffff710ad20> to decls > Streaming <field_decl 0x7ffff7252ed8 _vtable_offset> to decls > Streaming <identifier_node 0x7ffff7254460 _vtable_offset> to decls > Streaming <field_decl 0x7ffff7252e40 _cur_column> to decls > Streaming <identifier_node 0x7ffff7254410 _cur_column> to decls > Streaming <field_decl 0x7ffff7252da8 _old_offset> to decls > Streaming <identifier_node 0x7ffff7254370 _old_offset> to decls > Streaming <integer_type 0x7ffff72421f8 __off_t> to decls > Streaming <identifier_node 0x7ffff7243000 __off_t> to decls > Streaming <field_decl 0x7ffff7252d10 _flags2> to decls > Streaming <identifier_node 0x7ffff7254320 _flags2> to decls > Streaming <field_decl 0x7ffff7252c78 _fileno> to decls > Streaming <identifier_node 0x7ffff7254280 _fileno> to decls > Streaming <field_decl 0x7ffff7252be0 _chain> to decls > Streaming <identifier_node 0x7ffff7254230 _chain> to decls > Streaming <field_decl 0x7ffff7252b48 _markers> to decls > Streaming <identifier_node 0x7ffff72541e0 _markers> to decls > Streaming <pointer_type 0x7ffff724e498> to decls > Streaming <record_type 0x7ffff724e3f0 _IO_marker> to decls > Streaming <field_decl 0x7ffff72522f8 _pos> to decls > Streaming <identifier_node 0x7ffff7251320 _pos> to decls > Streaming <field_decl 0x7ffff7252260 _sbuf> to decls > Streaming <identifier_node 0x7ffff72512d0 _sbuf> to decls > Streaming <field_decl 0x7ffff72521c8 _next> to decls > Streaming <identifier_node 0x7ffff7251280 _next> to decls > Streaming <type_decl 0x7ffff7252130 D.1971> to decls > Streaming <identifier_node 0x7ffff7251230 _IO_marker> to decls > Streaming <field_decl 0x7ffff7252ab0 _IO_save_end> to decls > Streaming <identifier_node 0x7ffff7251f50 _IO_save_end> to decls > Streaming <pointer_type 0x7ffff710ae70> to decls > Streaming <field_decl 0x7ffff7252a18 _IO_backup_base> to decls > Streaming <identifier_node 0x7ffff7251f00 _IO_backup_base> to decls > Streaming <field_decl 0x7ffff7252980 _IO_save_base> to decls > Streaming <identifier_node 0x7ffff7251eb0 _IO_save_base> to decls > Streaming <field_decl 0x7ffff72528e8 _IO_buf_end> to decls > Streaming <identifier_node 0x7ffff7251e60 _IO_buf_end> to decls > Streaming <field_decl 0x7ffff7252850 _IO_buf_base> to decls > Streaming <identifier_node 0x7ffff7251e10 _IO_buf_base> to decls > Streaming <field_decl 0x7ffff72527b8 _IO_write_end> to decls > Streaming <identifier_node 0x7ffff7251dc0 _IO_write_end> to decls > Streaming <field_decl 0x7ffff7252720 _IO_write_ptr> to decls > Streaming <identifier_node 0x7ffff7251d70 _IO_write_ptr> to decls > Streaming <field_decl 0x7ffff7252688 _IO_write_base> to decls > Streaming <identifier_node 0x7ffff7251d20 _IO_write_base> to decls > Streaming <field_decl 0x7ffff72525f0 _IO_read_base> to decls > Streaming <identifier_node 0x7ffff7251cd0 _IO_read_base> to decls > Streaming <field_decl 0x7ffff7252558 _IO_read_end> to decls > Streaming <identifier_node 0x7ffff7251c80 _IO_read_end> to decls > Streaming <field_decl 0x7ffff72524c0 _IO_read_ptr> to decls > Streaming <identifier_node 0x7ffff7251c30 _IO_read_ptr> to decls > Streaming <field_decl 0x7ffff7252428 _flags> to decls > Streaming <identifier_node 0x7ffff7254140 _flags> to decls > Streaming <type_decl 0x7ffff7249428 D.1950> to decls > Streaming <identifier_node 0x7ffff7243a00 _IO_FILE> to decls > Streaming <field_decl 0x7ffff7252260 _sbuf> to decls > Streaming <record_type 0x7ffff724e3f0 _IO_marker> to decls > Streaming <field_decl 0x7ffff72522f8 _pos> to decls > Streaming <field_decl 0x7ffff72521c8 _next> to decls > Streaming <pointer_type 0x7ffff724e498> to decls > Streaming <type_decl 0x7ffff7252130 D.1971> to decls > Streaming <pointer_type 0x7ffff724e540> to decls > Streaming <record_type 0x7ffff7247930 _IO_FILE> to decls > Streaming <field_decl 0x7ffff7255558 _unused2> to decls > Streaming <field_decl 0x7ffff72554c0 _mode> to decls > Streaming <field_decl 0x7ffff7255428 __pad5> to decls > Streaming <field_decl 0x7ffff7255390 __pad4> to decls > Streaming <field_decl 0x7ffff72552f8 __pad3> to decls > Streaming <field_decl 0x7ffff7255260 __pad2> to decls > Streaming <field_decl 0x7ffff72551c8 __pad1> to decls > Streaming <field_decl 0x7ffff7255130 _offset> to decls > Streaming <field_decl 0x7ffff7255098 _lock> to decls > Streaming <field_decl 0x7ffff7255000 _shortbuf> to decls > Streaming <field_decl 0x7ffff7252ed8 _vtable_offset> to decls > Streaming <field_decl 0x7ffff7252e40 _cur_column> to decls > Streaming <field_decl 0x7ffff7252da8 _old_offset> to decls > Streaming <field_decl 0x7ffff7252d10 _flags2> to decls > Streaming <field_decl 0x7ffff7252c78 _fileno> to decls > Streaming <field_decl 0x7ffff7252be0 _chain> to decls > Streaming <field_decl 0x7ffff7252b48 _markers> to decls > Streaming <field_decl 0x7ffff7252ab0 _IO_save_end> to decls > Streaming <field_decl 0x7ffff7252a18 _IO_backup_base> to decls > Streaming <field_decl 0x7ffff7252980 _IO_save_base> to decls > Streaming <field_decl 0x7ffff72528e8 _IO_buf_end> to decls > Streaming <field_decl 0x7ffff7252850 _IO_buf_base> to decls > Streaming <field_decl 0x7ffff72527b8 _IO_write_end> to decls > Streaming <field_decl 0x7ffff7252720 _IO_write_ptr> to decls > Streaming <field_decl 0x7ffff7252688 _IO_write_base> to decls > Streaming <field_decl 0x7ffff72525f0 _IO_read_base> to decls > Streaming <field_decl 0x7ffff7252558 _IO_read_end> to decls > Streaming <field_decl 0x7ffff72524c0 _IO_read_ptr> to decls > Streaming <field_decl 0x7ffff7252428 _flags> to decls > Streaming <type_decl 0x7ffff7249428 D.1950> to decls > Finished SCC of <var_decl 0x7ffff72377e0 stderr> > > Outputting stream for main > 0: <integer_type 0x7ffff70ff000 sizetype> > 1: <integer_type 0x7ffff70ff0a8 bitsizetype> > 2: <integer_type 0x7ffff70ff5e8 int> > 3: <pointer_type 0x7ffff724e540> > 4: <pointer_type 0x7ffff72853f0> > Streaming SCC of <pointer_type 0x7ffff72853f0> > Streaming <pointer_type 0x7ffff72853f0> to decls > Finished SCC of <pointer_type 0x7ffff72853f0> > > 5: <pointer_type 0x7ffff7285150> > Streaming SCC of <pointer_type 0x7ffff7285150> > Streaming <pointer_type 0x7ffff7285150> to decls > Finished SCC of <pointer_type 0x7ffff7285150> > > 6: <array_type 0x7ffff7279b28> > 7: <pointer_type 0x7ffff7279bd0> > 8: <integer_type 0x7ffff70ff150 ssizetype> > 9: <function_type 0x7ffff718f9d8> > 0: <function_decl 0x7ffff7283500 main> > 1: <function_decl 0x7ffff7197300 __builtin_fwrite> > 0: <var_decl 0x7ffff72377e0 stderr> > Creating section .gnu.lto_.symtab.3e57b5d44bc7b5b7 > Creating section .gnu.lto_.opts > > Bootstrapped/regtested x86_64-linux, plan to commit it later today if there > are no complains. > > * cgraph.c (cgraph_node::get_untransformed_body): Dump function > bodies streamed in with -Q. > * dumpfile.c (dump_files): Add lto-stream-out dump file. > * dumpfile.h (tree_dump_index): Add lto_stream_out. > * gimple-streamer-out.c: Include gimple-pretty-print.h > (output_bb): Dump stmts streamed. > * lto-section-out.c: Include print-tree.h > (lto_begin_section): Dump sections created. > (lto_output_decl_index): Dump decl encoded. > * lto-streamer-out.c: Include print-tree.h > (create_output_block): Dump output block created. > (DFS::DFS_write_tree_body): Dump DFS SCCs streamed. > (output_function): Dump function output. > (output_constructor): Dump constructor streamed. > (write_global_stream): Output indexes encoded. > (produce_asm_for_decls): Dump streams encoded. > * lto-streamer.c (streamer_dump_file): New global var. > * lto-streamer.h (streamer_dump_file): Declare. > * passes.c (ipa_write_summaries): Initialize streamer dump. > * varpool.c (varpool_node::get_constructor): Dump constructors > streamed > in.
Does this cause FAIL: gcc.c-torture/unsorted/dump-noaddr.c.*i.lto-stream-out, -O2 -flto -fno-use-linker-plugin -flto-partition=none comparison FAIL: gcc.c-torture/unsorted/dump-noaddr.c.*i.lto-stream-out, -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects comparison -- H.J.