projects
/
platform
/
upstream
/
linaro-gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5e4350e
)
(build_binary_op): Don't set shorten for signed division.
author
rms
<rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 19 Jul 1992 01:09:39 +0000
(
01:09
+0000)
committer
rms
<rms@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 19 Jul 1992 01:09:39 +0000
(
01:09
+0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@1623
138bc75d
-0d04-0410-961f-
82ee72b054a4
gcc/c-typeck.c
patch
|
blob
|
history
diff --git
a/gcc/c-typeck.c
b/gcc/c-typeck.c
index
42d2be0
..
7b93429
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;