This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Misc cleanups


Nathan Sidwell <nathan@codesourcery.com> writes:

> >>1) If zeroes are not nops, then you don't want any SKIP_ZEROS stuff.
> > That SKIP_ZEROES code in general looks bogus to me, although that is
> > not your fault.  It is setting a host macro based on the target.  That
> > does not make sense.  It would not work correctly with
> > --enable-target.
> > If you are going to add TC_OPCODE_CASE, you should define it in
> > gas/docs/internals.texi.
> good point. This one?
> 
> (I must have had a thinko with the #if use of that macro, there's no need
> to deal with it being #defined to nothing.)

The code now assumes that TC_OPCODE_CASE is going to be defined, but
nothing actually defines it.  I know that the preprocessor doesn't
require macros to be defined, but I don't personally like that
approach.

There are plenty of things in gas which require #ifdef.  I think you
should just invert the sense of IGNORE_OPCODE_CASE.  Rename it to
something like OPCODES_CASE_SENSITIVE, and test it with #ifdef.

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 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
agree that it is important to disassemble zeroes if zeroes are not a
nop code.  Zeroes will tend to appear in files for various reasons.
The only time it is useful to disassemble a long series of zeroes is
when it is plausible that a real instruction sequence will generate a
long series of zeroes.  That is very unusual.  Does it really happen
on your platform?  Note that we have an option for specific cases: -z.

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.

Sorry I didn't think of these earlier.

The dwarf2dbg.c and gas/macros/test2.c changes are OK.

Also the change to read_a_source_file() is OK, although I would be
interested in hearing why those pseudos caused a problem.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]