adapted for larger function result area

This commit is contained in:
ceriel 1989-03-14 15:36:33 +00:00
parent fb0051c85a
commit 21a8f93bc7
4 changed files with 14 additions and 5 deletions

View file

@ -1 +1 @@
static char Version[] = "ACK Modula-2 compiler Version 0.46";
static char Version[] = "ACK Modula-2 compiler Version 0.47";

View 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[];

View 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);

View 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) {