No Subject


Sun Feb 28 23:30:00 GMT 1999


  r28 is assigned &clist_row on line 175 in the .s file
      on lines 251..253 as the base of clist_row
  r28 is reset to 0 on line 288 and is used as (i*sizeof(GtkCell))
  r28 is still used as &clist_row on line 588 in the .s file


Line 175 contains:

        mr 28,29

So presumably r29 had the value of &clist_row?  However, from looking at the
assembly code I think it really holds the value of &cell_rectangle, clist_row
is actually held in r25 as best as I can tell.


Line 288 has:
        li 28,2772

Which doesn't set r28 to zero as far as I can tell.  Now it certainly does
set it to a different value than it previously had.

Line 588 has:

        lwz 0,4(3)

Which doesn't reference r28 at all.


I've also spent a fair amount of time looking at the assembly code for
this function, and I don't see the problem.


Here's a nice big hunk of assembly code starting with the first instruction
you mentioned.

        mr 28,29  # 1823 movsi+1/1                      /* SETTER */
        sth 0,6(23)  # 220 movhi+1/3
        lwz 9,4(25)  # 223 movsi+1/3
        mr 16,23  # 1824 movsi+1/1
        cmpwi 0,9,0  # 224 sleu+1
        bc 4,2,.L76  # 225 jump-4/1
        lwz 0,44(25)  # 229 movsi+1/3
        cmpwi 0,0,0  # 232 sleu+1
        bc 4,0,.L77  # 233 jump-4/1
        lwz 3,200(31)  # 240 movsi+1/3
        addi 4,25,8  # 242 *addsi3_internal1/2
        bl gdk_gc_set_foreground@plt  # 244 *call_nonlocal_sysv/1
        lwz 0,44(25)  # 1812 movsi+1/3
.L77:
        andis. 12,0,16384  # 251 extzv+2
        bc 12,2,.L76  # 252 jump-4/1
        lwz 3,204(31)  # 259 movsi+1/3
        addi 4,25,20  # 261 *addsi3_internal1/2
        bl gdk_gc_set_foreground@plt  # 263 *call_nonlocal_sysv/1
.L76:
        cmpwi 2,18,0  # 271 sleu+1
        lwz 14,4(25)  # 269 movsi+1/3
        bc 12,10,.L79  # 272 jump-4/2
        addi 24,1,40  # 276 *addsi3_internal1/2
        mr 4,28  # 291 movsi+1/1
        mr 3,18  # 289 movsi+1/1
        mr 5,24  # 293 movsi+1/1
        bl gdk_rectangle_intersect@plt  # 295 *ret_call_nonlocal_sysv/1
        cmpwi 0,3,0  # 298 sleu+1
        bc 12,2,.L80  # 299 jump-4/1
        lwz 11,24(31)  # 304 movsi+1/3
        lhz 7,2(24)  # 313 movhi+1/2
        lhz 8,4(24)  # 318 movhi+1/2
        lhz 9,6(24)  # 323 movhi+1/2
        lwz 4,572(11)  # 328 movsi+1/3
        lwz 3,124(31)  # 326 movsi+1/3
        lha 6,40(1)  # 332 extendhisi2+1/1
        extsh 7,7  # 334 extendhisi2+1/2
        li 5,1  # 330 movsi+1/5
        bl gdk_draw_rectangle@plt  # 340 *call_nonlocal_sysv/1
