GCC quality (was Re: AMD-64 optimizations, some (new) code)

Torbjorn Granlund tege at swox.com
Tue Sep 27 13:04:44 CEST 2005

"David T. Ashley" <dta at e3ft.com> writes:

  As I recall gmp, it phrases larger integer operations in terms of "limb"
  operations.  "Limb" arithmetic is so basic -- I think most of it is
  supported directly by the machine instruction set.  It is hard to imagine
  bugs.  I mean, in most cases the compiler should just be processing flags
  set by machine instructions ... and that comes down to digital logic ...

Well, I think a compiler is usually a quite large program, so
perhaps it isn't that simple.
  a)What is a typical "bug" you've found?

I don't know if there is a typical bug.

Sometimes the compiler loses track of where it keeps a value.
Sometimes it makes invalid algebraic rewrites.

A somewhat common bug is to rewrite (x > N) as (x - N > 0) with
variations.  This was triggered recently for alpha, where the
latter allows for 16 bit constants whereas the former only allows
8-bit constants.

  b)Was this with gcc for the x86 platform or for other platforms?

I think it is spread over the platforms.


More information about the gmp-discuss mailing list