------- Comment #9 from rsandifo at gcc dot gnu dot org  2007-10-13 10:47 
-------
The problem comes from dbr_schedule, although it's not really a bug there.
We have:

        bne     $5,$0,L1        # A
        ...stuff...
L1:
        bne     $5,$0,L2        # B
        ...printk call...
L2:

and nothing before dbr_schedule has managed to thread A to L2.
dbr_schedule first fills B's delay slot with an lui from the printk
block, then steal_delay_list_from_target realises that A can steal B's
delay slot and branch directly to L2.  There is no other path to L1,
so the rest of the printk call is now dead.

For most targets, this is at worst a missed optimisation; we should have
threaded A to L2 much earlier than dbr_schedule, and deleted the whole
printk block as dead.  I don't think the MIPS port can rely on that
happening for correctness.  So (alas!) I think the upshot is simply
that we need to add some special code to mips_reorg to delete high-part
relocations that have no matching lows.

I'll have a poke.


-- 

rsandifo at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rsandifo at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-10-13 10:47:26
               date|                            |


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

Reply via email to