From 04fd3d04d95d51b5f55a8722be1b443e927fa591 Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Fri, 9 Nov 2012 20:11:17 +0100 Subject: [PATCH] the codegen has to use STORE_V for .vector, not STORE_FLD - contrary to the regular global-assignment, even fteqcc gets this right, so gmqcc should too --- ir.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/ir.c b/ir.c index cece314..940cfbb 100644 --- a/ir.c +++ b/ir.c @@ -75,6 +75,22 @@ uint16_t type_store_instr[TYPE_COUNT] = { INSTR_STORE_V, /* variant, should never be accessed */ }; +uint16_t field_store_instr[TYPE_COUNT] = { + INSTR_STORE_FLD, + INSTR_STORE_FLD, + INSTR_STORE_FLD, + INSTR_STORE_V, + INSTR_STORE_FLD, + INSTR_STORE_FLD, + INSTR_STORE_FLD, + INSTR_STORE_FLD, +#if 0 + INSTR_STORE_FLD, /* integer type */ +#endif + + INSTR_STORE_V, /* variant, should never be accessed */ +}; + uint16_t type_storep_instr[TYPE_COUNT] = { INSTR_STOREP_F, /* should use I when having integer support */ INSTR_STOREP_S, @@ -2502,7 +2518,10 @@ tailcall: stmt.opcode = INSTR_STORE_F; stmt.o3.u1 = 0; - stmt.opcode = type_store_instr[param->vtype]; + if (param->vtype == TYPE_FIELD) + stmt.opcode = field_store_instr[param->fieldtype]; + else + stmt.opcode = type_store_instr[param->vtype]; stmt.o1.u1 = ir_value_code_addr(param); stmt.o2.u1 = OFS_PARM0 + 3 * p; if (code_statements_add(stmt) < 0) @@ -2521,7 +2540,10 @@ tailcall: if (retvalue && retvalue->store != store_return && retvalue->life_count) { /* not to be kept in OFS_RETURN */ - stmt.opcode = type_store_instr[retvalue->vtype]; + if (retvalue->vtype == TYPE_FIELD) + stmt.opcode = field_store_instr[retvalue->vtype]; + else + stmt.opcode = type_store_instr[retvalue->vtype]; stmt.o1.u1 = OFS_RETURN; stmt.o2.u1 = ir_value_code_addr(retvalue); stmt.o3.u1 = 0; -- 2.39.2