https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88535

john henning <mailboxnotfound at yahoo dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mailboxnotfound at yahoo dot 
com

--- Comment #2 from john henning <mailboxnotfound at yahoo dot com> ---
Thank you Rainer for reproducing this and filing the bug.  As the originator of
the complaint, I (john henning) add a few more points. 

All of my attempts were with gcc 8.2.0; failures were observed on 2 different
SPARC Solaris 11 systems, one with 11.4 and one with 11.5.

(1) dwarf2out.o is the only object that differs.

(2) output_file_names is the only routine within dwarf2out.o to have a
differing size (according to nm)

(3) An early difference (possibly the first) seems to be the code that is
generated for dwarf2out.c line 12301

   $ cat -n ../gcc-8.2.0/gcc/dwarf2out.c | head -12312 | tail -17 
    12296  /* If there are more than 65536 directories, we have to use 
    12297     DW_FORM_udata, DW_FORM_data2 can't refer to them. 
    12298     Otherwise, compute what space would occupy if all the indexes 
    12299     used DW_FORM_udata - sum - and compare that to how large would 
    12300     be DW_FORM_data2 encoding, and pick the more efficient one.  */ 
    12301  else if (ndirs + idx_offset <= 65536) 
    12302    { 
    12303      unsigned HOST_WIDE_INT sum = 1; 
    12304      for (i = 0; i < numfiles; i++) 
    12305        { 
    12306          int file_idx = backmap[i]; 
    12307          int dir_idx = dirs[files[file_idx].dir_idx].dir_idx; 
    12308          sum += size_of_uleb128 (dir_idx); 
    12309        } 
    12310      if (sum >= HOST_WIDE_INT_UC (2) * (numfiles + 1)) 
    12311        idx_form = DW_FORM_data2; 
    12312   

Here are the first 40 instructions for that line, according to gdb
(shrunk/excerpted to fit a small number of columns for ease of side-by-side
viewing):

$ gdb -q stage2-gcc/lto1              $ gdb -q stage3-gcc/lto1
. break dwarf2out.c:12301             . break dwarf2out.c:12301
Breakpoint 1 at 0x435fb8: file        Breakpoint 1 at 0x435fb0: file 
gcc-8.2.0/gcc/dwarf2out.c, line 12301 gcc-8.2.0/gcc/dwarf2out.c, line 12301
. x/40i 0x435fb8                      . x/40i 0x435fb0
 sethi  %hi(0x10000), %g1              sethi  %hi(0x10000), %g1
 cmp  %l0, %g1                         cmp  %l0, %g1
 bg  %icc, 0x436164 <output_file_name  bg  %icc, 0x436188 <output_file_name
 clr  %o1                              clr  %o1
 clr  %l0                              clr  %l0
 cmp  %i4, 0                           cmp  %i4, 0
 ble,pn   %icc, 0x436030 <output_file  ble,pn   %icc, 0x436054 <output_file
 mov  1, %l1                           mov  1, %l1
 mov  %l6, %l7                         mov  %l2, %g1
 add  %l5, %l6, %l5                    st  %l3, [ %fp + -24 ]
 st  %i2, [ %fp + -20 ]                mov  %i0, %l2
 st  %i3, [ %fp + -24 ]                mov  %i2, %l3
 ld  [ %l7 ], %g1                      mov  %i1, %i0
 smul  %g1, 0x14, %g1                  add  %l5, %l6, %l5
 add  %i5, %g1, %g1                    st  %i4, [ %fp + -20 ]
 ld  [ %g1 + 0x10 ], %g1               mov  %l6, %i1
 smul  %g1, 0x14, %g1                  mov  %i5, %i2
 add  %l4, %g1, %g1                    mov  %g1, %l7
 ld  [ %g1 + 0x10 ], %o1               ld  [ %i1 ], %g1
 call  0x40af9c <size_of_uleb128(unsi> smul  %g1, 0x14, %g1
 sra  %o1, 0x1f, %o0                   add  %i2, %g1, %g1
 addcc  %l1, %o0, %l1                  ld  [ %g1 + 0x10 ], %g1
 sra  %o0, 0x1f, %i2                   smul  %g1, 0x14, %g1
 add  %l7, 4, %l7                      add  %l4, %g1, %g1
 addc  %l0, %i2, %l0                   ld  [ %g1 + 0x10 ], %o1
 cmp  %l7, %l5                         call  0x40af94 <size_of_uleb128(unsi
 bne,a   %icc, 0x435fec <output_file_  sra  %o1, 0x1f, %o0
 ld  [ %l7 ], %g1                      addcc  %l1, %o0, %l1
 ld  [ %fp + -20 ], %i2                sra  %o0, 0x1f, %i4
 ld  [ %fp + -24 ], %i3                add  %i1, 4, %i1
 addcc  %l2, %l2, %o5                  addc  %l0, %i4, %l0
 addc  %l3, %l3, %o4                   cmp  %i1, %l5
 cmp  %o4, %l0                         bne,a   %icc, 0x435ffc <output_file_
 bgu  %icc, 0x436164 <output_file_nam  ld  [ %i1 ], %g1
 clr  %o1                              mov  %i0, %i1
 bne  %icc, 0x436060 <output_file_nam  mov  %i2, %i5
 mov  2, %o2                           mov  %l2, %i0
 cmp  %o5, %l1                         mov  %l3, %i2
 bgu,a   %icc, 0x43616c <output_file_  ld  [ %fp + -20 ], %i4
 mov  1, %o0                           mov  %l7, %l2

Reply via email to