Commit 2c77a96f authored by Matthias Braun's avatar Matthias Braun
Browse files

verify that Projs are in the same Block as their predecessors (and fix bugs in...

verify that Projs are in the same Block as their predecessors (and fix bugs in firm where this wasn't the case)

[r26163]
parent 59a6e0a2
...@@ -1648,13 +1648,10 @@ static void fix_address_of_parameter_access(be_abi_irg_t *env, ent_pos_pair *val ...@@ -1648,13 +1648,10 @@ static void fix_address_of_parameter_access(be_abi_irg_t *env, ent_pos_pair *val
unsigned offset; unsigned offset;
foreach_block_succ(start_bl, edge) { foreach_block_succ(start_bl, edge) {
ir_node *succ = get_edge_src_irn(edge); first_bl = get_edge_src_irn(edge);
if (start_bl != succ) { break;
first_bl = succ;
break;
}
} }
assert(first_bl); assert(first_bl && first_bl != start_bl);
/* we had already removed critical edges, so the following /* we had already removed critical edges, so the following
assertion should be always true. */ assertion should be always true. */
assert(get_Block_n_cfgpreds(first_bl) == 1); assert(get_Block_n_cfgpreds(first_bl) == 1);
...@@ -1665,7 +1662,7 @@ static void fix_address_of_parameter_access(be_abi_irg_t *env, ent_pos_pair *val ...@@ -1665,7 +1662,7 @@ static void fix_address_of_parameter_access(be_abi_irg_t *env, ent_pos_pair *val
save_optimization_state(&state); save_optimization_state(&state);
set_optimize(0); set_optimize(0);
nmem = new_r_Proj(irg, first_bl, get_irg_start(irg), mode_M, pn_Start_M); nmem = new_r_Proj(irg, start_bl, get_irg_start(irg), mode_M, pn_Start_M);
restore_optimization_state(&state); restore_optimization_state(&state);
/* reroute all edges to the new memory source */ /* reroute all edges to the new memory source */
......
...@@ -4244,12 +4244,13 @@ static ir_node *gen_Proj_Load(ir_node *node) ...@@ -4244,12 +4244,13 @@ static ir_node *gen_Proj_Load(ir_node *node)
*/ */
if (is_Load(pred) && proj == pn_Load_M && get_irn_n_edges(pred) > 1) { if (is_Load(pred) && proj == pn_Load_M && get_irn_n_edges(pred) > 1) {
ir_node *res; ir_node *res;
ir_node *old_block = get_nodes_block(node);
/* this is needed, because sometimes we have loops that are only /* this is needed, because sometimes we have loops that are only
reachable through the ProjM */ reachable through the ProjM */
be_enqueue_preds(node); be_enqueue_preds(node);
/* do it in 2 steps, to silence firm verifier */ /* do it in 2 steps, to silence firm verifier */
res = new_rd_Proj(dbgi, irg, block, pred, mode_M, pn_Load_M); res = new_rd_Proj(dbgi, irg, old_block, pred, mode_M, pn_Load_M);
set_Proj_proj(res, pn_ia32_mem); set_Proj_proj(res, pn_ia32_mem);
return res; return res;
} }
......
...@@ -829,10 +829,10 @@ static int ...@@ -829,10 +829,10 @@ static int
verify_node_Proj(ir_node *p, ir_graph *irg) { verify_node_Proj(ir_node *p, ir_graph *irg) {
ir_node *pred; ir_node *pred;
ir_op *op; ir_op *op;
(void) irg;
pred = skip_Id(get_Proj_pred(p)); pred = skip_Id(get_Proj_pred(p));
ASSERT_AND_RET(get_irn_mode(pred) == mode_T, "mode of a 'projed' node is not Tuple", 0); ASSERT_AND_RET(get_irn_mode(pred) == mode_T, "mode of a 'projed' node is not Tuple", 0);
ASSERT_AND_RET(get_irg_pinned(irg) == op_pin_state_floats || get_nodes_block(pred) == get_nodes_block(p), "Proj must be in same block as its predecessor", 0);
op = get_irn_op(pred); op = get_irn_op(pred);
......
...@@ -1421,7 +1421,7 @@ static void lower_Cond(ir_node *node, ir_mode *mode, lower_env_t *env) { ...@@ -1421,7 +1421,7 @@ static void lower_Cond(ir_node *node, ir_mode *mode, lower_env_t *env) {
newbl_eq = new_r_Block(irg, 1, &projHF); newbl_eq = new_r_Block(irg, 1, &projHF);
irn = new_r_Proj(irg, newbl_eq, cmpH, mode_b, pn_Cmp_Eq); irn = new_r_Proj(irg, block, cmpH, mode_b, pn_Cmp_Eq);
irn = new_rd_Cond(dbg, irg, newbl_eq, irn); irn = new_rd_Cond(dbg, irg, newbl_eq, irn);
proj = new_r_Proj(irg, newbl_eq, irn, mode_X, pn_Cond_false); proj = new_r_Proj(irg, newbl_eq, irn, mode_X, pn_Cond_false);
......
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