-
- offset = new_r_Add(get_irn_irg(bb), bb, address, new_Const_long(mode_Is, get_mode_size_bytes(mode_Iu)*id), mode_P);
- load = new_r_Load(get_irn_irg(bb), bb, new_NoMem(), offset, mode_Iu);
- projm = new_r_Proj(get_irn_irg(bb), bb, load, mode_M, 0);
- proji = new_r_Proj(get_irn_irg(bb), bb, load, mode_Iu, 2);
- add = new_r_Add(get_irn_irg(bb), bb, proji, new_Const_long(mode_Iu, 1), mode_Iu);
- store = new_r_Store(get_irn_irg(bb), bb, projm, offset, add);
- keep_alive(new_r_Proj(get_irn_irg(bb), bb, load, mode_M, 0));
+ ir_node *cnst;
+
+ if(bb == start_block || bb == get_irg_end_block(irg))
+ return;
+
+ cnst = new_r_Const_long(irg, start_block, mode_Iu, get_mode_size_bytes(mode_Iu) * id);
+ offset = new_r_Add(irg, bb, address, cnst, mode_P);
+ load = new_r_Load(irg, bb, new_NoMem(), offset, mode_Iu);
+ projm = new_r_Proj(irg, bb, load, mode_M, pn_Load_M);
+ proji = new_r_Proj(irg, bb, load, mode_Iu, pn_Load_res);
+ cnst = new_r_Const_long(irg, start_block, mode_Iu, 1);
+ add = new_r_Add(irg, bb, proji, cnst, mode_Iu);
+ store = new_r_Store(irg, bb, projm, offset, add);
+ projm = new_r_Proj(irg, bb, store, mode_M, pn_Store_M);
+ keep_alive(projm);