diff options
author | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-02-13 01:55:37 +0000 |
---|---|---|
committer | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-02-13 01:55:37 +0000 |
commit | 85afca2d2a2079910420c66eb86d43d9628f3c39 (patch) | |
tree | 3d8ced1bf10347b4692e3a1210b4de3fd48c5e58 /gcc/stmt.c | |
parent | 275e0b851a75e5e68a4a74aaaa48b307d826fdbb (diff) | |
download | gcc-85afca2d2a2079910420c66eb86d43d9628f3c39.tar.gz |
PR middle-end/25724
* dojump.c (do_jump): Call do_compare_rtx_and_jump.
(do_jump_parts_zero_rtx): New function renamed from
do_jump_parts_equality_rtx. Made static. Add a mode argument.
(do_jump_parts_equality_rtx): New function split out from
do_jump_parts_equality. Old implementation renamed as above.
Call do_jump_parts_zero_rtx if either operand is zero.
(do_jump_parts_equality): Call do_jump_parts_equality_rtx to
do all of the heavy lifting.
(do_compare_rtx_and_jump): Handle multi-word comparisons by
calling either do_jump_by_parts_greater_rtx or
do_jump_by_parts_equality_rtx.
* expr.h (do_jump_by_parts_equality_rtx): Remove prototype.
* expmed.c (do_cmp_and_jump): Now multi-word optimization has
moved to do_compare_rtx_and_jump, call it directly.
* stmt.c (do_jump_if_equal): Remove static prototype. Add a
mode argument. Call do_compare_rtx_and_jump.
(emit_case_nodes): Update calls to do_jump_if_equal.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110906 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r-- | gcc/stmt.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c index 3bb4f42c2da..be192169e00 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -1,6 +1,6 @@ /* Expands front end tree to back end RTL for GCC Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, - 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GCC. @@ -112,7 +112,6 @@ static bool check_unique_operand_names (tree, tree); static char *resolve_operand_name_1 (char *, tree, tree); static void expand_null_return_1 (void); static void expand_value_return (rtx); -static void do_jump_if_equal (rtx, rtx, rtx, int); static int estimate_case_costs (case_node_ptr); static bool lshift_cheap_p (void); static int case_bit_test_cmp (const void *, const void *); @@ -2588,21 +2587,14 @@ expand_case (tree exp) free_temp_slots (); } -/* Generate code to jump to LABEL if OP1 and OP2 are equal. */ +/* Generate code to jump to LABEL if OP0 and OP1 are equal in mode MODE. */ static void -do_jump_if_equal (rtx op1, rtx op2, rtx label, int unsignedp) +do_jump_if_equal (enum machine_mode mode, rtx op0, rtx op1, rtx label, + int unsignedp) { - if (GET_CODE (op1) == CONST_INT && GET_CODE (op2) == CONST_INT) - { - if (op1 == op2) - emit_jump (label); - } - else - emit_cmp_and_jump_insns (op1, op2, EQ, NULL_RTX, - (GET_MODE (op1) == VOIDmode - ? GET_MODE (op2) : GET_MODE (op1)), - unsignedp, label); + do_compare_rtx_and_jump (op0, op1, EQ, unsignedp, mode, + NULL_RTX, NULL_RTX, label); } /* Not all case values are encountered equally. This function @@ -2954,7 +2946,7 @@ emit_case_nodes (rtx index, case_node_ptr node, rtx default_label, /* Node is single valued. First see if the index expression matches this node and then check our children, if any. */ - do_jump_if_equal (index, + do_jump_if_equal (mode, index, convert_modes (mode, imode, expand_normal (node->low), unsignedp), @@ -3007,7 +2999,7 @@ emit_case_nodes (rtx index, case_node_ptr node, rtx default_label, /* See if the value matches what the right hand side wants. */ - do_jump_if_equal (index, + do_jump_if_equal (mode, index, convert_modes (mode, imode, expand_normal (node->right->low), unsignedp), @@ -3016,7 +3008,7 @@ emit_case_nodes (rtx index, case_node_ptr node, rtx default_label, /* See if the value matches what the left hand side wants. */ - do_jump_if_equal (index, + do_jump_if_equal (mode, index, convert_modes (mode, imode, expand_normal (node->left->low), unsignedp), @@ -3082,7 +3074,7 @@ emit_case_nodes (rtx index, case_node_ptr node, rtx default_label, /* We cannot process node->right normally since we haven't ruled out the numbers less than this node's value. So handle node->right explicitly. */ - do_jump_if_equal (index, + do_jump_if_equal (mode, index, convert_modes (mode, imode, expand_normal (node->right->low), @@ -3113,7 +3105,7 @@ emit_case_nodes (rtx index, case_node_ptr node, rtx default_label, /* We cannot process node->left normally since we haven't ruled out the numbers less than this node's value. So handle node->left explicitly. */ - do_jump_if_equal (index, + do_jump_if_equal (mode, index, convert_modes (mode, imode, expand_normal (node->left->low), |