From e1a3a1c136d574f5a2b8ca23272ac72b01550ac4 Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 9 Nov 1987 10:17:20 +0000 Subject: [PATCH] made to fit on a PDP-11 --- lang/m2/comp/chk_expr.c | 3 +++ lang/m2/comp/code.c | 51 ++++++++++++++++++++++++++--------------- lang/m2/comp/declar.g | 3 +++ lang/m2/comp/error.c | 3 +++ lang/m2/comp/options.c | 5 ++++ lang/m2/comp/type.c | 2 ++ lang/m2/comp/walk.c | 6 ++++- 7 files changed, 53 insertions(+), 20 deletions(-) diff --git a/lang/m2/comp/chk_expr.c b/lang/m2/comp/chk_expr.c index a0eafbaf3..853f3ad23 100644 --- a/lang/m2/comp/chk_expr.c +++ b/lang/m2/comp/chk_expr.c @@ -33,6 +33,7 @@ #include "misc.h" #include "warning.h" #include "main.h" +#include "squeeze.h" extern char *symbol2str(); extern char *sprint(); @@ -1175,10 +1176,12 @@ ChkStandard(expp) return 0; } if (! IsConformantArray(left->nd_type)) cstcall(expp, S_SIZE); +#ifndef SQUEEZE else node_warning(expp, W_STRICT, "%s on conformant array", expp->nd_left->nd_def->df_idf->id_text); +#endif break; case S_TRUNCD: diff --git a/lang/m2/comp/code.c b/lang/m2/comp/code.c index 3ce4feb74..176715021 100644 --- a/lang/m2/comp/code.c +++ b/lang/m2/comp/code.c @@ -207,28 +207,34 @@ CodeCoercion(t1, t2) switch(fund1) { case T_INTEGER: if (sz1 < word_size) { - C_loc(sz1); + c_loc((int)sz1); c_loc((int) word_size); C_cii(); } switch(fund2) { case T_INTEGER: - if (t2->tp_size != t1->tp_size) { - C_loc(t1->tp_size); - C_loc(t2->tp_size); +#ifndef SQUEEZE + if (t2->tp_size != t1->tp_size) +#endif + { + c_loc((int)(t1->tp_size)); + c_loc((int)(t2->tp_size)); C_cii(); } break; case T_CARDINAL: - if (t1->tp_size != word_size) { - C_loc(t1->tp_size); +#ifndef SQUEEZE + if (t1->tp_size != word_size) +#endif + { + c_loc((int)(t1->tp_size)); c_loc((int) word_size); C_ciu(); } break; case T_REAL: - C_loc(t1->tp_size); - C_loc(t2->tp_size); + c_loc((int)(t1->tp_size)); + c_loc((int)(t2->tp_size)); C_cif(); break; default: @@ -243,20 +249,24 @@ CodeCoercion(t1, t2) case T_INTORCARD: if (t2->tp_size > word_size) { c_loc((int) word_size); - C_loc(t2->tp_size); + c_loc((int)(t2->tp_size)); C_cuu(); } break; 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(t2->tp_size); + c_loc((int)(t2->tp_size)); C_cui(); } break; case T_REAL: c_loc((int) word_size); - C_loc(t2->tp_size); + c_loc((int)(t2->tp_size)); C_cuf(); break; default: @@ -267,15 +277,18 @@ CodeCoercion(t1, t2) case T_REAL: switch(fund2) { case T_REAL: - if (t2->tp_size != t1->tp_size) { - C_loc(t1->tp_size); - C_loc(t2->tp_size); +#ifndef SQUEEZE + if (t2->tp_size != t1->tp_size) +#endif + { + c_loc((int)(t1->tp_size)); + c_loc((int)(t2->tp_size)); C_cff(); } break; case T_INTEGER: - C_loc(t1->tp_size); - C_loc(t2->tp_size); + c_loc((int)(t1->tp_size)); + c_loc((int)(t2->tp_size)); C_cfi(); break; case T_CARDINAL: @@ -290,8 +303,8 @@ CodeCoercion(t1, t2) C_trp(); C_df_ilb(lb); } - C_loc(t1->tp_size); - C_loc(t2->tp_size); + c_loc((int)(t1->tp_size)); + c_loc((int)(t2->tp_size)); C_cfu(); break; default: diff --git a/lang/m2/comp/declar.g b/lang/m2/comp/declar.g index 7ad189099..650f97586 100644 --- a/lang/m2/comp/declar.g +++ b/lang/m2/comp/declar.g @@ -28,6 +28,7 @@ #include "main.h" #include "chk_expr.h" #include "warning.h" +#include "squeeze.h" int proclevel = 0; /* nesting level of procedures */ 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)); +#ifndef SQUEEZE if (tp && IsConstructed(tp)) { warning(W_STRICT, "procedure \"%s\" has a constructed result type", (*pdf)->df_idf->id_text); } +#endif } ; diff --git a/lang/m2/comp/error.c b/lang/m2/comp/error.c index 3f97ef4e3..10bf8ca93 100644 --- a/lang/m2/comp/error.c +++ b/lang/m2/comp/error.c @@ -28,6 +28,7 @@ #include "main.h" #include "node.h" #include "warning.h" +#include "squeeze.h" /* error classes */ #define ERROR 1 @@ -176,9 +177,11 @@ _error(class, node, fmt, argv) remark = "(old-fashioned use)"; break; #endif +#ifndef SQUEEZE case W_STRICT: remark = "(strict)"; break; +#endif default: remark = "(warning)"; break; diff --git a/lang/m2/comp/options.c b/lang/m2/comp/options.c index 7854a3ab1..b9a277f3e 100644 --- a/lang/m2/comp/options.c +++ b/lang/m2/comp/options.c @@ -19,6 +19,7 @@ #include "type.h" #include "main.h" #include "warning.h" +#include "squeeze.h" #define MINIDFSIZE 14 @@ -60,9 +61,11 @@ DoOption(text) warning_classes &= ~W_OLDFASHIONED; break; #endif +#ifndef SQUEEZE case 'R': warning_classes &= ~W_STRICT; break; +#endif case 'W': warning_classes &= ~W_ORDINARY; break; @@ -81,9 +84,11 @@ DoOption(text) warning_classes |= W_OLDFASHIONED; break; #endif +#ifndef SQUEEZE case 'R': warning_classes |= W_STRICT; break; +#endif case 'W': warning_classes |= W_ORDINARY; break; diff --git a/lang/m2/comp/type.c b/lang/m2/comp/type.c index 862c1f533..9db3d36c6 100644 --- a/lang/m2/comp/type.c +++ b/lang/m2/comp/type.c @@ -473,9 +473,11 @@ set_type(tp) getbounds(tp, &lb, &ub); +#ifndef SQUEEZE if (lb < 0) { warning(W_STRICT, "base type of set has negative lower bound"); } +#endif diff = ub - lb + 1; if (diff < 0 || (sizeof(int) == 2 && diff > 65535)) { diff --git a/lang/m2/comp/walk.c b/lang/m2/comp/walk.c index 46b3c68ce..f63ed28b2 100644 --- a/lang/m2/comp/walk.c +++ b/lang/m2/comp/walk.c @@ -554,9 +554,13 @@ WalkStat(nd, exit_label) nd->nd_def->df_flags &= ~D_FORLOOP; if (good_forvar) { if (! options['R']) { + label x = ++text_label; C_lol(tmp2); ForLoopVarExpr(nd); - C_cal("_forloopchk"); + C_beq(x); + c_loc(M2_FORCH); + C_trp(); + C_df_ilb(x); FreeInt(tmp2); } if (stepsize) { -- 2.34.1