From: Christoph Mallon Date: Thu, 28 Jun 2007 20:35:42 +0000 (+0000) Subject: For a TestJmp it is not necessary that the And has a constant as operand. Every kind... X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=f2c57dfbf40a16f44728e4e52e35dea933aefee1;p=libfirm For a TestJmp it is not necessary that the And has a constant as operand. Every kind of operand is ok. [r14826] --- diff --git a/ir/be/ia32/ia32_emitter.c b/ir/be/ia32/ia32_emitter.c index ad6a9df2d..19c831e01 100644 --- a/ir/be/ia32/ia32_emitter.c +++ b/ir/be/ia32/ia32_emitter.c @@ -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 diff --git a/ir/be/ia32/ia32_transform.c b/ir/be/ia32/ia32_transform.c index bdeaf8ceb..592eaa1b8 100644 --- a/ir/be/ia32/ia32_transform.c +++ b/ir/be/ia32/ia32_transform.c @@ -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);