.L80:
        lwz 9,100(31)  # 344 movsi+1/3
        lwz 0,0(9)  # 346 movsi+1/3
        cmpw 0,25,0  # 347 sleu+1
        bc 4,2,.L81  # 348 jump-4/1
        lhz 9,2(29)  # 356 movhi+1/2
        lhz 0,94(31)  # 360 movhi+1/2
        addi 9,9,1  # 358 *addsi3_internal1/2
        add 0,0,9  # 364 *addsi3_internal1/1
        sth 0,2(29)  # 367 movhi+1/3
        mr 4,29  # 376 movsi+1/1
        mr 3,18  # 374 movsi+1/1
        mr 5,24  # 378 movsi+1/1
        bl gdk_rectangle_intersect@plt  # 380 *ret_call_nonlocal_sysv/1
        cmpwi 0,3,0  # 383 sleu+1
        bc 12,2,.L81  # 384 jump-4/1
        lwz 11,24(31)  # 389 movsi+1/3
        lhz 7,2(24)  # 398 movhi+1/2
        lhz 8,4(24)  # 403 movhi+1/2
        lhz 9,6(24)  # 408 movhi+1/2
        lwz 4,572(11)  # 413 movsi+1/3
        lwz 3,124(31)  # 411 movsi+1/3
        lha 6,40(1)  # 417 extendhisi2+1/1
        extsh 7,7  # 419 extendhisi2+1/2
        li 5,1  # 415 movsi+1/5
        bl gdk_draw_rectangle@plt  # 425 *call_nonlocal_sysv/1
.L81:
        mr 3,18  # 459 movsi+1/1
        mr 4,19  # 461 movsi+1/1
        mr 5,24  # 463 movsi+1/1
        bl gdk_rectangle_intersect@plt  # 465 *ret_call_nonlocal_sysv/1
        cmpwi 0,3,0  # 468 sleu+1
        bc 12,2,.L65  # 469 jump-4/1
        b .L84  # 475 jump
.L79:
        lwz 11,24(31)  # 490 movsi+1/3
        lhz 7,2(28)  # 499 movhi+1/2
        lhz 9,6(28)  # 509 movhi+1/2
        lhz 8,4(28)  # 504 movhi+1/2
        lwz 4,572(11)  # 514 movsi+1/3
        lwz 3,124(31)  # 512 movsi+1/3
        lha 6,24(1)  # 518 extendhisi2+1/1
        extsh 7,7  # 520 extendhisi2+1/2
        li 5,1  # 516 movsi+1/5
        bl gdk_draw_rectangle@plt  # 526 *call_nonlocal_sysv/1
.L84:
        lwz 0,104(31)  # 1801 movsi+1/3
        li 22,99  # 600 movsi+1/5
        cmpw 0,22,0  # 1802 sleu+1
        bc 4,0,.L87  # 1803 jump-4/1
        lwz 9,.LC11(30)  # 1832 movsi+1/3
        mr 26,23  # 1826 movsi+1/1
        lfd 31,0(9)  # 1834 *movdf_hardfloat32/8
        lis 15,0x4330  # 1828 movsi+1/6
        li 28,2772  # 1840 movsi+1/5

The first instruction in this hunk-o-code sets r28 (insn #1823).  There are
uses at insns 291, 499, 509 and 504.  No path from insn 1823 to 291, 499, 509
or 504 clobbers r28.

There are later uses of r28 (not shown).  However, each and every one of those
is supposed to reference the value that is set in insn 1840 as far as I can
tell by examining the rtl dumps and the assembly code.


The way I determined this was to compile the file with "-dap".  Then bring
up the assembly file under an editor.

The number after "#" in the assembly lines is an identification number for
insn.  These correspond to numbers you find in the dump files.  Such as:

(insn 1840 1828 1858 (set (reg:SI 714)
        (const_int 2772)) 402 {movsi+1} (nil)
    (expr_list:REG_EQUAL (const_int 2772)
        (nil)))


Which corresponds to the last assembly line I showed above.


So, armed with the assembly file with id #s and the .lreg dump I was able
to map every use of hard register r28 to a pseudo register.

Pseudo register (reg 161) corresponds to the stack slot, presumably &clist_row
and pseudo register  (714) corresponds to an index which is incremented by
28 each iteration of the loop.

I think you need to re-analyze this problem.






More information about the Gcc-bugs mailing list