summaryrefslogtreecommitdiffhomepage
path: root/ir/ana
diff options
context:
space:
mode:
authorSebastian Buchwald <Sebastian.Buchwald@kit.edu>2016-01-09 23:23:53 +0100
committerSebastian Buchwald <Sebastian.Buchwald@kit.edu>2016-01-09 23:23:53 +0100
commit987260b3cbf887c9c43224523619ffe0a19c95b3 (patch)
tree8b6883e18a3634014f96096e06bec3fde30e56c8 /ir/ana
parent9114e7bdb71be2e9add27be532e5dce8235563d5 (diff)
Do not set a node as its own operand.
This fixes opt/fehler314.c.
Diffstat (limited to 'ir/ana')
-rw-r--r--ir/ana/irconsconfirm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ir/ana/irconsconfirm.c b/ir/ana/irconsconfirm.c
index b0b0b4d..0f36dde 100644
--- a/ir/ana/irconsconfirm.c
+++ b/ir/ana/irconsconfirm.c
@@ -370,8 +370,10 @@ static void handle_if(ir_node *block, ir_node *cmp, ir_relation rel, env_t *env)
if (rc == NULL)
rc = new_r_Confirm(block, right, left, rel);
- set_irn_n(succ, pos, rc);
- DB((dbg, LEVEL_2, "Replacing input %d of node %+F with %+F\n", pos, succ, rc));
+ if (succ != rc) {
+ set_irn_n(succ, pos, rc);
+ DB((dbg, LEVEL_2, "Replacing input %d of node %+F with %+F\n", pos, succ, rc));
+ }
env->num_confirms += 1;
}