itch bugs

Joe keane jgk at panix.com
Sat Aug 23 16:54:40 UTC 2014


sort of

*** mpn/generic/divexact.c.600	2014-03-25 10:37:55.000000000 -0400
--- mpn/generic/divexact.c	2014-08-21 16:09:04.000000000 -0400
*************** mpn_divexact (mp_ptr qp,
*** 49,54 ****
--- 49,55 ----
  {
    unsigned shift;
    mp_size_t qn;
+   mp_size_t ti;
    mp_ptr tp;
    TMP_DECL;
  
*************** mpn_divexact (mp_ptr qp,
*** 96,102 ****
    if (dn > qn)
      dn = qn;
  
!   tp = TMP_ALLOC_LIMBS (mpn_bdiv_q_itch (qn, dn));
    mpn_bdiv_q (qp, np, qn, dp, dn, tp);
    TMP_FREE;
  }
--- 97,104 ----
    if (dn > qn)
      dn = qn;
  
!   ti = mpn_bdiv_q_itch (qn, dn);
!   tp = TMP_ALLOC_LIMBS (ti);
    mpn_bdiv_q (qp, np, qn, dp, dn, tp);
    TMP_FREE;
  }
*** mpn/generic/divis.c.600	2014-03-25 10:37:55.000000000 -0400
--- mpn/generic/divis.c	2014-08-21 19:15:07.000000000 -0400
*************** mpn_divisible_p (mp_srcptr ap, mp_size_t
*** 61,66 ****
--- 61,67 ----
  		 mp_srcptr dp, mp_size_t dn)
  {
    mp_limb_t  alow, dlow, dmask;
+   mp_size_t qi;
    mp_ptr     qp, rp, tp;
    mp_size_t  i;
    mp_limb_t di;
*************** mpn_divisible_p (mp_srcptr ap, mp_size_t
*** 136,142 ****
    TMP_MARK;
  
    rp = TMP_ALLOC_LIMBS (an + 1);
!   qp = TMP_ALLOC_LIMBS (an - dn + 1); /* FIXME: Could we avoid this? */
  
    count_trailing_zeros (twos, dp[0]);
  
--- 137,144 ----
    TMP_MARK;
  
    rp = TMP_ALLOC_LIMBS (an + 1);
!   qi = an - dn + 1;
!   qp = TMP_ALLOC_LIMBS (qi); /* FIXME: Could we avoid this? */
  
    count_trailing_zeros (twos, dp[0]);
  
*************** mpn_divisible_p (mp_srcptr ap, mp_size_t
*** 180,186 ****
      }
    else
      {
!       tp = TMP_ALLOC_LIMBS (mpn_mu_bdiv_qr_itch (an, dn));
        mpn_mu_bdiv_qr (qp, rp, rp, an, dp, dn, tp);
      }
  
--- 182,191 ----
      }
    else
      {
!       mp_size_t ti;
! 
!       ti = mpn_mu_bdiv_qr_itch (an, dn);
!       tp = TMP_ALLOC_LIMBS (ti);
        mpn_mu_bdiv_qr (qp, rp, rp, an, dp, dn, tp);
      }
  
*** mpn/generic/hgcd_reduce.c.600	2014-03-25 10:37:55.000000000 -0400
--- mpn/generic/hgcd_reduce.c	2014-08-21 18:30:40.000000000 -0400
*************** hgcd_matrix_apply (const struct hgcd_mat
*** 134,139 ****
--- 134,141 ----
      }
    else
      {
+       mp_size_t xi;
+ 
        /* A = m00 a + m01 b  ==> a <= A / m00, b <= A / m01.
  	 B = m10 a + m11 b  ==> a <= B / m10, b <= B / m11. */
        un = MIN (an - mn[0][0], bn - mn[1][0]) + 1;
*************** hgcd_matrix_apply (const struct hgcd_mat
*** 143,149 ****
        /* In the range of interest, mulmod_bnm1 should always beat mullo. */
        modn = mpn_mulmod_bnm1_next_size (nn + 1);
  
!       scratch = TMP_ALLOC_LIMBS (mpn_mulmod_bnm1_itch (modn, modn, M->n));
        tp = TMP_ALLOC_LIMBS (modn);
        sp = TMP_ALLOC_LIMBS (modn);
  
--- 145,152 ----
        /* In the range of interest, mulmod_bnm1 should always beat mullo. */
        modn = mpn_mulmod_bnm1_next_size (nn + 1);
  
!       xi = mpn_mulmod_bnm1_itch (modn, modn, M->n);
!       scratch = TMP_ALLOC_LIMBS (xi);
        tp = TMP_ALLOC_LIMBS (modn);
        sp = TMP_ALLOC_LIMBS (modn);
  
*** mpn/generic/invertappr.c.600	2014-03-25 10:37:55.000000000 -0400
--- mpn/generic/invertappr.c	2014-08-21 18:32:01.000000000 -0400
*************** mpn_ni_invertappr (mp_ptr ip, mp_srcptr
*** 194,201 ****
  
    if (ABOVE_THRESHOLD (n, INV_MULMOD_BNM1_THRESHOLD))
      {
        mn = mpn_mulmod_bnm1_next_size (n + 1);
!       tp = TMP_ALLOC_LIMBS (mpn_mulmod_bnm1_itch (mn, n, (n >> 1) + 1));
      }
    /* Use Newton's iterations to get the desired precision.*/
  
--- 194,204 ----
  
    if (ABOVE_THRESHOLD (n, INV_MULMOD_BNM1_THRESHOLD))
      {
+       mp_size_t ti;
+ 
        mn = mpn_mulmod_bnm1_next_size (n + 1);
!       ti = mpn_mulmod_bnm1_itch (mn, n, (n >> 1) + 1);
!       tp = TMP_ALLOC_LIMBS (ti);
      }
    /* Use Newton's iterations to get the desired precision.*/
  
*** mpn/generic/mul.c.600	2014-03-25 10:37:55.000000000 -0400
--- mpn/generic/mul.c	2014-08-21 18:34:45.000000000 -0400
*************** mpn_mul (mp_ptr prodp,
*** 359,380 ****
  	}
        else
  	{
  	  mp_ptr scratch;
  	  TMP_DECL; TMP_MARK;
  
  	  if (BELOW_THRESHOLD (vn, MUL_TOOM6H_THRESHOLD))
  	    {
! 	      scratch = TMP_ALLOC_LIMBS (mpn_toom44_mul_itch (un, vn));
  	      mpn_toom44_mul (prodp, up, un, vp, vn, scratch);
  	    }
  	  else if (BELOW_THRESHOLD (vn, MUL_TOOM8H_THRESHOLD))
  	    {
! 	      scratch = TMP_ALLOC_LIMBS (mpn_toom6h_mul_itch (un, vn));
  	      mpn_toom6h_mul (prodp, up, un, vp, vn, scratch);
  	    }
  	  else
  	    {
! 	      scratch = TMP_ALLOC_LIMBS (mpn_toom8h_mul_itch (un, vn));
  	      mpn_toom8h_mul (prodp, up, un, vp, vn, scratch);
  	    }
  	  TMP_FREE;
--- 359,384 ----
  	}
        else
  	{
+ 	  mp_size_t xi;
  	  mp_ptr scratch;
  	  TMP_DECL; TMP_MARK;
  
  	  if (BELOW_THRESHOLD (vn, MUL_TOOM6H_THRESHOLD))
  	    {
! 	      xi = mpn_toom44_mul_itch (un, vn);
! 	      scratch = TMP_ALLOC_LIMBS (xi);
  	      mpn_toom44_mul (prodp, up, un, vp, vn, scratch);
  	    }
  	  else if (BELOW_THRESHOLD (vn, MUL_TOOM8H_THRESHOLD))
  	    {
! 	      xi = mpn_toom6h_mul_itch (un, vn);
! 	      scratch = TMP_ALLOC_LIMBS (xi);
  	      mpn_toom6h_mul (prodp, up, un, vp, vn, scratch);
  	    }
  	  else
  	    {
! 	      xi = mpn_toom8h_mul_itch (un, vn);
! 	      scratch = TMP_ALLOC_LIMBS (xi);
  	      mpn_toom8h_mul (prodp, up, un, vp, vn, scratch);
  	    }
  	  TMP_FREE;
*** mpn/generic/mullo_n.c.600	2014-03-25 10:37:55.000000000 -0400
--- mpn/generic/mullo_n.c	2014-08-21 18:37:11.000000000 -0400
*************** mpn_mullo_n (mp_ptr rp, mp_srcptr xp, mp
*** 232,241 ****
      }
    else
      {
        mp_ptr tp;
        TMP_DECL;
        TMP_MARK;
!       tp = TMP_ALLOC_LIMBS (mpn_mullo_n_itch (n));
        if (BELOW_THRESHOLD (n, MULLO_MUL_N_THRESHOLD))
  	{
  	  mpn_dc_mullo_n (rp, xp, yp, n, tp);
--- 232,243 ----
      }
    else
      {
+       mp_size_t ti;
        mp_ptr tp;
        TMP_DECL;
        TMP_MARK;
!       ti = mpn_mullo_n_itch (n);
!       tp = TMP_ALLOC_LIMBS (ti);
        if (BELOW_THRESHOLD (n, MULLO_MUL_N_THRESHOLD))
  	{
  	  mpn_dc_mullo_n (rp, xp, yp, n, tp);
*** mpn/generic/mulmid.c.600	2014-03-25 10:37:55.000000000 -0400
--- mpn/generic/mulmid.c	2014-08-21 18:39:17.000000000 -0400
*************** mpn_mulmid (mp_ptr rp,
*** 176,186 ****
           ...BB.
           ....CC
        */
  
        TMP_DECL;
        TMP_MARK;
  
!       temp = TMP_ALLOC_LIMBS (rn + 2 + mpn_toom42_mulmid_itch (rn));
        scratch = temp + rn + 2;
  
        /* first chunk (marked A in the above diagram) */
--- 176,188 ----
           ...BB.
           ....CC
        */
+       mp_size_t ti;
  
        TMP_DECL;
        TMP_MARK;
  
!       ti = rn + 2 + mpn_toom42_mulmid_itch (rn);
!       temp = TMP_ALLOC_LIMBS (ti);
        scratch = temp + rn + 2;
  
        /* first chunk (marked A in the above diagram) */
*************** mpn_mulmid (mp_ptr rp,
*** 217,227 ****
           .AAABBBCC.
           ..AAABBBCC
        */
  
        TMP_DECL;
        TMP_MARK;
  
!       scratch = TMP_ALLOC_LIMBS (mpn_toom42_mulmid_itch (bn));
  
        /* first chunk (marked A in the above diagram) */
        mpn_toom42_mulmid (rp, ap, bp, bn, scratch);
--- 219,231 ----
           .AAABBBCC.
           ..AAABBBCC
        */
+       mp_size_t ti;
  
        TMP_DECL;
        TMP_MARK;
  
!       ti = mpn_toom42_mulmid_itch (bn);
!       scratch = TMP_ALLOC_LIMBS (ti);
  
        /* first chunk (marked A in the above diagram) */
        mpn_toom42_mulmid (rp, ap, bp, bn, scratch);
*** mpn/generic/mul_n.c.600	2014-08-21 18:42:33.000000000 -0400
--- mpn/generic/mul_n.c	2014-08-21 18:42:33.000000000 -0400
*************** see https://www.gnu.org/licenses/.  */
*** 36,41 ****
--- 36,42 ----
  void
  mpn_mul_n (mp_ptr p, mp_srcptr a, mp_srcptr b, mp_size_t n)
  {
+   mp_size_t wi;
    ASSERT (n >= 1);
    ASSERT (! MPN_OVERLAP_P (p, 2 * n, a, n));
    ASSERT (! MPN_OVERLAP_P (p, 2 * n, b, n));
*************** mpn_mul_n (mp_ptr p, mp_srcptr a, mp_src
*** 57,63 ****
        mp_ptr ws;
        TMP_SDECL;
        TMP_SMARK;
!       ws = TMP_SALLOC_LIMBS (mpn_toom33_mul_itch (n, n));
        mpn_toom33_mul (p, a, n, b, n, ws);
        TMP_SFREE;
      }
--- 58,65 ----
        mp_ptr ws;
        TMP_SDECL;
        TMP_SMARK;
!       wi = mpn_toom33_mul_itch (n, n);
!       ws = TMP_SALLOC_LIMBS (wi);
        mpn_toom33_mul (p, a, n, b, n, ws);
        TMP_SFREE;
      }
*************** mpn_mul_n (mp_ptr p, mp_srcptr a, mp_src
*** 66,72 ****
        mp_ptr ws;
        TMP_SDECL;
        TMP_SMARK;
!       ws = TMP_SALLOC_LIMBS (mpn_toom44_mul_itch (n, n));
        mpn_toom44_mul (p, a, n, b, n, ws);
        TMP_SFREE;
      }
--- 68,75 ----
        mp_ptr ws;
        TMP_SDECL;
        TMP_SMARK;
!       wi = mpn_toom44_mul_itch (n, n);
!       ws = TMP_SALLOC_LIMBS (wi);
        mpn_toom44_mul (p, a, n, b, n, ws);
        TMP_SFREE;
      }
*************** mpn_mul_n (mp_ptr p, mp_srcptr a, mp_src
*** 75,81 ****
        mp_ptr ws;
        TMP_SDECL;
        TMP_SMARK;
!       ws = TMP_SALLOC_LIMBS (mpn_toom6_mul_n_itch (n));
        mpn_toom6h_mul (p, a, n, b, n, ws);
        TMP_SFREE;
      }
--- 78,85 ----
        mp_ptr ws;
        TMP_SDECL;
        TMP_SMARK;
!       wi = mpn_toom6_mul_n_itch (n);
!       ws = TMP_SALLOC_LIMBS (wi);
        mpn_toom6h_mul (p, a, n, b, n, ws);
        TMP_SFREE;
      }
*************** mpn_mul_n (mp_ptr p, mp_srcptr a, mp_src
*** 84,90 ****
        mp_ptr ws;
        TMP_DECL;
        TMP_MARK;
!       ws = TMP_ALLOC_LIMBS (mpn_toom8_mul_n_itch (n));
        mpn_toom8h_mul (p, a, n, b, n, ws);
        TMP_FREE;
      }
--- 88,95 ----
        mp_ptr ws;
        TMP_DECL;
        TMP_MARK;
!       wi = mpn_toom8_mul_n_itch (n);
!       ws = TMP_ALLOC_LIMBS (wi);
        mpn_toom8h_mul (p, a, n, b, n, ws);
        TMP_FREE;
      }
*** mpn/generic/nussbaumer_mul.c.600	2014-03-25 10:37:55.000000000 -0400
--- mpn/generic/nussbaumer_mul.c	2014-08-21 18:45:58.000000000 -0400
*************** mpn_nussbaumer_mul (mp_ptr pp,
*** 46,51 ****
--- 46,52 ----
  		    mp_srcptr bp, mp_size_t bn)
  {
    mp_size_t rn;
+   mp_size_t ti;
    mp_ptr tp;
    TMP_DECL;
  
*************** mpn_nussbaumer_mul (mp_ptr pp,
*** 57,69 ****
    if ((ap == bp) && (an == bn))
      {
        rn = mpn_sqrmod_bnm1_next_size (2*an);
!       tp = TMP_ALLOC_LIMBS (mpn_sqrmod_bnm1_itch (rn, an));
        mpn_sqrmod_bnm1 (pp, rn, ap, an, tp);
      }
    else
      {
        rn = mpn_mulmod_bnm1_next_size (an + bn);
!       tp = TMP_ALLOC_LIMBS (mpn_mulmod_bnm1_itch (rn, an, bn));
        mpn_mulmod_bnm1 (pp, rn, ap, an, bp, bn, tp);
      }
  
--- 58,72 ----
    if ((ap == bp) && (an == bn))
      {
        rn = mpn_sqrmod_bnm1_next_size (2*an);
!       ti = mpn_sqrmod_bnm1_itch (rn, an);
!       tp = TMP_ALLOC_LIMBS (ti);
        mpn_sqrmod_bnm1 (pp, rn, ap, an, tp);
      }
    else
      {
        rn = mpn_mulmod_bnm1_next_size (an + bn);
!       ti = mpn_mulmod_bnm1_itch (rn, an, bn);
!       tp = TMP_ALLOC_LIMBS (ti);
        mpn_mulmod_bnm1 (pp, rn, ap, an, bp, bn, tp);
      }
  
*** mpn/generic/redc_n.c.600	2014-03-25 10:37:55.000000000 -0400
--- mpn/generic/redc_n.c	2014-08-21 18:48:08.000000000 -0400
*************** see https://www.gnu.org/licenses/.  */
*** 50,55 ****
--- 50,56 ----
  void
  mpn_redc_n (mp_ptr rp, mp_ptr up, mp_srcptr mp, mp_size_t n, mp_srcptr ip)
  {
+   mp_size_t ti;
    mp_ptr xp, yp, scratch;
    mp_limb_t cy;
    mp_size_t rn;
*************** mpn_redc_n (mp_ptr rp, mp_ptr up, mp_src
*** 60,66 ****
  
    rn = mpn_mulmod_bnm1_next_size (n);
  
!   scratch = TMP_ALLOC_LIMBS (n + rn + mpn_mulmod_bnm1_itch (rn, n, n));
  
    xp = scratch;
    mpn_mullo_n (xp, up, ip, n);
--- 61,68 ----
  
    rn = mpn_mulmod_bnm1_next_size (n);
  
!   ti = n + rn + mpn_mulmod_bnm1_itch (rn, n, n);
!   scratch = TMP_ALLOC_LIMBS (ti);
  
    xp = scratch;
    mpn_mullo_n (xp, up, ip, n);
*** mpn/generic/remove.c.600	2014-03-25 10:37:55.000000000 -0400
--- mpn/generic/remove.c	2014-08-21 18:49:36.000000000 -0400
*************** mpn_bdiv_qr_wrap (mp_ptr qp, mp_ptr rp,
*** 68,78 ****
  		  mp_srcptr np, mp_size_t nn,
  		  mp_srcptr dp, mp_size_t dn)
  {
    mp_ptr scratch_out;
    TMP_DECL;
  
    TMP_MARK;
!   scratch_out = TMP_ALLOC_LIMBS (mpn_bdiv_qr_itch (nn, dn));
    mpn_bdiv_qr (qp, rp, np, nn, dp, dn, scratch_out);
  
    TMP_FREE;
--- 68,80 ----
  		  mp_srcptr np, mp_size_t nn,
  		  mp_srcptr dp, mp_size_t dn)
  {
+   mp_size_t xi;
    mp_ptr scratch_out;
    TMP_DECL;
  
+   xi = mpn_bdiv_qr_itch (nn, dn);
    TMP_MARK;
!   scratch_out = TMP_ALLOC_LIMBS (xi);
    mpn_bdiv_qr (qp, rp, np, nn, dp, dn, scratch_out);
  
    TMP_FREE;
*** mpn/generic/sqr.c.600	2014-03-25 10:37:55.000000000 -0400
--- mpn/generic/sqr.c	2014-08-21 18:50:56.000000000 -0400
*************** mpn_sqr (mp_ptr p, mp_srcptr a, mp_size_
*** 83,92 ****
      }
    else if (BELOW_THRESHOLD (n, SQR_FFT_THRESHOLD))
      {
        mp_ptr ws;
        TMP_DECL;
        TMP_MARK;
!       ws = TMP_ALLOC_LIMBS (mpn_toom8_sqr_itch (n));
        mpn_toom8_sqr (p, a, n, ws);
        TMP_FREE;
      }
--- 83,94 ----
      }
    else if (BELOW_THRESHOLD (n, SQR_FFT_THRESHOLD))
      {
+       mp_size_t wi;
        mp_ptr ws;
        TMP_DECL;
        TMP_MARK;
!       wi = mpn_toom8_sqr_itch (n);
!       ws = TMP_ALLOC_LIMBS (wi);
        mpn_toom8_sqr (p, a, n, ws);
        TMP_FREE;
      }
*** mpz/bin_uiui.c.600	2014-03-25 10:37:55.000000000 -0400
--- mpz/bin_uiui.c	2014-08-21 19:10:27.000000000 -0400
*************** limb_apprsqrt (mp_limb_t x)
*** 572,577 ****
--- 572,579 ----
  static void
  mpz_goetgheluck_bin_uiui (mpz_ptr r, unsigned long int n, unsigned long int k)
  {
+   mp_size_t si;
+   mp_size_t fi;
    mp_limb_t *sieve, *factors, count;
    mp_limb_t prod, max_prod, j;
    TMP_DECL;
*************** mpz_goetgheluck_bin_uiui (mpz_ptr r, uns
*** 580,589 ****
    ASSERT (n >= 25);
  
    TMP_MARK;
!   sieve = TMP_ALLOC_LIMBS (primesieve_size (n));
  
    count = gmp_primesieve (sieve, n) + 1;
!   factors = TMP_ALLOC_LIMBS (count / log_n_max (n) + 1);
  
    max_prod = GMP_NUMB_MAX / n;
  
--- 582,593 ----
    ASSERT (n >= 25);
  
    TMP_MARK;
!   si = primesieve_size (n);
!   sieve = TMP_ALLOC_LIMBS (si);
  
    count = gmp_primesieve (sieve, n) + 1;
!   fi = count / log_n_max (n) + 1;
!   factors = TMP_ALLOC_LIMBS (fi);
  
    max_prod = GMP_NUMB_MAX / n;
  
*** mpz/powm_sec.c.600	2014-03-25 10:37:55.000000000 -0400
--- mpz/powm_sec.c	2014-08-21 16:14:56.000000000 -0400
*************** void
*** 40,45 ****
--- 40,46 ----
  mpz_powm_sec (mpz_ptr r, mpz_srcptr b, mpz_srcptr e, mpz_srcptr m)
  {
    mp_size_t n;
+   mp_size_t ti;
    mp_ptr rp, tp;
    mp_srcptr bp, ep, mp;
    mp_size_t rn, bn, es, en;
*************** mpz_powm_sec (mpz_ptr r, mpz_srcptr b, m
*** 76,82 ****
      }
  
    TMP_MARK;
!   tp = TMP_ALLOC_LIMBS (n + mpn_sec_powm_itch (bn, en * GMP_NUMB_BITS, n));
  
    rp = tp;  tp += n;
  
--- 77,84 ----
      }
  
    TMP_MARK;
!   ti = n + mpn_sec_powm_itch (bn, en * GMP_NUMB_BITS, n);
!   tp = TMP_ALLOC_LIMBS (ti);
  
    rp = tp;  tp += n;
  
*** mpf/get_str.c.600	2014-03-25 10:37:55.000000000 -0400
--- mpf/get_str.c	2014-08-21 18:56:24.000000000 -0400
*************** mpf_get_str (char *dbuf, mp_exp_t *exp,
*** 125,130 ****
--- 125,131 ----
    size_t max_digits;
    mp_ptr up, pp, tp;
    mp_size_t un, pn, tn;
+   mp_size_t ti;
    unsigned char *tstr;
    mp_exp_t exp_in_base;
    size_t n_digits_computed;
*************** mpf_get_str (char *dbuf, mp_exp_t *exp,
*** 180,192 ****
        goto done;
      }
  
    TMP_MARK;
  
    /* Allocate temporary digit space.  We can't put digits directly in the user
       area, since we generate more digits than requested.  (We allocate
       2 * GMP_LIMB_BITS extra bytes because of the digit block nature of the
       conversion.)  */
!   tstr = (unsigned char *) TMP_ALLOC (n_digits + 2 * GMP_LIMB_BITS + 3);
  
    LIMBS_PER_DIGIT_IN_BASE (n_limbs_needed, n_digits, base);
  
--- 181,194 ----
        goto done;
      }
  
+   ti = n_digits + 2 * GMP_LIMB_BITS + 3;
    TMP_MARK;
  
    /* Allocate temporary digit space.  We can't put digits directly in the user
       area, since we generate more digits than requested.  (We allocate
       2 * GMP_LIMB_BITS extra bytes because of the digit block nature of the
       conversion.)  */
!   tstr = (unsigned char *) TMP_ALLOC (ti);
  
    LIMBS_PER_DIGIT_IN_BASE (n_limbs_needed, n_digits, base);
  
*************** mpf_get_str (char *dbuf, mp_exp_t *exp,
*** 195,200 ****
--- 197,203 ----
        /* We need to multiply number by base^n to get an n_digits integer part.  */
        mp_size_t n_more_limbs_needed, ign, off;
        unsigned long e;
+       mp_size_t pi;
  
        n_more_limbs_needed = n_limbs_needed - ue;
        DIGITS_IN_BASE_PER_LIMB (e, n_more_limbs_needed, base);
*************** mpf_get_str (char *dbuf, mp_exp_t *exp,
*** 204,211 ****
  	  up += un - n_limbs_needed;
  	  un = n_limbs_needed;
  	}
!       pp = TMP_ALLOC_LIMBS (2 * n_limbs_needed + 2);
!       tp = TMP_ALLOC_LIMBS (2 * n_limbs_needed + 2);
  
        pn = mpn_pow_1_highpart (pp, &ign, (mp_limb_t) base, e, n_limbs_needed, tp);
        if (un > pn)
--- 207,215 ----
  	  up += un - n_limbs_needed;
  	  un = n_limbs_needed;
  	}
!       pi = 2 * n_limbs_needed + 2;
!       pp = TMP_ALLOC_LIMBS (pi);
!       tp = TMP_ALLOC_LIMBS (pi);
  
        pn = mpn_pow_1_highpart (pp, &ign, (mp_limb_t) base, e, n_limbs_needed, tp);
        if (un > pn)
*************** mpf_get_str (char *dbuf, mp_exp_t *exp,
*** 231,236 ****
--- 235,241 ----
        /* We need to divide number by base^n to get an n_digits integer part.  */
        mp_size_t n_less_limbs_needed, ign, off, xn;
        unsigned long e;
+       mp_size_t pi;
        mp_ptr dummyp, xp;
  
        n_less_limbs_needed = ue - n_limbs_needed;
*************** mpf_get_str (char *dbuf, mp_exp_t *exp,
*** 241,248 ****
  	  up += un - n_limbs_needed;
  	  un = n_limbs_needed;
  	}
!       pp = TMP_ALLOC_LIMBS (2 * n_limbs_needed + 2);
!       tp = TMP_ALLOC_LIMBS (2 * n_limbs_needed + 2);
  
        pn = mpn_pow_1_highpart (pp, &ign, (mp_limb_t) base, e, n_limbs_needed, tp);
  
--- 246,254 ----
  	  up += un - n_limbs_needed;
  	  un = n_limbs_needed;
  	}
!       pi = 2 * n_limbs_needed + 2;
!       pp = TMP_ALLOC_LIMBS (pi);
!       tp = TMP_ALLOC_LIMBS (pi);
  
        pn = mpn_pow_1_highpart (pp, &ign, (mp_limb_t) base, e, n_limbs_needed, tp);
  


More information about the gmp-bugs mailing list