From: jakub Date: Tue, 2 Feb 2016 19:44:16 +0000 (+0000) Subject: * wide-int.cc (canonize_uhwi): New function. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=70bca70ed4a250b4132e59162871848cc93ae259;p=thirdparty%2Fgcc.git * wide-int.cc (canonize_uhwi): New function. (wi::divmod_internal): Use it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233092 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2cb845618556..8c59956e30b3 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; }