made to fit on a PDP-11
This commit is contained in:
parent
028beaf5e6
commit
e1a3a1c136
7 changed files with 53 additions and 20 deletions
|
@ -33,6 +33,7 @@
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "warning.h"
|
#include "warning.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include "squeeze.h"
|
||||||
|
|
||||||
extern char *symbol2str();
|
extern char *symbol2str();
|
||||||
extern char *sprint();
|
extern char *sprint();
|
||||||
|
@ -1175,10 +1176,12 @@ ChkStandard(expp)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (! IsConformantArray(left->nd_type)) cstcall(expp, S_SIZE);
|
if (! IsConformantArray(left->nd_type)) cstcall(expp, S_SIZE);
|
||||||
|
#ifndef SQUEEZE
|
||||||
else node_warning(expp,
|
else node_warning(expp,
|
||||||
W_STRICT,
|
W_STRICT,
|
||||||
"%s on conformant array",
|
"%s on conformant array",
|
||||||
expp->nd_left->nd_def->df_idf->id_text);
|
expp->nd_left->nd_def->df_idf->id_text);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S_TRUNCD:
|
case S_TRUNCD:
|
||||||
|
|
|
@ -207,28 +207,34 @@ CodeCoercion(t1, t2)
|
||||||
switch(fund1) {
|
switch(fund1) {
|
||||||
case T_INTEGER:
|
case T_INTEGER:
|
||||||
if (sz1 < word_size) {
|
if (sz1 < word_size) {
|
||||||
C_loc(sz1);
|
c_loc((int)sz1);
|
||||||
c_loc((int) word_size);
|
c_loc((int) word_size);
|
||||||
C_cii();
|
C_cii();
|
||||||
}
|
}
|
||||||
switch(fund2) {
|
switch(fund2) {
|
||||||
case T_INTEGER:
|
case T_INTEGER:
|
||||||
if (t2->tp_size != t1->tp_size) {
|
#ifndef SQUEEZE
|
||||||
C_loc(t1->tp_size);
|
if (t2->tp_size != t1->tp_size)
|
||||||
C_loc(t2->tp_size);
|
#endif
|
||||||
|
{
|
||||||
|
c_loc((int)(t1->tp_size));
|
||||||
|
c_loc((int)(t2->tp_size));
|
||||||
C_cii();
|
C_cii();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case T_CARDINAL:
|
case T_CARDINAL:
|
||||||
if (t1->tp_size != word_size) {
|
#ifndef SQUEEZE
|
||||||
C_loc(t1->tp_size);
|
if (t1->tp_size != word_size)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
c_loc((int)(t1->tp_size));
|
||||||
c_loc((int) word_size);
|
c_loc((int) word_size);
|
||||||
C_ciu();
|
C_ciu();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case T_REAL:
|
case T_REAL:
|
||||||
C_loc(t1->tp_size);
|
c_loc((int)(t1->tp_size));
|
||||||
C_loc(t2->tp_size);
|
c_loc((int)(t2->tp_size));
|
||||||
C_cif();
|
C_cif();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -243,20 +249,24 @@ CodeCoercion(t1, t2)
|
||||||
case T_INTORCARD:
|
case T_INTORCARD:
|
||||||
if (t2->tp_size > word_size) {
|
if (t2->tp_size > word_size) {
|
||||||
c_loc((int) word_size);
|
c_loc((int) word_size);
|
||||||
C_loc(t2->tp_size);
|
c_loc((int)(t2->tp_size));
|
||||||
C_cuu();
|
C_cuu();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case T_INTEGER:
|
case T_INTEGER:
|
||||||
if (fund1 == T_CARDINAL || t2->tp_size != word_size) {
|
if (fund1 == T_CARDINAL
|
||||||
|
#ifndef SQUEEZE
|
||||||
|
|| t2->tp_size != word_size
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
c_loc((int) word_size);
|
c_loc((int) word_size);
|
||||||
C_loc(t2->tp_size);
|
c_loc((int)(t2->tp_size));
|
||||||
C_cui();
|
C_cui();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case T_REAL:
|
case T_REAL:
|
||||||
c_loc((int) word_size);
|
c_loc((int) word_size);
|
||||||
C_loc(t2->tp_size);
|
c_loc((int)(t2->tp_size));
|
||||||
C_cuf();
|
C_cuf();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -267,15 +277,18 @@ CodeCoercion(t1, t2)
|
||||||
case T_REAL:
|
case T_REAL:
|
||||||
switch(fund2) {
|
switch(fund2) {
|
||||||
case T_REAL:
|
case T_REAL:
|
||||||
if (t2->tp_size != t1->tp_size) {
|
#ifndef SQUEEZE
|
||||||
C_loc(t1->tp_size);
|
if (t2->tp_size != t1->tp_size)
|
||||||
C_loc(t2->tp_size);
|
#endif
|
||||||
|
{
|
||||||
|
c_loc((int)(t1->tp_size));
|
||||||
|
c_loc((int)(t2->tp_size));
|
||||||
C_cff();
|
C_cff();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case T_INTEGER:
|
case T_INTEGER:
|
||||||
C_loc(t1->tp_size);
|
c_loc((int)(t1->tp_size));
|
||||||
C_loc(t2->tp_size);
|
c_loc((int)(t2->tp_size));
|
||||||
C_cfi();
|
C_cfi();
|
||||||
break;
|
break;
|
||||||
case T_CARDINAL:
|
case T_CARDINAL:
|
||||||
|
@ -290,8 +303,8 @@ CodeCoercion(t1, t2)
|
||||||
C_trp();
|
C_trp();
|
||||||
C_df_ilb(lb);
|
C_df_ilb(lb);
|
||||||
}
|
}
|
||||||
C_loc(t1->tp_size);
|
c_loc((int)(t1->tp_size));
|
||||||
C_loc(t2->tp_size);
|
c_loc((int)(t2->tp_size));
|
||||||
C_cfu();
|
C_cfu();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "chk_expr.h"
|
#include "chk_expr.h"
|
||||||
#include "warning.h"
|
#include "warning.h"
|
||||||
|
#include "squeeze.h"
|
||||||
|
|
||||||
int proclevel = 0; /* nesting level of procedures */
|
int proclevel = 0; /* nesting level of procedures */
|
||||||
int return_occurred; /* set if a return occurs in a block */
|
int return_occurred; /* set if a return occurs in a block */
|
||||||
|
@ -73,10 +74,12 @@ ProcedureHeading(t_def **pdf; int type;)
|
||||||
]?
|
]?
|
||||||
]?
|
]?
|
||||||
{ CheckWithDef(*pdf, proc_type(tp, pr, parmaddr));
|
{ CheckWithDef(*pdf, proc_type(tp, pr, parmaddr));
|
||||||
|
#ifndef SQUEEZE
|
||||||
if (tp && IsConstructed(tp)) {
|
if (tp && IsConstructed(tp)) {
|
||||||
warning(W_STRICT, "procedure \"%s\" has a constructed result type",
|
warning(W_STRICT, "procedure \"%s\" has a constructed result type",
|
||||||
(*pdf)->df_idf->id_text);
|
(*pdf)->df_idf->id_text);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "node.h"
|
#include "node.h"
|
||||||
#include "warning.h"
|
#include "warning.h"
|
||||||
|
#include "squeeze.h"
|
||||||
|
|
||||||
/* error classes */
|
/* error classes */
|
||||||
#define ERROR 1
|
#define ERROR 1
|
||||||
|
@ -176,9 +177,11 @@ _error(class, node, fmt, argv)
|
||||||
remark = "(old-fashioned use)";
|
remark = "(old-fashioned use)";
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef SQUEEZE
|
||||||
case W_STRICT:
|
case W_STRICT:
|
||||||
remark = "(strict)";
|
remark = "(strict)";
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
remark = "(warning)";
|
remark = "(warning)";
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include "type.h"
|
#include "type.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "warning.h"
|
#include "warning.h"
|
||||||
|
#include "squeeze.h"
|
||||||
|
|
||||||
#define MINIDFSIZE 14
|
#define MINIDFSIZE 14
|
||||||
|
|
||||||
|
@ -60,9 +61,11 @@ DoOption(text)
|
||||||
warning_classes &= ~W_OLDFASHIONED;
|
warning_classes &= ~W_OLDFASHIONED;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef SQUEEZE
|
||||||
case 'R':
|
case 'R':
|
||||||
warning_classes &= ~W_STRICT;
|
warning_classes &= ~W_STRICT;
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
case 'W':
|
case 'W':
|
||||||
warning_classes &= ~W_ORDINARY;
|
warning_classes &= ~W_ORDINARY;
|
||||||
break;
|
break;
|
||||||
|
@ -81,9 +84,11 @@ DoOption(text)
|
||||||
warning_classes |= W_OLDFASHIONED;
|
warning_classes |= W_OLDFASHIONED;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef SQUEEZE
|
||||||
case 'R':
|
case 'R':
|
||||||
warning_classes |= W_STRICT;
|
warning_classes |= W_STRICT;
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
case 'W':
|
case 'W':
|
||||||
warning_classes |= W_ORDINARY;
|
warning_classes |= W_ORDINARY;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -473,9 +473,11 @@ set_type(tp)
|
||||||
|
|
||||||
getbounds(tp, &lb, &ub);
|
getbounds(tp, &lb, &ub);
|
||||||
|
|
||||||
|
#ifndef SQUEEZE
|
||||||
if (lb < 0) {
|
if (lb < 0) {
|
||||||
warning(W_STRICT, "base type of set has negative lower bound");
|
warning(W_STRICT, "base type of set has negative lower bound");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
diff = ub - lb + 1;
|
diff = ub - lb + 1;
|
||||||
if (diff < 0 || (sizeof(int) == 2 && diff > 65535)) {
|
if (diff < 0 || (sizeof(int) == 2 && diff > 65535)) {
|
||||||
|
|
|
@ -554,9 +554,13 @@ WalkStat(nd, exit_label)
|
||||||
nd->nd_def->df_flags &= ~D_FORLOOP;
|
nd->nd_def->df_flags &= ~D_FORLOOP;
|
||||||
if (good_forvar) {
|
if (good_forvar) {
|
||||||
if (! options['R']) {
|
if (! options['R']) {
|
||||||
|
label x = ++text_label;
|
||||||
C_lol(tmp2);
|
C_lol(tmp2);
|
||||||
ForLoopVarExpr(nd);
|
ForLoopVarExpr(nd);
|
||||||
C_cal("_forloopchk");
|
C_beq(x);
|
||||||
|
c_loc(M2_FORCH);
|
||||||
|
C_trp();
|
||||||
|
C_df_ilb(x);
|
||||||
FreeInt(tmp2);
|
FreeInt(tmp2);
|
||||||
}
|
}
|
||||||
if (stepsize) {
|
if (stepsize) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue