summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Magnusson <ragge@cvs.openbsd.org>2007-10-23 14:48:37 +0000
committerAnders Magnusson <ragge@cvs.openbsd.org>2007-10-23 14:48:37 +0000
commit41ab06324af4f3333058e3d67aa9df15f75e8f4d (patch)
tree267cee6d209f980a7ca59c22dd44b1d3db0f2ce2
parent1dd6acbce87ff1355b112ca0fb8ea19d258cb6fe (diff)
Fix from master repo:
> Fix signed/unsigned type cast error, from Takehiko Nozaki.
-rw-r--r--usr.bin/pcc/i386/order.c6
-rw-r--r--usr.bin/pcc/i386/table.c14
2 files changed, 10 insertions, 10 deletions
diff --git a/usr.bin/pcc/i386/order.c b/usr.bin/pcc/i386/order.c
index 5ea82841869..de7d5c99acb 100644
--- a/usr.bin/pcc/i386/order.c
+++ b/usr.bin/pcc/i386/order.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: order.c,v 1.1 2007/10/22 13:39:37 otto Exp $ */
+/* $OpenBSD: order.c,v 1.2 2007/10/23 14:48:36 ragge Exp $ */
/*
* Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se).
* All rights reserved.
@@ -183,8 +183,8 @@ nspecial(struct optab *q)
static struct rspecial s[] = {
{ NOLEFT, ESI }, { NOLEFT, EDI }, { 0 } };
return s;
- } else if ((q->ltype & (TINT|TUNSIGNED)) &&
- q->rtype == TLONGLONG) {
+ } else if ((q->ltype & TINT) &&
+ q->rtype == (TLONGLONG|TULONGLONG)) {
static struct rspecial s[] = {
{ NLEFT, EAX }, { NRES, EAXEDX },
{ NEVER, EAX }, { NEVER, EDX }, { 0 } };
diff --git a/usr.bin/pcc/i386/table.c b/usr.bin/pcc/i386/table.c
index 1826ebb047c..cad725ad629 100644
--- a/usr.bin/pcc/i386/table.c
+++ b/usr.bin/pcc/i386/table.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: table.c,v 1.1 2007/10/22 13:39:37 otto Exp $ */
+/* $OpenBSD: table.c,v 1.2 2007/10/23 14:48:36 ragge Exp $ */
/*
* Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se).
* All rights reserved.
@@ -241,17 +241,17 @@ struct optab table[] = {
0, RLEFT,
"", },
-/* convert int to long long */
+/* convert signed int to (u)long long */
{ SCONV, INLL,
- SAREG, TWORD|TPOINT,
- SCREG, TLONGLONG,
+ SHINT, TSWORD,
+ SHLL, TLL,
NSPECIAL|NCREG|NCSL, RESC1,
" cltd\n", },
-/* convert int to unsigned long long */
+/* convert unsigned int to (u)long long */
{ SCONV, INLL,
- SAREG|SOREG|SNAME, TWORD|TPOINT,
- SHLL, TULONGLONG,
+ SHINT|SOREG|SNAME, TUWORD|TPOINT,
+ SHLL, TLL,
NCSL|NCREG, RESC1,
" movl AL,A1\n xorl U1,U1\n", },