aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-10-26 17:00:09 +0000
committerRichard Stallman <rms@gnu.org>1993-10-26 17:00:09 +0000
commit03d5b1f5a35bbdb7f2a62d8b3ebd2bc395296507 (patch)
tree93a3d6d8a7811e26372bb95dae47b5c3f9772f98
parentbb1106c9b5966541aaf364116339fef0a68cb80c (diff)
downloadgcc-03d5b1f5a35bbdb7f2a62d8b3ebd2bc395296507.zip
gcc-03d5b1f5a35bbdb7f2a62d8b3ebd2bc395296507.tar.gz
gcc-03d5b1f5a35bbdb7f2a62d8b3ebd2bc395296507.tar.bz2
(build_binary_op): For TRUNC_MOD_EXPR and FLOOR_MOD_EXPR, set common.
From-SVN: r5895
-rw-r--r--gcc/c-typeck.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index c12f775..da34eee 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -1982,14 +1982,17 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
case TRUNC_MOD_EXPR:
case FLOOR_MOD_EXPR:
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
- quotient can't be represented in the computation mode. We shorten
- only if unsigned or if dividing by something we know != -1. */
- shorten = (TREE_UNSIGNED (orig_op0)
- || (TREE_CODE (op1) == INTEGER_CST
- && (TREE_INT_CST_LOW (op1) != -1
- || TREE_INT_CST_HIGH (op1) != -1)));
+ {
+ /* Although it would be tempting to shorten always here, that loses
+ on some targets, since the modulo instruction is undefined if the
+ quotient can't be represented in the computation mode. We shorten
+ only if unsigned or if dividing by something we know != -1. */
+ shorten = (TREE_UNSIGNED (orig_op0)
+ || (TREE_CODE (op1) == INTEGER_CST
+ && (TREE_INT_CST_LOW (op1) != -1
+ || TREE_INT_CST_HIGH (op1) != -1)));
+ common = 1;
+ }
break;
case TRUTH_ANDIF_EXPR: