git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@209750
138bc75d-0d04-0410-961f-
82ee72b054a4
&& wi::only_sign_bit_p (dividend))
overflow = true;
- /* If overflow is set, just get out. There will only be grief by
- continuing. */
+ /* Handle the overflow cases. Viewed as unsigned value, the quotient of
+ (signed min / -1) has the same representation as the orignal dividend.
+ We have traditionally made division by zero act as division by one,
+ so there too we use the original dividend. */
if (overflow)
{
if (remainder)
if (oflow != 0)
*oflow = true;
if (quotient)
- quotient[0] = 0;
- return 1;
+ for (unsigned int i = 0; i < dividend_len; ++i)
+ quotient[i] = dividend_val[i];
+ return dividend_len;
}
if (oflow)