Basic block renumbering removal

Roger Sayle roger@eyesopen.com
Sun May 19 17:27:00 GMT 2002


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



More information about the Gcc-patches mailing list