#undef RTL_HOOKS_REG_NUM_SIGN_BIT_COPIES
#define RTL_HOOKS_REG_NUM_SIGN_BIT_COPIES reg_num_sign_bit_copies_for_combine
+#undef RTL_HOOKS_REG_TRUNCATED_TO_MODE
+#define RTL_HOOKS_REG_TRUNCATED_TO_MODE reg_truncated_to_mode
+
static const struct rtl_hooks combine_rtl_hooks = RTL_HOOKS_INITIALIZER;
\f
if (undobuf.frees)
buf = undobuf.frees, undobuf.frees = buf->next;
else
- buf = xmalloc (sizeof (struct undo));
+ buf = XNEW (struct undo);
buf->kind = UNDO_RTX;
buf->where.r = into;
if (undobuf.frees)
buf = undobuf.frees, undobuf.frees = buf->next;
else
- buf = xmalloc (sizeof (struct undo));
+ buf = XNEW (struct undo);
buf->kind = UNDO_INT;
buf->where.i = into;
if (undobuf.frees)
buf = undobuf.frees, undobuf.frees = buf->next;
else
- buf = xmalloc (sizeof (struct undo));
+ buf = XNEW (struct undo);
buf->kind = UNDO_MODE;
buf->where.r = into;
rtl_hooks = combine_rtl_hooks;
- reg_stat = xcalloc (nregs, sizeof (struct reg_stat));
+ reg_stat = XCNEWVEC (struct reg_stat, nregs);
init_recog_no_volatile ();
if (INSN_UID (insn) > i)
i = INSN_UID (insn);
- uid_cuid = xmalloc ((i + 1) * sizeof (int));
+ uid_cuid = XNEWVEC (int, i + 1);
max_uid_cuid = i;
nonzero_bits_mode = mode_for_size (HOST_BITS_PER_WIDE_INT, MODE_INT, 0);
sbitmap_zero (refresh_blocks);
/* Allocate array of current insn_rtx_costs. */
- uid_insn_cost = xcalloc (max_uid_cuid + 1, sizeof (int));
+ uid_insn_cost = XCNEWVEC (int, max_uid_cuid + 1);
last_insn_cost = max_uid_cuid;
for (insn = f, i = 0; insn; insn = NEXT_INSN (insn))
if (i3_subst_into_i2)
{
for (i = 0; i < XVECLEN (PATTERN (i2), 0); i++)
- if (GET_CODE (XVECEXP (PATTERN (i2), 0, i)) != USE
+ if ((GET_CODE (XVECEXP (PATTERN (i2), 0, i)) == SET
+ || GET_CODE (XVECEXP (PATTERN (i2), 0, i)) == CLOBBER)
&& REG_P (SET_DEST (XVECEXP (PATTERN (i2), 0, i)))
&& SET_DEST (XVECEXP (PATTERN (i2), 0, i)) != i2dest
&& ! find_reg_note (i2, REG_UNUSED,
|| orig_pos + len > GET_MODE_BITSIZE (wanted_inner_mode)))
return 0;
+ if (orig_pos < 0)
+ return 0;
+
inner = force_to_mode (inner, wanted_inner_mode,
pos_rtx
|| len + orig_pos >= HOST_BITS_PER_WIDE_INT
|| (REG_P (x) && reg_truncated_to_mode (mode, x)))
return gen_lowpart (mode, x);
else
- return gen_rtx_TRUNCATE (mode, x);
+ return simplify_gen_unary (TRUNCATE, mode, x, GET_MODE (x));
}
/* See if X can be simplified knowing that we will only refer to it in
&& INTVAL (XEXP (varop, 1)) >= 0
&& INTVAL (XEXP (varop, 1)) < GET_MODE_BITSIZE (GET_MODE (varop))
&& GET_MODE_BITSIZE (result_mode) <= HOST_BITS_PER_WIDE_INT
- && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT)
+ && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT
+ && !VECTOR_MODE_P (result_mode))
{
enum rtx_code first_code = GET_CODE (varop);
unsigned int first_count = INTVAL (XEXP (varop, 1));
}
/* Try combining insns through substitution. */
-static void
+static unsigned int
rest_of_handle_combine (void)
{
int rebuild_jump_labels_after_combine
delete_dead_jumptables ();
cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE);
}
+ return 0;
}
struct tree_opt_pass pass_combine =