This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: Java segfault in predict.c


On Wed, May 29, 2002 at 10:54:38AM +0200, Zdenek Dvorak wrote:
> ! 	  FOR_BB_BETWEEN (bb, BASIC_BLOCK (sbitmap_first_set_bit (loop->nodes)),
> ! 		ENTRY_BLOCK_PTR, prev_bb)
> ! 	    if (TEST_BIT (loop->nodes, bb->index))
> ! 	      loop->first = bb;
> ! 	  FOR_BB_BETWEEN (bb, BASIC_BLOCK (sbitmap_last_set_bit (loop->nodes)),
> ! 		EXIT_BLOCK_PTR, next_bb)
> ! 	    if (TEST_BIT (loop->nodes, bb->index))
> ! 	      loop->last = bb;

Seems like

	FOR_ALL_BB (bb)
	  if (TEST_BIT (loop->nodes, bb->index))
	    break;
	loop->first = bb;

	FOR_ALL_BB_REVERSE (bb)
	  if (TEST_BIT (loop->nodes, bb->index))
	    break;
	loop->last = bb;

actually searches fewer blocks, and is clearer.

Again, this seems like a real opportunity to want to rely on
monotonicly increasing indicies...



r~


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