Commit 9acafd2e authored by Christoph Mallon's avatar Christoph Mallon
Browse files

Use the correct mode for adding to a pointer.

This unbreaks the backend option 'profilegenerate'.
parent c1c1059e
...@@ -219,16 +219,17 @@ static void instrument_block(ir_node *const bb, ir_node *const address, unsigned ...@@ -219,16 +219,17 @@ static void instrument_block(ir_node *const bb, ir_node *const address, unsigned
return; return;
ir_type *const type_Iu = get_entity_type(get_irn_entity_attr(address)); ir_type *const type_Iu = get_entity_type(get_irn_entity_attr(address));
ir_node *const unknown = new_r_Unknown(irg, mode_M); ir_node *const unknown = new_r_Unknown(irg, mode_M);
ir_node *const cnst = new_r_Const_long(irg, mode_Iu, get_mode_size_bytes(mode_Iu) * id); ir_mode *const mode_off = get_reference_offset_mode(get_irn_mode(address));
ir_node *const offset = new_r_Add(bb, address, cnst); ir_node *const cnst = new_r_Const_long(irg, mode_off, get_mode_size_bytes(mode_Iu) * id);
ir_node *const load = new_r_Load(bb, unknown, offset, mode_Iu, type_Iu, cons_none); ir_node *const offset = new_r_Add(bb, address, cnst);
ir_node *const lmem = new_r_Proj(load, mode_M, pn_Load_M); ir_node *const load = new_r_Load(bb, unknown, offset, mode_Iu, type_Iu, cons_none);
ir_node *const proji = new_r_Proj(load, mode_Iu, pn_Load_res); ir_node *const lmem = new_r_Proj(load, mode_M, pn_Load_M);
ir_node *const one = new_r_Const_one(irg, mode_Iu); ir_node *const proji = new_r_Proj(load, mode_Iu, pn_Load_res);
ir_node *const add = new_r_Add(bb, proji, one); ir_node *const one = new_r_Const_one(irg, mode_Iu);
ir_node *const store = new_r_Store(bb, lmem, offset, add, type_Iu, cons_none); ir_node *const add = new_r_Add(bb, proji, one);
ir_node *const smem = new_r_Proj(store, mode_M, pn_Store_M); ir_node *const store = new_r_Store(bb, lmem, offset, add, type_Iu, cons_none);
ir_node *const smem = new_r_Proj(store, mode_M, pn_Store_M);
set_irn_link(bb, smem); set_irn_link(bb, smem);
set_irn_link(smem, load); set_irn_link(smem, load);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment