This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: haifa life change


Am Mit, 13 Okt 1999 schrieb Richard Henderson:
>On Wed, Oct 13, 1999 at 09:58:23PM +0200, Franz Sirl wrote:
>> Should I track it down further or did you already expect some fallout like
>> that of your patch?
>
>I wasn't expecting anything like that.  It would be interesting
>to know what register, and the before/after for that basic block.

>From flow2:
Basic block 31: first insn 553, last 562.
Predecessors:  29
Successors:  32 (fallthru) 33 (crit)
Registers live at start: 1 12 14 15 16 17 18 19 20 21 26 31
Registers live at end: 1 12 14 15 16 17 18 19 20 21 26 31
 
Basic block 32: first insn 3225, last 3188.
Predecessors:  31 (fallthru)
Successors:  33 (fallthru)
Registers live at start: 1 12 14 15 16 17 18 19 20 21 26 31
Registers live at end: 1 12 14 15 16 17 18 19 20 21 26 31
 
Basic block 33: first insn 568, last 591.
Predecessors:  32 (fallthru) 31 (crit)
Successors:  170
Registers live at start: 1 12 14 15 16 17 18 19 20 21 26 31
Registers live at end: 1 12 14 15 16 17 18 19 20 21 27 28 31                                                                           

....

;; Start of basic block 32, registers live: 1 [1] 12 [12] 14 [14] 15 [15] 16 [16] 17 [17] 18 [18] 19 [19] 20 [20] 21 [21] 26 [26] 31 [31]
(note 3225 563 564 [bb 32] NOTE_INSN_BASIC_BLOCK)
 
(insn 564 3225 565 (set (reg:SI 3 r3)
        (high:SI (symbol_ref:SI ("*.LC1")))) 420 {elf_high} (nil)
    (expr_list:REG_EQUIV (high:SI (symbol_ref:SI ("*.LC1")))
        (nil)))
 
(insn 565 564 567 (set (reg:SI 3 r3)
        (lo_sum:SI (reg:SI 3 r3)
            (symbol_ref:SI ("*.LC1")))) 421 {elf_low} (insn_list 564 (insn_list 564 (nil)))
    (expr_list:REG_EQUAL (symbol_ref:SI ("*.LC1"))
        (nil)))
 
(call_insn 567 565 3188 (parallel[
            (call (mem:SI (symbol_ref:SI ("pedwarn")) 0)
                (const_int 0 [0x0]))
            (use (const_int 4 [0x4]))
            (clobber (reg:SI 65 lr))
        ] ) 533 {*call_nonlocal_sysv} (insn_list 565 (insn_list:REG_DEP_ANTI 564 (insn_list 565 (nil))))
    (expr_list:REG_DEAD (reg:SI 3 r3)
        (expr_list:REG_UNUSED (reg:SI 65 lr)
            (nil)))
    (expr_list (use (reg:SI 3 r3))
        (nil)))
 
(insn 3188 567 568 (use (const_int 0 [0x0])) -1 (insn_list:REG_DEP_ANTI 567 (nil))
    (nil))
;; End of basic block 32                                                                                                               


then in schedule before the abort:

(gdb) p debug_rtx_list(bb->head,30)

(note 3225 563 564 [bb 32] NOTE_INSN_BASIC_BLOCK)

(insn 564 3225 565 (set (reg:SI 3 r3)
        (high:SI (symbol_ref:SI ("*.LC1")))) 420 {elf_high} (nil)
    (expr_list:REG_EQUIV (high:SI (symbol_ref:SI ("*.LC1")))
        (nil)))

(insn:TI 565 564 567 (set (reg:SI 3 r3)
        (lo_sum:SI (reg:SI 3 r3)
            (symbol_ref:SI ("*.LC1")))) 421 {elf_low} (insn_list 564 (nil))
    (expr_list:REG_EQUAL (symbol_ref:SI ("*.LC1"))
        (nil)))

(call_insn:TI 567 565 3188 (parallel[
            (call (mem:SI (symbol_ref:SI ("pedwarn")) 0)
                (const_int 0 [0x0]))
            (use (const_int 4 [0x4]))
            (clobber (reg:SI 65 lr))
        ] ) 533 {*call_nonlocal_sysv} (insn_list:REG_DEP_ANTI 564 (insn_list 565 (nil)))
    (expr_list:REG_DEAD (reg:SI 3 r3)
        (expr_list:REG_UNUSED (reg:SI 65 lr)
            (nil)))
    (expr_list (use (reg:SI 3 r3))
        (nil)))

(insn 3188 567 568 (use (const_int 0 [0x0])) -1 (insn_list:REG_DEP_ANTI 567 (nil))
    (nil))

(code_label 568 3188 3226 212 "" [num uses: 1])

(note 3226 568 569 [bb 33] NOTE_INSN_BASIC_BLOCK)

(note 569 3226 571 ("cexp.y") 198)


And then the abort happens here:

2518      if (reload_completed)
2519        {
2520          /* After reload, there are no pseudos, nor subregs of multi-word
2521             registers.  The regsets should exactly match.  */
2522          if (! REG_SET_EQUAL_P (new_live_at_start, bb->global_live_at_start))
2523            abort ();
2524        }                                                                                                                          

