Misc cleanups

Nathan Sidwell nathan@codesourcery.com
Fri Feb 6 17:12:00 GMT 2004


Ian Lance Taylor wrote:

> Also, now that I look more closely at your SKIP_ZEROES change, I don't
> like it.  SKIP_ZEROES has a value which you should use.  You shouldn't
> test it with #ifdef.
it doesn't, it used #if :)

> It seems to me that you are adding a special case for setting
> SKIP_ZEROES to 0 to disable it, which I don't understand.  I don't
Currently setting SKIP_ZEROES to zero would result on the disassembler
always skipping no zeros! (And consequently, never advancing.)
Having 0 mean 'don't skip' seemed an obvious meaning to me.

You're right that one could use -z, and a long sequence of zero
bytes is nearly never a valid program, but those don't persuade me
as arguments to prevent a port from doing what I did.

> Even if long strings of zeroes do occur frequently, testing
> SKIP_ZEROES using #ifdef doesn't feel right to me.  First, why not
> just set SKIP_ZEROES to a large value?  Second, if you really resist
> that for some reason, just test the value in code, rather than using
> #ifdef.  The resulting code will be more or less the same when
> optimized, and will be easier to understand than code using #ifdef.
Setting it to a large value strikes me as broken - you'd be forcing an
unnecessary scan. Unfortunately when I put the test into regular code,
it causes gcc to say things like 'comparison of value >= 0 is always
true', which is annoying.

This reworking keeps 'z' within a smaller block (IMHO more readable)
and also fixes the admittedly unlikely problem of never advancing if
SKIP_ZEROES < 4. Is this reworking ok?

nathan

-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: d.diff
URL: <https://sourceware.org/pipermail/binutils/attachments/20040206/9b69d3b8/attachment.ksh>


More information about the Binutils mailing list