return ir;
}
+static void sequence_point(void)
+{
+ int i;
+
+ /* Ensures that any partially-evaluated expressions on the stack are executed right
+ * now. This typically needs to happen before store operations, to prevents loads of
+ * the same address being delayed until after the store (at which point they'll
+ * return incorrect values).
+ */
+
+ assert(current_bb != NULL);
+
+ for (i=0; i<stackptr; i++)
+ {
+ struct ir* ir = stack[i];
+ array_appendu(¤t_bb->irs, ir);
+ }
+}
+
static void materialise_stack(void)
{
int i;
{
int opcode;
+ sequence_point();
+
if (size == 1)
{
opcode = IR_STOREB;
case op_sim:
{
+ sequence_point();
appendir(
new_ir2(
(EM_wordsize == 2) ? IR_STORE : IR_STOREH, EM_wordsize,
break;
case op_ste:
+ sequence_point();
appendir(
new_ir2(
IR_STORE, EM_wordsize,
break;
case op_sde:
+ sequence_point();
appendir(
new_ir2(
IR_STORE, EM_wordsize*2,
break;
case op_zre:
+ sequence_point();
appendir(
new_ir2(
IR_STORE, EM_wordsize,
break;
case op_ine:
+ sequence_point();
appendir(
new_ir2(
IR_STORE, EM_wordsize,
break;
case op_dee:
+ sequence_point();
appendir(
new_ir2(
IR_STORE, EM_wordsize,