From 67b75055b24348d517a922953565e3a5a5cee1bd Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Fri, 29 Jun 2012 14:37:12 +0200 Subject: [PATCH] adding another storage type: store_return; when generating a CALL, the generator can check the output value's storetype, and if it is NOT store_return, it needs to STORE_x the return value into the output value. --- gmqcc.h | 3 ++- ir.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gmqcc.h b/gmqcc.h index 7fe6f13..7671799 100644 --- a/gmqcc.h +++ b/gmqcc.h @@ -774,7 +774,8 @@ _MEM_VEC_FUN_FIND(Tself, Twhat, mem) enum store_types { store_global, store_local, /* local, assignable for now, should get promoted later */ - store_value /* unassignable */ + store_value, /* unassignable */ + store_return /* unassignable, at OFS_RETURN */ }; typedef struct { diff --git a/ir.c b/ir.c index 3621359..5b94e5b 100644 --- a/ir.c +++ b/ir.c @@ -2184,6 +2184,8 @@ tailcall: if (instr->opcode >= INSTR_CALL0 && instr->opcode <= INSTR_CALL8) { /* Trivial call translation: * copy all params to OFS_PARM* + * if the output's storetype is not store_return, + * add append a STORE instruction! * * NOTES on how to do it better without much trouble: * -) The liferanges! -- 2.39.2