#0  fancy_abort (file=0x102f6bd4 "../../../cvsx/gccm/gcc/flow.c", line=2523, function=0x102f6d44 "verify_local_live_at_start")
    at ../../../cvsx/gccm/gcc/rtl.c:1109
#1  0x10159780 in verify_local_live_at_start (new_live_at_start=0x7fffde10, bb=0x1035b190) at ../../../cvsx/gccm/gcc/flow.c:2523
#2  0x10159b60 in update_life_info (blocks=0x1041dad8, extent=UPDATE_LIFE_LOCAL) at ../../../cvsx/gccm/gcc/flow.c:2586
#3  0x101ffa4c in schedule_region (rgn=32) at ../../../cvsx/gccm/gcc/haifa-sched.c:6757
#4  0x10200588 in schedule_insns (dump_file=0x0) at ../../../cvsx/gccm/gcc/haifa-sched.c:7011
#5  0x100074a4 in rest_of_compilation (decl=0x301af600) at ../../../cvsx/gccm/gcc/toplev.c:4228
#6  0x102c24bc in finish_function (nested=0) at ../../../cvsx/gccm/gcc/c-decl.c:6773
#7  0x102ab718 in yyparse () at c-parse.y:314
#8  0x10004cf0 in compile_file (name=0x3002a2e0 "cexp.i") at ../../../cvsx/gccm/gcc/toplev.c:3181
#9  0x10009e44 in main (argc=13, argv=0x7ffff864) at ../../../cvsx/gccm/gcc/toplev.c:5498
#10 0xff0b41c in Letext () at ../sysdeps/powerpc/elf/libc-start.c:106                                                                  

(gdb) p *new_live_at_start
$28 = {first = 0x103bdab0, current = 0x103bdab0, indx = 0}
(gdb) p *bb->global_live_at_start
$29 = {first = 0x10485424, current = 0x10485424, indx = 0}
(gdb) p *bb->global_live_at_start->first
$30 = {next = 0x0, prev = 0x0, indx = 0, bits = {2218774530, 0}}
(gdb) p *bb->global_live_at_start->current
$31 = {next = 0x0, prev = 0x0, indx = 0, bits = {2218774530, 0}}
(gdb) p *new_live_at_start->first
$32 = {next = 0x0, prev = 0x0, indx = 0, bits = {2218770434, 0}}
(gdb) p *new_live_at_start->current
$33 = {next = 0x0, prev = 0x0, indx = 0, bits = {2218770434, 0}}                                                                       

 2218770434==0x843FC002
 2218774530==0x843FD002

This seems to be r12 missing in new_live_at_start. Further inspection showed
that the bit is deleted in propagate_block due to this insn:

(gdb) p debug_rtx(insn)
(call_insn:TI 567 565 3188 (parallel[
            (call (mem:SI (symbol_ref:SI ("pedwarn")) 0)
                (const_int 0 [0x0]))
            (use (const_int 4 [0x4]))
            (clobber (reg:SI 65 lr))
        ] ) 533 {*call_nonlocal_sysv} (insn_list:REG_DEP_ANTI 564 (insn_list 565 (nil)))
    (expr_list:REG_DEAD (reg:SI 3 r3)
        (expr_list:REG_UNUSED (reg:SI 65 lr)
            (nil)))
    (expr_list (use (reg:SI 3 r3))
        (nil)))                                                                                                                        
(gdb) bt
#0  propagate_block (old=0x7fffde10, first=0x302221a0, last=0x30220d00, significant=0x0, bnum=32, flags=1)
    at ../../../cvsx/gccm/gcc/flow.c:3455
#1  0x10159c70 in update_life_info (blocks=0x10417cb0, extent=UPDATE_LIFE_LOCAL) at ../../../cvsx/gccm/gcc/flow.c:2582
#2  0x101ffbfc in schedule_region (rgn=32) at ../../../cvsx/gccm/gcc/haifa-sched.c:6757
#3  0x10200738 in schedule_insns (dump_file=0x0) at ../../../cvsx/gccm/gcc/haifa-sched.c:7011
#4  0x100074a4 in rest_of_compilation (decl=0x301af600) at ../../../cvsx/gccm/gcc/toplev.c:4228
#5  0x102c2674 in finish_function (nested=0) at ../../../cvsx/gccm/gcc/c-decl.c:6773
#6  0x102ab8d0 in yyparse () at c-parse.y:314
#7  0x10004cf0 in compile_file (name=0x3002a2e0 "cexp.i") at ../../../cvsx/gccm/gcc/toplev.c:3181
#8  0x10009e44 in main (argc=13, argv=0x7ffff864) at ../../../cvsx/gccm/gcc/toplev.c:5498
#9  0xff0b41c in Letext () at ../sysdeps/powerpc/elf/libc-start.c:106                                                                  

While I was looking at this, I noticed a possible bug in bitmap.h.
bitmap->bitmap_elem->bits is used to store a register map and is sized 2 words.
But on PPC 3 words are needed to store the full map. I increased
BITMAP_ELEMENT_WORDS to 3 in bitmap.h and could happily watch the bits in the
3rd word being set and cleared :-). Unfortunately it did not cure the
bug :-(.

Franz.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]