label lab_count = 1;
label datlab_count = 1;
-arith fbytes;
int fp_used;
extern arith NewLocal(); /* util.c */
#endif
}
-end_proc()
+end_proc(fbytes)
+ arith fbytes;
{
/* end_proc() deals with the code to be generated at the end of
a function, as there is:
prc_exit();
if (return_expr_occurred) {
if (struct_return != 0) {
- LoadLocal(fbytes, pointer_size);
+ LoadLocal((arith) 0, pointer_size);
C_ret(pointer_size);
}
else
C_beginpart(pro_id);
C_pro(func_name, nbytes);
#endif
- if (struct_return) fbytes += pointer_size;
if (fbytes > max_int) {
error("%s has more than %ld parameter bytes",
func_name, (long) max_int);
ch3cast(&expr, RETURN, func_type);
code_expr(expr, RVAL, TRUE, NO_LABEL, NO_LABEL);
if (struct_return != 0) {
- LoadLocal(fbytes, pointer_size);
+ LoadLocal((arith) 0, pointer_size);
store_block(func_size, func_type->tp_align);
}
C_bra(return_label);
ParSize += pointer_size;
}
}
- if (is_struct_or_union(tp->tp_fund)) {
- retspace = NewLocal(tp->tp_size, tp->tp_align,
- -1, 0);
- C_lal(retspace);
- ParSize += pointer_size;
- }
if ((ex = right) != NILEXPR) {
/* function call with parameters*/
while ( ex->ex_class == Oper &&
EVAL(ex, RVAL, TRUE, NO_LABEL, NO_LABEL);
ParSize += ATW(ex->ex_type->tp_size);
}
+ if (is_struct_or_union(tp->tp_fund)) {
+ retspace = NewLocal(tp->tp_size, tp->tp_align,
+ -1, 0);
+ C_lal(retspace);
+ ParSize += pointer_size;
+ }
if (ISNAME(left)) {
/* e.g., main() { (*((int (*)())0))(); } */
C_cal(left->VL_IDF->id_text);
if (options['t'])
dumpidftab("start declare_formals", 0);
#endif /* DEBUG */
+ if (is_struct_or_union(idf->id_def->df_type->tp_up->tp_fund)) {
+ /* create space for address of return value */
+ f_offset = pointer_size;
+ }
while (se) {
register struct def *def = se->se_idf->id_def;
extern arith ifval;
#endif /* NOPP */
-extern arith fbytes;
extern error();
}
/* 3.7.1 */
function(struct decspecs *ds; struct declarator *dc;)
{
+ arith fbytes;
register struct idf *idf = dc->dc_idf;
}
:
}
compound_statement
{
- end_proc();
+ end_proc(fbytes);
#ifdef LINT
lint_implicit_return();
#endif /* LINT */