This is the mail archive of the
mailing list for the GCC project.
Re: basic_block index negative?
Am Mit, 2001-10-17 um 19.46 schrieb 1003340807:
> Dunno. I guess because they're special and contain no program
> instructions. The tree SSA code uses it to tell whether it found
> a ghost definition (artificial definitions created by SSA).
I find it quite odd and distracting to have negative indices. This
also forbids using them for arrays.
> If the index is unsigned, then a reverse traversal could get into
> an infinite loop. Consider:
> for (i = n_basic_blocks - 1; i >= 0; i--)
Ah yes, of course, I just had trouble following your terminology. :)
I think it would be really nice to mostly unsigned variables; this
makes it easy to prevent nasty sideeffects when dealing with them
and quite frankly I don't like the just of casts in the code. Maybe
gcc could also create better code but this is just a speculation
for recent versions, it worked on older versions though.