This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Basic block renumbering removal
- From: Roger Sayle <roger at eyesopen dot com>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>, Richard Henderson <rth at redhat dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 19 May 2002 17:46:09 -0600 (MDT)
- Subject: Re: Basic block renumbering removal
Hi Zdenek,
I'm not sure if you've managed to find all the bugs in your original
"Basic block renumbering removal" patch yet, but I managed to stumble
across one whilst it was still in the tree.
In function "cprop" of gcse.c, your patch converted
< for (insn = BLOCK_HEAD (bb);
< insn != NULL && insn != NEXT_INSN (BLOCK_END (bb));
< insn = NEXT_INSN (insn))
into
> for (insn = bb->head;
> insn != NULL && insn != NEXT_INSN (bb->head);
> insn = NEXT_INSN (insn))
The typo is in the middle line, BLOCK_END (bb) should be bb->end
not bb->head. So instead of looping over all the instructions in
a basic block, it would only loop over the first instruction. Doh!
Not fatal in this case, but if "BLOCK_END (bb)" was transformed to
"bb->head" by global search and replace, I'm sure it would go a long
way to explaining some of the other failures.
Just out of curiosity, was there any strong reason to substitute
the BLOCK_HEAD and BLOCK_END macros, rename the "index" field of
basic_block to "sindex", and rename the global "n_basic_blocks"
to "num_basic_blocks"? The biggest impact of these changes was
to make you patch much larger and harder to review.
Roger
--
Roger Sayle, E-mail: roger@eyesopen.com
OpenEye Scientific Software, WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road, Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507. Fax: (+1) 505-473-0833