summaryrefslogtreecommitdiff
path: root/sys/src/cmd
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-01-07 04:40:47 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2016-01-07 04:40:47 +0100
commit9c99d0c8d3236b87bd292ac29d4d1b2d5f550bd5 (patch)
treebc25780fd786c6ef76e6fa5c05f622f6b7c1d322 /sys/src/cmd
parent3e38194d72b2b017b85bf85f11ef4e580d44be4f (diff)
6c: return vlong result for pointer subtraction
Diffstat (limited to 'sys/src/cmd')
-rw-r--r--sys/src/cmd/cc/sub.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/src/cmd/cc/sub.c b/sys/src/cmd/cc/sub.c
index 0133b2bea..ff1d6689d 100644
--- a/sys/src/cmd/cc/sub.c
+++ b/sys/src/cmd/cc/sub.c
@@ -692,14 +692,6 @@ arith(Node *n, int f)
if(w < 1 || n->left->type->link == T || n->left->type->link->width < 1)
goto bad;
n->type = types[ewidth[TIND] <= ewidth[TLONG]? TLONG: TVLONG];
- if(1 && ewidth[TIND] > ewidth[TLONG]){
- n1 = new1(OXXX, Z, Z);
- *n1 = *n;
- n->op = OCAST;
- n->left = n1;
- n->right = Z;
- n->type = types[TLONG];
- }
if(w > 1) {
n1 = new1(OXXX, Z, Z);
*n1 = *n;
@@ -715,6 +707,14 @@ arith(Node *n, int f)
n1->vconst = w;
}
}
+ if(0 && ewidth[TIND] > ewidth[TLONG]){
+ n1 = new1(OXXX, Z, Z);
+ *n1 = *n;
+ n->op = OCAST;
+ n->left = n1;
+ n->right = Z;
+ n->type = types[TLONG];
+ }
return;
}
if(!sametype(n->type, n->left->type)) {