From: Richard Kenner Date: Sat, 12 Nov 1994 11:35:09 +0000 (-0500) Subject: (expand_divmod, case TRUNC_DIV_EXPR): Promote signed division by X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e80316129f08a13630a1751c9eb9fea4d5888d35;p=gcc.git (expand_divmod, case TRUNC_DIV_EXPR): Promote signed division by 0x80000000 to unsigned. From-SVN: r8430 --- diff --git a/gcc/expmed.c b/gcc/expmed.c index c5860a0f292..bae088d223a 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -2740,7 +2740,9 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp) case TRUNC_DIV_EXPR: if (op1_is_constant && HOST_BITS_PER_WIDE_INT >= size) { - if (unsignedp) + if (unsignedp + || (INTVAL (op1) + == (HOST_WIDE_INT) 1 << (GET_MODE_BITSIZE (compute_mode) - 1))) { unsigned HOST_WIDE_INT mh, ml; int pre_shift, post_shift; @@ -2901,6 +2903,8 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp) tquotient, 0); } + /* We have computed OP0 / abs(OP1). If OP1 is negative, negate + the quotient. */ if (d < 0) { insn = get_last_insn ();