haifa infinite loop

Richard Henderson rth@twiddle.rth.home
Sun Apr 19 21:34:00 GMT 1998


The following hunk o code on Alpha results in an infinite loop in haifa
beginning with line 1765:

1762          /* Remove blocks from queue[] when their in degree becomes1763                     zero.  Repeat until no blocks are left on the list.  This
1764             produces a topological list of blocks in the region.  */
1765          while (tail >= 0)
1766            {
1767              int_list_ptr ps;
1768
1769              if (head < 0)

The problem is that we make no progress if there is not some member
of degree[] that is zero.  The relevant variables at the time are:

(gdb) p tail
$1 = 4
(gdb) p queue[0]@tail+1
$2 = {7, 6, 4, 3, 2}
(gdb) p degree[0]@7+1
$3 = {1, -1, 1, 1, 1, 1, 1, 1}

I'm pretty sure this case never should have arisen, so there should
be no point in checking for the loop not making progress, but I'm 
not sure yet where to look for the correct code.

OTOH, I suppose checking for an infinite loop and aborting wouldn't
be a bad thing...


r~


More information about the Gcc mailing list