aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2009-04-07 12:48:16 +0000
committerPaolo Bonzini <bonzini@gcc.gnu.org>2009-04-07 12:48:16 +0000
commitd8e535fa827f53241eb8dae67b4165d56a7efced (patch)
tree002279d773fe7a3367ecd03c61b639cd6dc69d8b
parentc3c64f5002375ee8e8c6264b633abdfbb866184f (diff)
downloadgcc-d8e535fa827f53241eb8dae67b4165d56a7efced.zip
gcc-d8e535fa827f53241eb8dae67b4165d56a7efced.tar.gz
gcc-d8e535fa827f53241eb8dae67b4165d56a7efced.tar.bz2
expr.c (do_store_flag): Remove last argument.
2009-04-07 Paolo Bonzini <bonzini@gnu.org> * expr.c (do_store_flag): Remove last argument. Simplify code to avoid duplication of tests already done by can_compare_p. (expand_expr_real_1): Adjust caller. From-SVN: r145668
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/expr.c41
2 files changed, 9 insertions, 38 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 120dfc1..c01b7d9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2009-04-07 Paolo Bonzini <bonzini@gnu.org>
+ * expr.c (do_store_flag): Remove last argument. Simplify code
+ to avoid duplication of tests already done by can_compare_p.
+ (expand_expr_real_1): Adjust caller.
+
+2009-04-07 Paolo Bonzini <bonzini@gnu.org>
+
* optabs.c (can_compare_p): Test the predicate of a
cbranch and cstore pattern.
diff --git a/gcc/expr.c b/gcc/expr.c
index f25ec7b..5836e58 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -151,7 +151,7 @@ static int is_aligning_offset (const_tree, const_tree);
static void expand_operands (tree, tree, rtx, rtx*, rtx*,
enum expand_modifier);
static rtx reduce_to_bit_field_precision (rtx, rtx, tree);
-static rtx do_store_flag (tree, rtx, enum machine_mode, int);
+static rtx do_store_flag (tree, rtx, enum machine_mode);
#ifdef PUSH_ROUNDING
static void emit_single_push_insn (enum machine_mode, rtx, tree);
#endif
@@ -9024,7 +9024,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case LTGT_EXPR:
temp = do_store_flag (exp,
modifier != EXPAND_STACK_PARM ? target : NULL_RTX,
- tmode != VOIDmode ? tmode : mode, 0);
+ tmode != VOIDmode ? tmode : mode);
if (temp != 0)
return temp;
@@ -9679,9 +9679,6 @@ string_constant (tree arg, tree *ptr_offset)
If TARGET is nonzero, store the result there if convenient.
- If ONLY_CHEAP is nonzero, only do this if it is likely to be very
- cheap.
-
Return zero if there is no suitable set-flag instruction
available on this machine.
@@ -9694,7 +9691,7 @@ string_constant (tree arg, tree *ptr_offset)
set/jump/set sequence. */
static rtx
-do_store_flag (tree exp, rtx target, enum machine_mode mode, int only_cheap)
+do_store_flag (tree exp, rtx target, enum machine_mode mode)
{
enum rtx_code code;
tree arg0, arg1, type;
@@ -9703,7 +9700,6 @@ do_store_flag (tree exp, rtx target, enum machine_mode mode, int only_cheap)
int invert = 0;
int unsignedp;
rtx op0, op1;
- enum insn_code icode;
rtx subtarget = target;
rtx result, label;
@@ -9847,37 +9843,6 @@ do_store_flag (tree exp, rtx target, enum machine_mode mode, int only_cheap)
if (! can_compare_p (code, operand_mode, ccp_store_flag))
return 0;
- icode = setcc_gen_code[(int) code];
-
- if (icode == CODE_FOR_nothing)
- {
- enum machine_mode wmode;
-
- for (wmode = operand_mode;
- icode == CODE_FOR_nothing && wmode != VOIDmode;
- wmode = GET_MODE_WIDER_MODE (wmode))
- icode = optab_handler (cstore_optab, wmode)->insn_code;
- }
-
- if (icode == CODE_FOR_nothing
- || (only_cheap && insn_data[(int) icode].operand[0].mode != mode))
- {
- /* We can only do this if it is one of the special cases that
- can be handled without an scc insn. */
- if ((code == LT && integer_zerop (arg1))
- || (! only_cheap && code == GE && integer_zerop (arg1)))
- ;
- else if (! only_cheap && (code == NE || code == EQ)
- && TREE_CODE (type) != REAL_TYPE
- && ((optab_handler (abs_optab, operand_mode)->insn_code
- != CODE_FOR_nothing)
- || (optab_handler (ffs_optab, operand_mode)->insn_code
- != CODE_FOR_nothing)))
- ;
- else
- return 0;
- }
-
if (! get_subtarget (target)
|| GET_MODE (subtarget) != operand_mode)
subtarget = 0;