for void returning functions we can use store_return to avoid a useless store after it

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-08-19 17:42:22 +02:00
parent e1ffa04bc2
commit 332d306723

2
ir.c
View file

@ -1225,7 +1225,7 @@ ir_instr* ir_block_create_call(ir_block *self, const char *label, ir_value *func
in = ir_instr_new(self, INSTR_CALL0);
if (!in)
return NULL;
out = ir_value_out(self->owner, label, store_value, func->outtype);
out = ir_value_out(self->owner, label, (func->outtype == TYPE_VOID) ? store_return : store_value, func->outtype);
if (!out) {
ir_instr_delete(in);
return NULL;