This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Java segfault in predict.c
- From: Richard Henderson <rth at redhat dot com>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>, gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Wed, 29 May 2002 10:44:00 -0700
- Subject: Re: Java segfault in predict.c
- References: <3CF4842F.8020802@waitaki.otago.ac.nz> <20020529085438.GA32472@atrey.karlin.mff.cuni.cz>
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~