optimisation for default_print_insn().
Doug Evans
dje@transmeta.com
Mon Apr 9 10:57:00 GMT 2001
matthew green writes:
> i've been looking at the cgen generated disassemblers lately
> and i've noticed that it reads target memory twice for the
> initial portion of the instruction. in default_print_insn(),
> there is a call to (*info->read_memory_func)() and then it
> calls print_insn(). the first thing print_insn() does is
> call read_insn() which performs the exact same read_memory_func
> call (same arguments, buffers, etc.) as read_insn() is used
> in other places, i believe the best way to fix this double
> read is to remove the copy in default_print_insn(). i have
> tested this with a couple of ports and nothing appeas to be
> broken.
>
>
> the patch below simply comments the block in
> default_print_insn() rather than removing it entirely. if
> people think it should be removed, i can change my patch.
Assuming your patch goes in, don't use #if 0's.
They just reduce the signal/noise ratio.
[sometimes they're ok, but not in this case]
> OK to commit?
I'd rather not. Studying the code, the comment above print_insn,
and the m32r port makes it seem to me that the read_insn
at the start of print_insn is the duplicate.
Why was it added?
More information about the Binutils
mailing list