Possible issue on windows build (mingw)

Vlad Gabriel clampi at yahoo.com
Tue Apr 3 14:55:13 CEST 2012

Hello Torbjörn,

I confirm that the assert issue (toom_eval_pm2exp.c:112) was solved by patch 2.

The issue with t-gcd and t-get_d is reproducible. I have to have present either of

For reference, 'mpn/x86_64/coreinhm/gcd_1.asm' and 'mpn/x86_64/core2/gcd_1.asm' are the same file. Even if that would have not caused error on my end, I think is not supposed to have the same file for 2 processors, but have configure do the link.

There is something I have not mentioned in any of my previous mails, something that was brought up a while ago to your attention but did not get any resolution. Test cxx/t-locale is irrelevant for windoze targets (PE-COFF). This is due to the test being dependent of the weak symbols concept. That is not supported by PE-COFF targets (mingw32/64 and cygwin as far as I know). In my opinion it should be skipped from makefile for those targets, as simply ignoring the test from int main(){std::cout<<"Not supported on Windoze"<<endl;} would still cause a duplicate symbol at link time in clocale.o.

Please advise how can I help further.

Best Regards,

 From: Torbjorn Granlund <tg at gmplib.org>
To: Vlad Gabriel <clampi at yahoo.com> 
Cc: gmp-bugs at gmplib.org 
Sent: Tuesday, April 3, 2012 1:25 PM
Subject: Re: Possible issue on windows build (mingw)
Thanks for helping with this debugging!

I was able to reproduce some of the failures you observed by using
static linking on our emulated windos machine.  (It remains to be
understood why a dynamic link was incorrectly "successful".)

Please apply the following patches:

1. http://gmplib.org:8000/gmp/raw-rev/1262d026cdb5
   This patch my Marco is also fixed in last night's snapshot.

2. http://gmplib.org:8000/gmp/raw-rev/5b41f5fdb823
   This patch should fix the massive failures related to the toom functions.

That gmp-mparam.h changes behaviour is to be expected.  It does not
(except theoretically) indicate invalid combinations of parameters.

  "mpn/x86_64/coreisbr/aorrlsh_n.asm" causes the following assert in many tests:
  toom_eval_pm2exp.c:112: GNU MP assertion failed: (k+1)*shift >= 64 || xp2[n] <
  ((((mp_limb_t) 1LL)<<((k+1)*shift))-1)/((((mp_limb_t) 1LL)<<shift)-1)
This is fixed by patch 2 above.  Please confirm.

  "mpn/x86_64/core2/gcd_1.asm" causes the following test failure:
  ERROR in test 38
  mpz_gcd returned incorrect result
  expected result:
  mpz_gcd returns:
  FAIL: t-gcd.exe
Alas, I cannot reproduce this with any of my attempted builds.
I'll do some code inspection next.

  ERROR (test 0/6): bad mpq_get_d results
  last: 9.812762848509795e+055
   new: 1.977541358830227e+048
  FAIL: t-get_d.exe
I haven't seen this (but I didn't try to reproduce this before applying
the two patches above).  Does this still happon for you?

(If you replace gmp-mparam.h, you need to recompile everything, since
else there might be inconsistencies.)


More information about the gmp-bugs mailing list