http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46760

--- Comment #5 from Dave Korn <davek at gcc dot gnu.org> 2010-12-02 07:47:13 
UTC ---
(In reply to comment #4)

>  -DHAVE_CONFIG_H -DGENERATOR_FILE  -o build/genchecksum \
>         build/genchecksum.o .././libiberty/libiberty.a
> lto1: sorry, unimplemented: combining units with different profiles is not
> supported
> lto1: internal compiler error: in lto_file_decl_data_get_fn_decl, at
> lto-streamer.h:1075


  This sorry comes from input_profile_summary() in lto-cgraph.c, in fact:


static struct gcov_ctr_summary lto_gcov_summary;

/* Input profile_info from IB.  */
static void
input_profile_summary (struct lto_input_block *ib)
{
  unsigned int runs = lto_input_uleb128 (ib);
  if (runs)
    {
      if (!profile_info)
        {
      profile_info = &lto_gcov_summary;
      lto_gcov_summary.runs = runs;
      lto_gcov_summary.sum_all = lto_input_sleb128 (ib);
      lto_gcov_summary.run_max = lto_input_sleb128 (ib);
      lto_gcov_summary.sum_max = lto_input_sleb128 (ib);
    }
      /* We can support this by scaling all counts to nearest common multiple
         of all different runs, but it is perhaps not worth the effort.  */
      else if (profile_info->runs != runs
           || profile_info->sum_all != lto_input_sleb128 (ib)
           || profile_info->run_max != lto_input_sleb128 (ib)
           || profile_info->sum_max != lto_input_sleb128 (ib))
    sorry ("combining units with different profiles is not supported");
      /* We allow some units to have profile and other to not have one.  This
will
         just make unprofiled units to be size optimized that is sane.  */
    }

}

This is the start of the cgraph data from build/genchecksum.o:

(gdb) c
Continuing.

Breakpoint 5, lto_create_simple_input_block (file_data=0x7ffff7267000,
    section_type=LTO_section_cgraph, datar=0x7fffffffd858, len=0x7fffffffd860)
    at /n/10/davek/gcc/gcc/gcc/lto-section-in.c:294
294     {
$17 = {current_decl_state = 0x7ffff7275000,
  global_decl_state = 0x7ffff7275000, cgraph_node_encoder = 0x0,
  varpool_node_encoder = 0x0, function_decl_states = 0x7ffff735dcb0,
  file_name = 0x1bde940 "build/genchecksum.o", section_hash_table = 0x1bfa560,
  renaming_hash_table = 0x1bfb4a0, next = 0x0, id = 3807079657,
  resolutions = 0x1bfab30}
(gdb) fin
Run till exit from #0  lto_create_simple_input_block (
    file_data=0x7ffff7267000, section_type=LTO_section_cgraph,
    datar=0x7fffffffd858, len=0x7fffffffd860)
    at /n/10/davek/gcc/gcc/gcc/lto-section-in.c:294
input_cgraph () at /n/10/davek/gcc/gcc/gcc/lto-cgraph.c:1475
1475          if (!ib)
Value returned is $18 = (struct lto_input_block *) 0x1bfa250
(gdb) p $18[0]
$19 = {data = 0x1bfa020 "\004\201?\225\r??\237\003?\233\f\002\177", p = 0,
  len = 551}
(gdb) x/551xb $18->data
0x1bfa020:      0x04    0x81    0xf1    0x95    0x0d    0xc0    0xdc    0x9f
0x1bfa028:      0x03    0xda    0xb9    0x9b    0x0c    0x02    0x7f    0x00
0x1bfa030:      0x00    0x00    0x06    0x07    0x05    0x0f    0x7f    0x7f
0x1bfa038:      0xbc    0xa0    0x0a    0x00    0x00    0x02    0x7f    0x01
0x1bfa040:      0xbd    0x01    0xc8    0x20    0xe4    0x00    0x06    0xe2

and here is how it gets read into lto_gcov_summary first time
input_profile_summary is called:

(gdb) p &'lto_gcov_summary.170684.49820'
$27 = (<data variable, no debug info> *) 0x1777280
(gdb) p (struct gcov_ctr_summary *)&'lto_gcov_summary.170684.49820'
$28 = (struct gcov_ctr_summary *) 0x1777280
(gdb) p $28[0]
$29 = {num = 0, runs = 4, sum_all = 27621505, run_max = 6811200,
  sum_max = 25615578}
(gdb) p/x $28[0]
$30 = {num = 0x0, runs = 0x4, sum_all = 0x1a57881, run_max = 0x67ee40,
  sum_max = 0x186dcda}
(gdb)

But here's the start of the ../libiberty/md5.o cgraph section data:

(gdb) c
Continuing.

Breakpoint 5, lto_create_simple_input_block (file_data=0x7ffff72670b0,
    section_type=LTO_section_cgraph, datar=0x7fffffffd858, len=0x7fffffffd860)
    at /n/10/davek/gcc/gcc/gcc/lto-section-in.c:294
294     {
$22 = {current_decl_state = 0x7ffff7275870,
  global_decl_state = 0x7ffff7275870, cgraph_node_encoder = 0x0,
  varpool_node_encoder = 0x0, function_decl_states = 0x7ffff735dd20,
  file_name = 0x1bfb480 "../libiberty/md5.o", section_hash_table = 0x1bfcdd0,
  renaming_hash_table = 0x1bfae30, next = 0x0, id = 3807079657,
  resolutions = 0x1bfb770}
(gdb) fin
Run till exit from #0  lto_create_simple_input_block (
    file_data=0x7ffff72670b0, section_type=LTO_section_cgraph,
    datar=0x7fffffffd858, len=0x7fffffffd860)
    at /n/10/davek/gcc/gcc/gcc/lto-section-in.c:294
input_cgraph () at /n/10/davek/gcc/gcc/gcc/lto-cgraph.c:1475
1475          if (!ib)
Value returned is $23 = (struct lto_input_block *) 0x1bfbb50
(gdb) p $23[0]
$24 = {
  data = 0x1bfc0e0 "?\016??\212?\212\002\220?\204\017??\204?\002\002\177",
  p = 0, len = 352}
(gdb) x/352xb $23->data
0x1bfc0e0:      0xc0    0x0e    0xaf    0xbc    0x8a    0xed    0x8a    0x02
0x1bfc0e8:      0x90    0xcf    0x84    0x0f    0xa3    0xa1    0x84    0xb4
0x1bfc0f0:      0x02    0x02    0x7f    0x00    0x08    0x00    0x0b    0x09
0x1bfc0f8:      0x0a    0x11    0x7f    0x7f    0x9e    0xa0    0x0a    0x00
0x1bfc100:      0x00    0x02    0x7f    0x01    0x00    0x00    0x0b    0x0b
0x1bfc108:      0x0a    0x13    0x7f    0x7f    0x9e    0xa0    0x0a    0x00

which gives me { runs = 0x740, sum_all = 0x10ada29e2f, run_max = 0x1e12790,
sum_max = 0x268110a3 }, none of which remotely matches up with the gcov summary
from genchecksum.o

Reply via email to