Commit a0f21d0f authored by Andreas Fried's avatar Andreas Fried
Browse files

Check for correct mode when rematerializing flags.

Now that the flag outputs of arithmetic operations are used, a node may
have multiple connections to the flag producer, but only one of these
actually reads the flags.
parent 06dde485
......@@ -114,10 +114,11 @@ static void rematerialize_or_move(ir_node *flags_needed, ir_node *node,
value = copy;
ir_node *n = flag_consumers;
ir_mode *value_mode = get_irn_mode(value);
ir_node *n = flag_consumers;
do {
foreach_irn_in(n, i, in) {
if (skip_Proj(in) == flags_needed) {
if (get_irn_mode(in) == value_mode && skip_Proj(in) == flags_needed) {
set_irn_n(n, i, value);
Supports Markdown
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