From 0345195ae65d06cc4ca867e1a2f8acdbf08d8e2c Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Fri, 20 Oct 2000 17:28:28 +0000 Subject: [PATCH] combine.c (struct undo): Change int to unsigned int. * combine.c (struct undo): Change int to unsigned int. (do_SUBST_INT): Args are unsigned int. (make_extraction, force_to_mode): Use proper type when forming mask. (make_field_assignment): Likewise. From-SVN: r36967 --- gcc/ChangeLog | 7 +++++++ gcc/combine.c | 24 ++++++++++++++---------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5a71796a0b5..06f53bc0f3d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +Fri Oct 20 13:33:16 2000 Richard Kenner + + * combine.c (struct undo): Change int to unsigned int. + (do_SUBST_INT): Args are unsigned int. + (make_extraction, force_to_mode): Use proper type when forming mask. + (make_field_assignment): Likewise. + 2000-10-20 Joseph S. Myers * c-common.c (check_format_info_recurse): Extract string constant diff --git a/gcc/combine.c b/gcc/combine.c index 03780ba976f..f381c142f64 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -330,8 +330,8 @@ struct undo { struct undo *next; int is_int; - union {rtx r; int i;} old_contents; - union {rtx *r; int *i;} where; + union {rtx r; unsigned int i;} old_contents; + union {rtx *r; unsigned int *i;} where; }; /* Record a bunch of changes to be undone, up to MAX_UNDO of them. @@ -361,7 +361,8 @@ static struct undobuf undobuf; static int n_occurrences; static void do_SUBST PARAMS ((rtx *, rtx)); -static void do_SUBST_INT PARAMS ((int *, int)); +static void do_SUBST_INT PARAMS ((unsigned int *, + unsigned int)); static void init_reg_last_arrays PARAMS ((void)); static void setup_incoming_promotions PARAMS ((void)); static void set_nonzero_bits_and_sign_copies PARAMS ((rtx, rtx, void *)); @@ -468,10 +469,10 @@ do_SUBST (into, newval) static void do_SUBST_INT (into, newval) - int *into, newval; + unsigned int *into, newval; { struct undo *buf; - int oldval = *into; + unsigned int oldval = *into; if (oldval == newval) return; @@ -6014,7 +6015,7 @@ make_extraction (mode, inner, pos, pos_rtx, len, else new = force_to_mode (inner, tmode, len >= HOST_BITS_PER_WIDE_INT - ? ~(HOST_WIDE_INT) 0 + ? ~(unsigned HOST_WIDE_INT) 0 : ((unsigned HOST_WIDE_INT) 1 << len) - 1, NULL_RTX, 0); @@ -6235,7 +6236,7 @@ make_extraction (mode, inner, pos, pos_rtx, len, inner = force_to_mode (inner, wanted_inner_mode, pos_rtx || len + orig_pos >= HOST_BITS_PER_WIDE_INT - ? ~(HOST_WIDE_INT) 0 + ? ~(unsigned HOST_WIDE_INT) 0 : ((((unsigned HOST_WIDE_INT) 1 << len) - 1) << orig_pos), NULL_RTX, 0); @@ -6902,7 +6903,9 @@ force_to_mode (x, mode, mask, reg, just_select) /* If X is (minus C Y) where C's least set bit is larger than any bit in the mask, then we may replace with (neg Y). */ if (GET_CODE (XEXP (x, 0)) == CONST_INT - && (INTVAL (XEXP (x, 0)) & -INTVAL (XEXP (x, 0))) > mask) + && (((unsigned HOST_WIDE_INT) (INTVAL (XEXP (x, 0)) + & -INTVAL (XEXP (x, 0)))) + > mask)) { x = gen_unary (NEG, GET_MODE (x), GET_MODE (x), XEXP (x, 1)); return force_to_mode (x, mode, mask, reg, next_select); @@ -6911,7 +6914,8 @@ force_to_mode (x, mode, mask, reg, just_select) /* Similarly, if C contains every bit in the mask, then we may replace with (not Y). */ if (GET_CODE (XEXP (x, 0)) == CONST_INT - && (INTVAL (XEXP (x, 0)) | mask) == INTVAL (XEXP (x, 0))) + && ((INTVAL (XEXP (x, 0)) | (HOST_WIDE_INT) mask) + == INTVAL (XEXP (x, 0)))) { x = gen_unary (NOT, GET_MODE (x), GET_MODE (x), XEXP (x, 1)); return force_to_mode (x, mode, mask, reg, next_select); @@ -7693,7 +7697,7 @@ make_field_assignment (x) GET_MODE (src), other, pos), mode, GET_MODE_BITSIZE (mode) >= HOST_BITS_PER_WIDE_INT - ? ~(HOST_WIDE_INT) 0 + ? ~(unsigned HOST_WIDE_INT) 0 : ((unsigned HOST_WIDE_INT) 1 << len) - 1, dest, 0); -- 2.30.2