From: Jakub Jelinek Date: Tue, 2 Feb 2016 19:44:16 +0000 (+0100) Subject: wide-int.cc (canonize_uhwi): New function. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=321a2b65f83575b59d4a33760b0023e219feeba6;p=gcc.git wide-int.cc (canonize_uhwi): New function. * wide-int.cc (canonize_uhwi): New function. (wi::divmod_internal): Use it. From-SVN: r233092 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2cb84561855..8c59956e30b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-02-02 Jakub Jelinek + + * wide-int.cc (canonize_uhwi): New function. + (wi::divmod_internal): Use it. + 2016-02-02 James Norris HOST_BITS_PER_WIDE_INT) + { + val[1] = 0; + return 2; + } + return 1; +} + /* * Conversion routines in and out of wide_int. */ @@ -1793,25 +1807,12 @@ wi::divmod_internal (HOST_WIDE_INT *quotient, unsigned int *remainder_len, if (quotient) { quotient[0] = o0 / o1; - if (o1 == 1 - && (HOST_WIDE_INT) o0 < 0 - && dividend_prec > HOST_BITS_PER_WIDE_INT) - { - quotient[1] = 0; - quotient_len = 2; - } + quotient_len = canonize_uhwi (quotient, dividend_prec); } if (remainder) { remainder[0] = o0 % o1; - if ((HOST_WIDE_INT) remainder[0] < 0 - && dividend_prec > HOST_BITS_PER_WIDE_INT) - { - remainder[1] = 0; - *remainder_len = 2; - } - else - *remainder_len = 1; + *remainder_len = canonize_uhwi (remainder, dividend_prec); } return quotient_len; }