adapted for larger function result area
authorceriel <none@none>
Tue, 14 Mar 1989 15:36:33 +0000 (15:36 +0000)
committerceriel <none@none>
Tue, 14 Mar 1989 15:36:33 +0000 (15:36 +0000)
lang/m2/comp/Version.c
lang/m2/comp/type.H
lang/m2/comp/type.c
lang/m2/comp/walk.c

index 014e54a..02e1791 100644 (file)
@@ -1 +1 @@
-static char Version[] = "ACK Modula-2 compiler Version 0.46";
+static char Version[] = "ACK Modula-2 compiler Version 0.47";
index c97f885..23f4742 100644 (file)
@@ -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[];
index 8db3e44..959fe41 100644 (file)
@@ -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);
index 4907fd2..7485a41 100644 (file)
@@ -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) {