Commit 03d5b1f5 by Richard Stallman

(build_binary_op): For TRUNC_MOD_EXPR and FLOOR_MOD_EXPR, set common.

From-SVN: r5895
parent bb1106c9
...@@ -1982,14 +1982,17 @@ build_binary_op (code, orig_op0, orig_op1, convert_p) ...@@ -1982,14 +1982,17 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
case TRUNC_MOD_EXPR: case TRUNC_MOD_EXPR:
case FLOOR_MOD_EXPR: case FLOOR_MOD_EXPR:
if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE) if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
/* Although it would be tempting to shorten always here, doing so loses {
on some targets, since the modulo instruction is undefined if the /* Although it would be tempting to shorten always here, that loses
quotient can't be represented in the computation mode. We shorten on some targets, since the modulo instruction is undefined if the
only if unsigned or if dividing by something we know != -1. */ quotient can't be represented in the computation mode. We shorten
shorten = (TREE_UNSIGNED (orig_op0) only if unsigned or if dividing by something we know != -1. */
|| (TREE_CODE (op1) == INTEGER_CST shorten = (TREE_UNSIGNED (orig_op0)
&& (TREE_INT_CST_LOW (op1) != -1 || (TREE_CODE (op1) == INTEGER_CST
|| TREE_INT_CST_HIGH (op1) != -1))); && (TREE_INT_CST_LOW (op1) != -1
|| TREE_INT_CST_HIGH (op1) != -1)));
common = 1;
}
break; break;
case TRUTH_ANDIF_EXPR: case TRUTH_ANDIF_EXPR:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment