From 16db5e53c1496b01c651d1ec347db4b267cc2af2 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Fri, 18 Feb 2011 22:44:01 +0000 Subject: [PATCH] BugFix: ensure that two ASM nodes are never congruent in combo. Without parsing the text of a ASM node it is not possible to decide whether two ASM nodes are congruent. Don't even try it. This fixes testsuite/opt/comboattrs.c [r28422] --- ir/opt/combo.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/ir/opt/combo.c b/ir/opt/combo.c index c0f610933..3b71669f0 100644 --- a/ir/opt/combo.c +++ b/ir/opt/combo.c @@ -114,7 +114,7 @@ struct opcode_key_t { ir_entity *ent; /**< For Sel Nodes, its entity */ int intVal; /**< For Conv/Div Nodes: strict/remainderless */ unsigned uintVal;/**< for Builtin: the kind */ - ir_node *block; /**< for Block: itself */ + ir_node *irn; /**< for nodes that never be construent: the node itself */ void *ptr; /**< generic pointer for hash/cmp */ } u; }; @@ -310,7 +310,8 @@ static void check_opcode(const partition_t *Z) key.u.intVal = get_Div_no_remainder(irn); break; case iro_Block: - key.u.block = irn; + case iro_ASM: + key.u.irn = irn; break; case iro_Builtin: key.u.intVal = get_Builtin_kind(irn); @@ -338,7 +339,8 @@ static void check_opcode(const partition_t *Z) assert(key.u.intVal == get_Div_no_remainder(irn)); break; case iro_Block: - assert(key.u.block == irn); + case iro_ASM: + assert(key.u.irn == irn); break; case iro_Builtin: assert(key.u.intVal == (int)get_Builtin_kind(irn)); @@ -1763,7 +1765,17 @@ static void *lambda_opcode(const node_t *node, environment_t *env) * We fix it by never letting blocks be congruent * which cannot be detected by combo either. */ - key.u.block = irn; + key.u.irn = irn; + break; + case iro_ASM: + /* + * If is difficult to detect when two ASM nodes are congruent: even + * if the assembler "text" is identical, the instruction might + * have a side effect like flag toggle or function call. + * So, do not even try it. + * + */ + key.u.irn = irn; break; case iro_Builtin: key.u.intVal = get_Builtin_kind(irn); -- 2.20.1