bug fix in haifa schedule

Jeffrey A Law law@cygnus.com
Thu Sep 25 09:48:00 GMT 1997


  In message < Pine.OSF.3.96.970923185326.12950A-100000@hepunix1.physics.yale.edu >you write:
  > Hi,
  > 
  > The patch I sent earlier fixes the problem in the test case but causes
  > problem for other cases.  Here is the update of the fix which should
  > be applied against egcs-970917 source.
Thanks.  It's a real bug, and similar to one I've already worked
on in haifa.

Your patch is incorrect, but your analysis was quite useful.

The fundamental and basic problem is schedule_block and
compute_forward_dependences aren't processing the same
group of LOOP/EH notes, which can lead to extra notes.

Due to an intrablock movement of instructions, it is possible for
compute_forward_dependences to process a LOOP/EH note that is
skipped by schedule_block.  The same thing used to happen in some
cases when schedule_block used to copy hard parms from hard regs
to pseudos at the start of the function.

I'm not sure how to fix this instance, but I'm pretty sure your
patch isn't the right way.

One thought would be to make the scheduler handle basic blocks
that begin and/or end with NOTEs, then change the get_block_head_tail
to not skip notes at the start or end of a basic block.

Another would be to disallow certain cross block movements; the
trick is how to detect insns which can't move because they'd
expose "bad" notes at the start or end of a block.

Another way would be to remove the saved notes from the first insn
in a block.

Jeff









More information about the Gcc mailing list