Commit dbbe99ab authored by Michael Beck's avatar Michael Beck
Browse files

BugFix: when we create a new Conv node in combo's exchange_leader(), this irn has no node_t.

When we create a new Conv node in combo's exchange_leader(), this irn has no node_t.
This is ok, replace the original node in a post walker.
However, as the new node has a visited count of 0 it might be revisited
again.
Fix this by copying the visited count.

This fixes testsuite/opt/fehler179.c

[r28291]
parent 8ebd0a55
......@@ -3255,8 +3255,20 @@ static void exchange_leader(ir_node *irn, ir_node *leader)
* the number of Conv due to CSE. */
ir_node *block = get_nodes_block(leader);
dbg_info *dbg = get_irn_dbg_info(irn);
leader = new_rd_Conv(dbg, block, leader, mode);
ir_node *nlead = new_rd_Conv(dbg, block, leader, mode);
if (nlead != leader) {
/* Note: this newly create irn has no node info because
* it is created after the analysis. However, this node
* replaces the node irn and should not be visited again,
* so set its visited count to the count of irn.
* Otherwise we might visited this node more than once if
* irn had more than one user.
*/
set_irn_node(nlead, NULL);
set_irn_visited(nlead, get_irn_visited(irn));
leader = nlead;
}
}
exchange(irn, leader);
} /* exchange_leader */
......
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