This is the mail archive of the mailing list for the GCC 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: [PATCH] i386/x86_64 get_attr_length bugfixes

On Wed, May 20, 2009 at 8:15 PM, Jakub Jelinek <> wrote:

> I've used attached script on -S -dp compiled i386/x86_64 sources to find
> various bugs in config/i386/ instruction length computation.
> This patch fixes all bugs found in -O2 {-m32,-m64} insn-attrtab.i
> compilation and most bugs found in -O3 -fpic {-m32,-m64} tramp3d-v4.ii
> compilation. ?The script isn't perfect, e.g. it doesn't handle multi-insn
> instructions (like return_long_internal, which contain \;, or e.g. set_got
> (which is wrong anyway, 11 bytes actual vs. 12 bytes returned by
> get_attr_length)), but for finding bugs in length computations is quite useful.
> The script is invoked with a list of -S -dp compiled files, like:
> ./ *.s
> (or
> asflags=-32 ./ *.s
> for -m32 compiled stuff).
> I've also run the vanilla and patched gcc on a collection of preprocessed
> gcc sources, with -O2 {-m32,-m64} and -O3 -fpic {-m32 -march=core2,-m64},
> results of the script attached. ?There is still work to do, but the patch
> already grew quite a bit, so I'd prefer to do further bugfixes in followup
> patches. ?From the results* tarball it is clear that the patch does
> substantial improvements in the insn length computation, especially for -m64
> compiled code.
> My primary reason for working on this is to make get_attr_length good enough
> to be usable in min_insn_size for non-jump insns other than
> Bootstrapped/regtested on x86_64-linux and i686-linux. ?Ok for trunk?

I think that fixing the precision of insn lengths leads to better
compiler decisions. The patch makes a lot of sense, and it is OK for


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