Commit 16db5e53 authored by Michael Beck's avatar Michael Beck
Browse files

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]
parent 760a3c0d
...@@ -114,7 +114,7 @@ struct opcode_key_t { ...@@ -114,7 +114,7 @@ struct opcode_key_t {
ir_entity *ent; /**< For Sel Nodes, its entity */ ir_entity *ent; /**< For Sel Nodes, its entity */
int intVal; /**< For Conv/Div Nodes: strict/remainderless */ int intVal; /**< For Conv/Div Nodes: strict/remainderless */
unsigned uintVal;/**< for Builtin: the kind */ 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 */ void *ptr; /**< generic pointer for hash/cmp */
} u; } u;
}; };
...@@ -310,7 +310,8 @@ static void check_opcode(const partition_t *Z) ...@@ -310,7 +310,8 @@ static void check_opcode(const partition_t *Z)
key.u.intVal = get_Div_no_remainder(irn); key.u.intVal = get_Div_no_remainder(irn);
break; break;
case iro_Block: case iro_Block:
key.u.block = irn; case iro_ASM:
key.u.irn = irn;
break; break;
case iro_Builtin: case iro_Builtin:
key.u.intVal = get_Builtin_kind(irn); key.u.intVal = get_Builtin_kind(irn);
...@@ -338,7 +339,8 @@ static void check_opcode(const partition_t *Z) ...@@ -338,7 +339,8 @@ static void check_opcode(const partition_t *Z)
assert(key.u.intVal == get_Div_no_remainder(irn)); assert(key.u.intVal == get_Div_no_remainder(irn));
break; break;
case iro_Block: case iro_Block:
assert(key.u.block == irn); case iro_ASM:
assert(key.u.irn == irn);
break; break;
case iro_Builtin: case iro_Builtin:
assert(key.u.intVal == (int)get_Builtin_kind(irn)); assert(key.u.intVal == (int)get_Builtin_kind(irn));
...@@ -1763,7 +1765,17 @@ static void *lambda_opcode(const node_t *node, environment_t *env) ...@@ -1763,7 +1765,17 @@ static void *lambda_opcode(const node_t *node, environment_t *env)
* We fix it by never letting blocks be congruent * We fix it by never letting blocks be congruent
* which cannot be detected by combo either. * 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; break;
case iro_Builtin: case iro_Builtin:
key.u.intVal = get_Builtin_kind(irn); key.u.intVal = get_Builtin_kind(irn);
......
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