/* Optimize jump instructions, for GNU compiler.
- Copyright (C) 1987, 1988, 1989, 1991, 1992 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 89, 91, 92, 1993 Free Software Foundation, Inc.
This file is part of GNU CC.
&& XEXP (XEXP (dest, 0), 0) == stack_pointer_rtx))
break;
pushes++;
- if (total_pushed + GET_MODE_SIZE (SET_DEST (pbody))
+ if (total_pushed + GET_MODE_SIZE (GET_MODE (SET_DEST (pbody)))
> stack_adjust_amount)
break;
- total_pushed += GET_MODE_SIZE (SET_DEST (pbody));
+ total_pushed += GET_MODE_SIZE (GET_MODE (SET_DEST (pbody)));
}
/* Discard the amount pushed from the stack adjust;
&& GET_CODE (XEXP (dest, 0)) == POST_INC
&& XEXP (XEXP (dest, 0), 0) == stack_pointer_rtx))
break;
- total_pushed -= GET_MODE_SIZE (SET_DEST (pbody));
+ total_pushed -= GET_MODE_SIZE (GET_MODE (SET_DEST (pbody)));
/* If this push doesn't fully fit in the space
of the stack adjust that we deleted,
make another stack adjust here for what we
|| (temp3 = temp1,
((BRANCH_COST >= 2
&& temp2 == const0_rtx)
+#ifdef HAVE_conditional_move
+ || 1
+#endif
|| BRANCH_COST >= 3)))
/* INSN must either branch to the insn after TEMP or the insn
after TEMP must branch to the same place as INSN. */
|| ((INTVAL (temp2) & INTVAL (temp3)) == INTVAL (temp3)
&& (reversep = can_reverse_comparison_p (temp4,
insn)))))
+#ifdef HAVE_conditional_move
+ || 1
+#endif
|| BRANCH_COST >= 3)
#ifdef HAVE_cc0
/* If the previous insn sets CC0 and something else, we can't
1, OPTAB_WIDEN);
}
else if (normalizep != 1)
- target = expand_and (uval, target,
- (GET_CODE (target) == REG
- && ! preserve_subexpressions_p ()
- ? target : NULL_RTX));
+ {
+ /* We know that either CVAL or UVAL is zero. If
+ UVAL is zero, negate TARGET and `and' with CVAL.
+ Otherwise, `and' with UVAL. */
+ if (uval == const0_rtx)
+ {
+ target = expand_unop (GET_MODE (var), one_cmpl_optab,
+ target, NULL_RTX, 0);
+ uval = cval;
+ }
+
+ target = expand_and (uval, target,
+ (GET_CODE (target) == REG
+ && ! preserve_subexpressions_p ()
+ ? target : NULL_RTX));
+ }
emit_move_insn (var, target);
seq = get_insns ();
TEMP3 to the condition being tested.
TEMP4 to the earliest insn used to find the condition. */
- if (BRANCH_COST >= 2
+ if ((BRANCH_COST >= 2
+#ifdef HAVE_incscc
+ || HAVE_incscc
+#endif
+#ifdef HAVE_decscc
+ || HAVE_decscc
+#endif
+ )
&& ! reload_completed
&& this_is_condjump && ! this_is_simplejump
&& (temp = next_nonnote_insn (insn)) != 0
target = expand_binop (GET_MODE (temp2),
(XEXP (SET_SRC (temp1), 1) == const1_rtx
? add_optab : sub_optab),
- temp2, target, temp2, OPTAB_WIDEN);
+ temp2, target, temp2, 0, OPTAB_WIDEN);
if (target != 0)
{
pending equivalences. If nonzero, the expressions really aren't the
same. */
-static short *same_regs;
+static int *same_regs;
static int num_same_regs;
rtx b1op0, b1op1, b2op0, b2op1;
int changed = 1;
int i;
- short *all_reset;
+ int *all_reset;
/* Allocate register tables and quick-reset table. */
modified_regs = (char *) alloca (max_reg * sizeof (char));
- same_regs = (short *) alloca (max_reg * sizeof (short));
- all_reset = (short *) alloca (max_reg * sizeof (short));
+ same_regs = (int *) alloca (max_reg * sizeof (int));
+ all_reset = (int *) alloca (max_reg * sizeof (int));
for (i = 0; i < max_reg; i++)
all_reset[i] = -1;
bzero (modified_regs, max_reg * sizeof (char));
modified_mem = 0;
- bcopy (all_reset, same_regs, max_reg * sizeof (short));
+ bcopy (all_reset, same_regs, max_reg * sizeof (int));
num_same_regs = 0;
label = JUMP_LABEL (b1);