From: ceriel Date: Tue, 14 Mar 1989 15:36:33 +0000 (+0000) Subject: adapted for larger function result area X-Git-Tag: release-5-5~2505 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=21a8f93bc728c98f0872a8c453bd98316846fd9b;p=ack.git adapted for larger function result area --- diff --git a/lang/m2/comp/Version.c b/lang/m2/comp/Version.c index 014e54a6a..02e17914a 100644 --- a/lang/m2/comp/Version.c +++ b/lang/m2/comp/Version.c @@ -1 +1 @@ -static char Version[] = "ACK Modula-2 compiler Version 0.46"; +static char Version[] = "ACK Modula-2 compiler Version 0.47"; diff --git a/lang/m2/comp/type.H b/lang/m2/comp/type.H index c97f8855a..23f474213 100644 --- a/lang/m2/comp/type.H +++ b/lang/m2/comp/type.H @@ -176,6 +176,9 @@ extern arith pointer_size; /* All from type.c */ #endif NOCROSS +extern arith + ret_area_size; + extern arith align(); /* type.c */ @@ -220,7 +223,7 @@ extern t_type #define BaseType(tpx) ((tpx)->tp_fund == T_SUBRANGE ? (tpx)->tp_next : \ (tpx)) #define IsConstructed(tpx) ((tpx)->tp_fund & T_CONSTRUCTED) -#define TooBigForReturnArea(tpx) ((tpx)->tp_size > dword_size) +#define TooBigForReturnArea(tpx) ((tpx)->tp_size > ret_area_size) extern long full_mask[]; extern long max_int[]; diff --git a/lang/m2/comp/type.c b/lang/m2/comp/type.c index 8db3e4433..959fe4189 100644 --- a/lang/m2/comp/type.c +++ b/lang/m2/comp/type.c @@ -52,6 +52,8 @@ arith pointer_size = SZ_POINTER; #endif +arith ret_area_size; + t_type *bool_type, *char_type, @@ -160,6 +162,9 @@ InitTypes() fatal("long real size smaller than real size"); } + ret_area_size = (int) double_size > ((int) pointer_size << 1) ? + double_size : (pointer_size << 1); + /* character type */ char_type = standard_type(T_CHAR, 1, (arith) 1); diff --git a/lang/m2/comp/walk.c b/lang/m2/comp/walk.c index 4907fd261..7485a4149 100644 --- a/lang/m2/comp/walk.c +++ b/lang/m2/comp/walk.c @@ -553,13 +553,14 @@ WalkStat(nd, exit_label) C_lol(tmp2); RangeCheck(nd->nd_type, left->nd_left->nd_type); CodeDStore(nd); - C_lol(tmp); - ForLoopVarExpr(nd); if (left->nd_INT >= 0) { + C_lol(tmp); + ForLoopVarExpr(nd); } else { stepsize = -stepsize; - C_exg(int_size); + ForLoopVarExpr(nd); + C_lol(tmp); } C_sbu(int_size); if (stepsize) {