v5.0.1, Mac, 32-bit: gmp_snprintf problem for (high) multi-limb integers

Torbjorn Granlund tg at gmplib.org
Mon Mar 28 11:24:11 CEST 2011


Max Neunhoeffer <neunhoef at mcs.st-and.ac.uk> writes:

  I am no assembler expert, but as far as I see it the value
  to be looked up is in the %eax register. However, the code
             movzwl  -1024+__gmpn_invert_limb_tab, %eax
  does not actually use that (as far as I see), that is because during
  the m4 translation the
      (%eax, %eax)
  has vanished.

Oh, this makes sense.  I think you hit the nail on the head.  Please try
this patch:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo
Type: application/octet-stream
Size: 414 bytes
Desc: not available
URL: <http://gmplib.org/list-archives/gmp-bugs/attachments/20110328/36236b2f/attachment.obj>
-------------- next part --------------

  It seems also that in the relocatable version the error does not occur
  (again, I am not so sure about this).

It is really bad that GMP's "make check" does not test both versions.
We really ought to fix that.

-- 
Torbj?rn


More information about the gmp-bugs mailing list