projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fea868c
)
(build_binary_op): Don't set shorten for signed division.
author
Richard Stallman
<rms@gnu.org>
Sun, 19 Jul 1992 01:09:39 +0000
(
01:09
+0000)
committer
Richard Stallman
<rms@gnu.org>
Sun, 19 Jul 1992 01:09:39 +0000
(
01:09
+0000)
From-SVN: r1623
gcc/c-typeck.c
patch
|
blob
|
history
diff --git
a/gcc/c-typeck.c
b/gcc/c-typeck.c
index 42d2be0686d980e7b9ae6f1b0e6e5388eba3abac..7b9342914a1670dec894dc69d40de70c789ac9bb 100644
(file)
--- a/
gcc/c-typeck.c
+++ b/
gcc/c-typeck.c
@@
-2283,7
+2283,9
@@
build_binary_op (code, orig_op0, orig_op1, convert_p)
if (!(code0 == INTEGER_TYPE && code1 == INTEGER_TYPE))
resultcode = RDIV_EXPR;
else
- shorten = 1;
+ /* When dividing two signed integers, you have to promote to int.
+ E.g. (short) -32868 / (short) -1 doesn't fit in a short. */
+ shorten = TREE_UNSIGNED (op0);
common = 1;
}
break;