For a TestJmp it is not necessary that the And has a constant as operand. Every kind...
authorChristoph Mallon <christoph.mallon@gmx.de>
Thu, 28 Jun 2007 20:35:42 +0000 (20:35 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Thu, 28 Jun 2007 20:35:42 +0000 (20:35 +0000)
[r14826]

ir/be/ia32/ia32_emitter.c
ir/be/ia32/ia32_transform.c

index ad6a9df..19c831e 100644 (file)
@@ -176,12 +176,14 @@ char get_mode_suffix(const ir_mode *mode) {
 
 static
 int produces_result(const ir_node *node) {
-       return !(is_ia32_St(node) ||
-               is_ia32_CondJmp(node) ||
-               is_ia32_xCondJmp(node) ||
-               is_ia32_CmpSet(node) ||
-               is_ia32_xCmpSet(node) ||
-               is_ia32_SwitchJmp(node));
+       return
+               !is_ia32_CmpSet(node)    &&
+               !is_ia32_CondJmp(node)   &&
+               !is_ia32_St(node)        &&
+               !is_ia32_SwitchJmp(node) &&
+               !is_ia32_TestJmp(node)   &&
+               !is_ia32_xCmpSet(node)   &&
+               !is_ia32_xCondJmp(node);
 }
 
 static
index bdeaf8c..592eaa1 100644 (file)
@@ -1787,8 +1787,6 @@ static ir_node *try_create_TestJmp(ir_node *node, long pnc)
 
        and_left  = get_And_left(cmp_a);
        and_right = get_And_right(cmp_a);
-       if(!is_Const(and_right))
-               return NULL;
 
        dbgi      = get_irn_dbg_info(node);
        block     = be_transform_node(get_nodes_block(node));
@@ -1796,8 +1794,8 @@ static ir_node *try_create_TestJmp(ir_node *node, long pnc)
        nomem     = new_NoMem();
        new_cmp_a = be_transform_node(and_left);
        new_cmp_b = try_create_Immediate(and_right, 0);
-       if(new_cmp_b == NULL)
-               panic("couldn't create immediate for TestJmp");
+       if (new_cmp_b == NULL)
+               new_cmp_b = be_transform_node(and_right);
 
        res = new_rd_ia32_TestJmp(dbgi, current_ir_graph, block, noreg, noreg,
                                  new_cmp_a, new_cmp_b, nomem, pnc);