self->memberof = NULL;
self->unique_life = false;
+ self->locked = false;
self->life = NULL;
return self;
for (i = 0; i != vec_size(self->living); ++i)
{
tempbool = ir_value_life_merge(self->living[i], eid);
- /* debug
- if (tempbool)
- irerror(self->context, "block_living_add_instr() value instruction added %s: %i", self->living[i]->_name, (int)eid);
- */
changed = changed || tempbool;
}
return changed;
}
+static bool ir_block_living_lock(ir_block *self)
+{
+ size_t i;
+ bool changed = false;
+ for (i = 0; i != vec_size(self->living); ++i)
+ {
+ if (!self->living[i]->locked)
+ changed = true;
+ self->living[i]->locked = true;
+ }
+ return changed;
+}
+
static bool ir_block_life_prop_previous(ir_block* self, ir_block *prev, bool *changed)
{
size_t i;
vec_push(self->living, value->members[mem]);
}
}
+ /* on a call, all these values must be "locked" */
+ if (instr->opcode >= INSTR_CALL0 && instr->opcode <= INSTR_CALL8) {
+ if (ir_block_living_lock(self))
+ *changed = true;
+ }
/* (A) */
tempbool = ir_block_living_add_instr(self, instr->eid);
/* arrays will never overlap with temps */
bool unique_life;
+ /* temps living during a CALL must be locked */
+ bool locked;
/* For the temp allocator */
ir_life_entry_t *life;