summaryrefslogtreecommitdiff
path: root/usr.bin/pcc/mip
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2007-09-24 16:04:02 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2007-09-24 16:04:02 +0000
commit007a3e7fc7cc91acab5158927a2ea9c7289ff9c0 (patch)
tree2263a58ddb2581c8e7271e71693339b778732d7a /usr.bin/pcc/mip
parentd72e08cc19fd8622db35472601107347aeeecd80 (diff)
pull from ragge's repo: -v flag and reg class check
Diffstat (limited to 'usr.bin/pcc/mip')
-rw-r--r--usr.bin/pcc/mip/mkext.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/pcc/mip/mkext.c b/usr.bin/pcc/mip/mkext.c
index b209708f711..555e3ba7551 100644
--- a/usr.bin/pcc/mip/mkext.c
+++ b/usr.bin/pcc/mip/mkext.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mkext.c,v 1.3 2007/09/20 13:40:32 otto Exp $ */
+/* $OpenBSD: mkext.c,v 1.4 2007/09/24 16:04:01 otto Exp $ */
/*
* Generate defines for the needed hardops.
*/
@@ -221,6 +221,11 @@ main(int argc, char *argv[])
if (breg > mx) mx = breg;
if (creg > mx) mx = creg;
if (dreg > mx) mx = dreg;
+ if (mx > (sizeof(int)*8)-1) {
+ printf("too many regs in a class, use two classes instead\n");
+ printf("%d > %zu\n", mx, (sizeof(int)*8)-1);
+ rval++;
+ }
fprintf(fc, "static int rmap[NUMCLASS][%d] = {\n", mx);
for (j = 0; j < NUMCLASS; j++) {
int cl = (1 << (j+1));