Commit fe8b1bf8 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

ldstopt: Convert values with reference mode to integer mode before shifting.

This fixes opt/fehler315.c
parent 2eb2ab8c
......@@ -421,9 +421,14 @@ static ir_node *transform_previous_value(ir_mode *const load_mode,
: delta;
ir_node *new_value = prev_value;
if (shift != 0) {
ir_mode *new_mode = prev_mode;
if (mode_is_reference(new_mode)) {
new_mode = get_reference_offset_mode(new_mode);
new_value = new_r_Conv(block, new_value, new_mode);
}
ir_graph *const irg = get_irn_irg(block);
ir_node *const cnst = new_r_Const_long(irg, mode_Iu, shift * 8);
new_value = new_r_Shr(block, new_value, cnst, prev_mode);
new_value = new_r_Shr(block, new_value, cnst, new_mode);
}
return new_r_Conv(block, new_value, load_mode);
......
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