From 906c4e36c6f418550a1040e1e61d989aa72f3b3c Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Mon, 6 Jul 1992 16:04:13 -0400 Subject: [PATCH] *** empty log message *** From-SVN: r1473 --- gcc/cse.c | 409 +++++++++++++++++++++++-------------------- gcc/dwarfout.c | 12 +- gcc/emit-rtl.c | 105 +++++------ gcc/expr.c | 441 +++++++++++++++++++++++------------------------ gcc/final.c | 72 +++++--- gcc/fold-const.c | 299 +++++++++++++++++--------------- gcc/gcc.c | 123 +++++++------ gcc/print-tree.c | 49 ++++-- 8 files changed, 820 insertions(+), 690 deletions(-) diff --git a/gcc/cse.c b/gcc/cse.c index ff1f772942e..dbb2f2209fd 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -326,7 +326,7 @@ static int cse_basic_block_end; The cuids are like uids but increase monotonically always. We use them to see whether a reg is used outside a given basic block. */ -static short *uid_cuid; +static int *uid_cuid; /* Get the cuid of an insn. */ @@ -863,7 +863,7 @@ mention_regs (x) { if (GET_CODE (XEXP (x, 0)) == REG && ! REGNO_QTY_VALID_P (REGNO (XEXP (x, 0)))) - if (insert_regs (XEXP (x, 0), 0, 0)) + if (insert_regs (XEXP (x, 0), NULL_PTR, 0)) { rehash_using_reg (XEXP (x, 0)); changed = 1; @@ -871,7 +871,7 @@ mention_regs (x) if (GET_CODE (XEXP (x, 1)) == REG && ! REGNO_QTY_VALID_P (REGNO (XEXP (x, 1)))) - if (insert_regs (XEXP (x, 1), 0, 0)) + if (insert_regs (XEXP (x, 1), NULL_PTR, 0)) { rehash_using_reg (XEXP (x, 1)); changed = 1; @@ -939,7 +939,7 @@ insert_regs (x, classp, modified) else if (GET_CODE (x) == SUBREG && GET_CODE (SUBREG_REG (x)) == REG && ! REGNO_QTY_VALID_P (REGNO (SUBREG_REG (x)))) { - insert_regs (SUBREG_REG (x), 0, 0); + insert_regs (SUBREG_REG (x), NULL_PTR, 0); mention_regs (SUBREG_REG (x)); return 1; } @@ -1297,7 +1297,7 @@ insert (x, classp, hash, mode) subhash = safe_hash (subexp, mode) % NBUCKETS; subelt = lookup (subexp, subhash, mode); if (subelt == 0) - subelt = insert (subexp, 0, subhash, mode); + subelt = insert (subexp, NULL_PTR, subhash, mode); /* Initialize SUBELT's circular chain if it has none. */ if (subelt->related_value == 0) subelt->related_value = subelt; @@ -1387,7 +1387,7 @@ invalidate (x) register int i; register struct table_elt *p; register rtx base; - register int start, end; + register HOST_WIDE_INT start, end; /* If X is a register, dependencies on its contents are recorded through the qty number mechanism. @@ -1527,7 +1527,7 @@ remove_invalid_refs (regno) { next = p->next_same_hash; if (GET_CODE (p->exp) != REG - && refers_to_regno_p (regno, regno + 1, p->exp, 0)) + && refers_to_regno_p (regno, regno + 1, p->exp, NULL_PTR)) remove_from_table (p, i); } } @@ -1675,7 +1675,7 @@ use_related_value (x, elt) { register struct table_elt *relt = 0; register struct table_elt *p, *q; - int offset; + HOST_WIDE_INT offset; /* First, is there anything related known? If we have a table element, we can tell from that. @@ -1952,7 +1952,7 @@ exp_equiv_p (x, y, validate, equal_values) int validate; int equal_values; { - register int i; + register int i, j; register enum rtx_code code; register char *fmt; @@ -2052,34 +2052,45 @@ exp_equiv_p (x, y, validate, equal_values) fmt = GET_RTX_FORMAT (code); for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) { - if (fmt[i] == 'e') + switch (fmt[i]) { + case 'e': if (! exp_equiv_p (XEXP (x, i), XEXP (y, i), validate, equal_values)) return 0; - } - else if (fmt[i] == 'E') - { - int j; + break; + + case 'E': if (XVECLEN (x, i) != XVECLEN (y, i)) return 0; for (j = 0; j < XVECLEN (x, i); j++) if (! exp_equiv_p (XVECEXP (x, i, j), XVECEXP (y, i, j), validate, equal_values)) return 0; - } - else if (fmt[i] == 's') - { + break; + + case 's': if (strcmp (XSTR (x, i), XSTR (y, i))) return 0; - } - else if (fmt[i] == 'i') - { + break; + + case 'i': if (XINT (x, i) != XINT (y, i)) return 0; + break; + + case 'w': + if (XWINT (x, i) != XWINT (y, i)) + return 0; + break; + + case '0': + break; + + default: + abort (); } - else if (fmt[i] != '0') - abort (); - } + } + return 1; } @@ -2152,9 +2163,9 @@ refers_to_p (x, y) int refers_to_mem_p (x, base, start, end) rtx x, base; - int start, end; + HOST_WIDE_INT start, end; { - register int i; + register HOST_WIDE_INT i; register enum rtx_code code; register char *fmt; @@ -2221,7 +2232,7 @@ refers_to_mem_p (x, base, start, end) if (GET_CODE (base) == PLUS && GET_CODE (XEXP (base, 1)) == CONST_INT) { - int tem = INTVAL (XEXP (base, 1)); + HOST_WIDE_INT tem = INTVAL (XEXP (base, 1)); start += tem; end += tem; base = XEXP (base, 0); @@ -2236,7 +2247,7 @@ refers_to_mem_p (x, base, start, end) if (GET_CODE (base) == PLUS && GET_CODE (XEXP (base, 1)) == CONST_INT) { - int tem = INTVAL (XEXP (base, 1)); + HOST_WIDE_INT tem = INTVAL (XEXP (base, 1)); start += tem; end += tem; base = XEXP (base, 0); @@ -2477,7 +2488,7 @@ find_best_addr (insn, loc) && (GET_CODE (elt->exp) == REG || exp_equiv_p (elt->exp, elt->exp, 1, 0)) && validate_change (insn, loc, - canon_reg (copy_rtx (elt->exp), 0), 0)) + canon_reg (copy_rtx (elt->exp), NULL_RTX), 0)) return; } #else @@ -2516,7 +2527,8 @@ find_best_addr (insn, loc) if (found_better) { if (validate_change (insn, loc, - canon_reg (copy_rtx (best_elt->exp), 0), 0)) + canon_reg (copy_rtx (best_elt->exp), + NULL_RTX), 0)) return; else best_elt->flag = 1; @@ -2593,7 +2605,8 @@ find_best_addr (insn, loc) if (found_better) { if (validate_change (insn, loc, - canon_reg (copy_rtx (best_rtx), 0), 0)) + canon_reg (copy_rtx (best_rtx), + NULL_RTX), 0)) return; else best_elt->flag = 1; @@ -2698,9 +2711,11 @@ find_comparison_args (code, parg1, parg2) || ((code == NE || (code == LT && GET_MODE_CLASS (inner_mode) == MODE_INT - && GET_MODE_BITSIZE (inner_mode) <= HOST_BITS_PER_INT + && (GET_MODE_BITSIZE (inner_mode) + <= HOST_BITS_PER_WIDE_INT) && (STORE_FLAG_VALUE - & (1 << (GET_MODE_BITSIZE (inner_mode) - 1)))) + & ((HOST_WIDE_INT) 1 + << (GET_MODE_BITSIZE (inner_mode) - 1)))) #ifdef FLOAT_STORE_FLAG_VALUE || (code == LT && GET_MODE_CLASS (inner_mode) == MODE_FLOAT @@ -2715,9 +2730,11 @@ find_comparison_args (code, parg1, parg2) else if ((code == EQ || (code == GE && GET_MODE_CLASS (inner_mode) == MODE_INT - && GET_MODE_BITSIZE (inner_mode) <= HOST_BITS_PER_INT + && (GET_MODE_BITSIZE (inner_mode) + <= HOST_BITS_PER_WIDE_INT) && (STORE_FLAG_VALUE - & (1 << (GET_MODE_BITSIZE (inner_mode) - 1)))) + & ((HOST_WIDE_INT) 1 + << (GET_MODE_BITSIZE (inner_mode) - 1)))) #ifdef FLOAT_STORE_FLAG_VALUE || (code == GE && GET_MODE_CLASS (inner_mode) == MODE_FLOAT @@ -2811,17 +2828,17 @@ simplify_unary_operation (code, mode, op, op_mode) if (CONST_DOUBLE_HIGH (op) < 0) { d = (double) (~ CONST_DOUBLE_HIGH (op)); - d *= ((double) (1 << (HOST_BITS_PER_INT / 2)) - * (double) (1 << (HOST_BITS_PER_INT / 2))); - d += (double) (unsigned) (~ CONST_DOUBLE_LOW (op)); + d *= ((double) ((HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2)) + * (double) ((HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2))); + d += (double) (unsigned HOST_WIDE_INT) (~ CONST_DOUBLE_LOW (op)); d = (- d - 1.0); } else { d = (double) CONST_DOUBLE_HIGH (op); - d *= ((double) (1 << (HOST_BITS_PER_INT / 2)) - * (double) (1 << (HOST_BITS_PER_INT / 2))); - d += (double) (unsigned) CONST_DOUBLE_LOW (op); + d *= ((double) ((HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2)) + * (double) ((HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2))); + d += (double) (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (op); } #endif /* REAL_ARITHMETIC */ return CONST_DOUBLE_FROM_REAL_VALUE (d, mode); @@ -2836,19 +2853,19 @@ simplify_unary_operation (code, mode, op, op_mode) CONST_DOUBLE_HIGH (op)); #else d = (double) CONST_DOUBLE_HIGH (op); - d *= ((double) (1 << (HOST_BITS_PER_INT / 2)) - * (double) (1 << (HOST_BITS_PER_INT / 2))); - d += (double) (unsigned) CONST_DOUBLE_LOW (op); + d *= ((double) ((HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2)) + * (double) ((HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2))); + d += (double) (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (op); #endif /* REAL_ARITHMETIC */ return CONST_DOUBLE_FROM_REAL_VALUE (d, mode); } #endif else if (GET_CODE (op) == CONST_INT - && width <= HOST_BITS_PER_INT && width > 0) + && width <= HOST_BITS_PER_WIDE_INT && width > 0) { - register int arg0 = INTVAL (op); - register int val; + register HOST_WIDE_INT arg0 = INTVAL (op); + register HOST_WIDE_INT val; switch (code) { @@ -2926,11 +2943,12 @@ simplify_unary_operation (code, mode, op, op_mode) unless they and our sign bit are all one. So we get either a reasonable negative value or a reasonable unsigned value for this mode. */ - if (width < HOST_BITS_PER_INT - && ((val & ((-1) << (width - 1))) != ((-1) << (width - 1)))) + if (width < HOST_BITS_PER_WIDE_INT + && ((val & ((HOST_WIDE_INT) (-1) << (width - 1))) + != ((HOST_WIDE_INT) (-1) << (width - 1)))) val &= (1 << width) - 1; - return gen_rtx (CONST_INT, VOIDmode, val); + return GEN_INT (val); } /* We can do some operations on integer CONST_DOUBLEs. Also allow @@ -2938,7 +2956,7 @@ simplify_unary_operation (code, mode, op, op_mode) else if (GET_MODE (op) == VOIDmode && (GET_CODE (op) == CONST_DOUBLE || GET_CODE (op) == CONST_INT)) { - int l1, h1, lv, hv; + HOST_WIDE_INT l1, h1, lv, hv; if (GET_CODE (op) == CONST_DOUBLE) l1 = CONST_DOUBLE_LOW (op), h1 = CONST_DOUBLE_HIGH (op); @@ -2966,21 +2984,21 @@ simplify_unary_operation (code, mode, op, op_mode) case FFS: hv = 0; if (l1 == 0) - lv = HOST_BITS_PER_INT + exact_log2 (h1 & (-h1)) + 1; + lv = HOST_BITS_PER_WIDE_INT + exact_log2 (h1 & (-h1)) + 1; else lv = exact_log2 (l1 & (-l1)) + 1; break; case TRUNCATE: - if (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_INT) - return gen_rtx (CONST_INT, VOIDmode, l1 & GET_MODE_MASK (mode)); + if (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT) + return GEN_INT (l1 & GET_MODE_MASK (mode)); else return 0; break; case ZERO_EXTEND: if (op_mode == VOIDmode - || GET_MODE_BITSIZE (op_mode) > HOST_BITS_PER_INT) + || GET_MODE_BITSIZE (op_mode) > HOST_BITS_PER_WIDE_INT) return 0; hv = 0; @@ -2989,16 +3007,17 @@ simplify_unary_operation (code, mode, op, op_mode) case SIGN_EXTEND: if (op_mode == VOIDmode - || GET_MODE_BITSIZE (op_mode) > HOST_BITS_PER_INT) + || GET_MODE_BITSIZE (op_mode) > HOST_BITS_PER_WIDE_INT) return 0; else { lv = l1 & GET_MODE_MASK (op_mode); - if (GET_MODE_BITSIZE (op_mode) < HOST_BITS_PER_INT - && (lv & (1 << (GET_MODE_BITSIZE (op_mode) - 1))) != 0) - lv -= 1 << GET_MODE_BITSIZE (op_mode); + if (GET_MODE_BITSIZE (op_mode) < HOST_BITS_PER_WIDE_INT + && (lv & ((HOST_WIDE_INT) 1 + << (GET_MODE_BITSIZE (op_mode) - 1))) != 0) + lv -= (HOST_WIDE_INT) 1 << GET_MODE_BITSIZE (op_mode); - hv = (lv < 0) ? ~0 : 0; + hv = (lv < 0) ? ~ (HOST_WIDE_INT) 0 : 0; } break; @@ -3065,16 +3084,16 @@ simplify_unary_operation (code, mode, op, op_mode) } x = immed_real_const_1 (d, mode); - set_float_handler (0); + set_float_handler (NULL_PTR); return x; } else if (GET_CODE (op) == CONST_DOUBLE && GET_MODE_CLASS (mode) == MODE_INT - && width <= HOST_BITS_PER_INT && width > 0) + && width <= HOST_BITS_PER_WIDE_INT && width > 0) { REAL_VALUE_TYPE d; jmp_buf handler; rtx x; - int val; + HOST_WIDE_INT val; if (setjmp (handler)) return 0; @@ -3097,17 +3116,18 @@ simplify_unary_operation (code, mode, op, op_mode) abort (); } - set_float_handler (0); + set_float_handler (NULL_PTR); /* Clear the bits that don't belong in our mode, unless they and our sign bit are all one. So we get either a reasonable negative value or a reasonable unsigned value for this mode. */ - if (width < HOST_BITS_PER_INT - && ((val & ((-1) << (width - 1))) != ((-1) << (width - 1)))) - val &= (1 << width) - 1; + if (width < HOST_BITS_PER_WIDE_INT + && ((val & ((HOST_WIDE_INT) (-1) << (width - 1))) + != ((HOST_WIDE_INT) (-1) << (width - 1)))) + val &= ((HOST_WIDE_INT) 1 << width) - 1; - return gen_rtx (CONST_INT, VOIDmode, val); + return GEN_INT (val); } #endif /* This was formerly used only for non-IEEE float. @@ -3155,8 +3175,8 @@ simplify_binary_operation (code, mode, op0, op1) enum machine_mode mode; rtx op0, op1; { - register int arg0, arg1, arg0s, arg1s; - int val; + register HOST_WIDE_INT arg0, arg1, arg0s, arg1s; + HOST_WIDE_INT val; int width = GET_MODE_BITSIZE (mode); /* Relational operations don't work here. We must know the mode @@ -3217,7 +3237,7 @@ simplify_binary_operation (code, mode, op0, op1) } #endif - set_float_handler (0); + set_float_handler (NULL_PTR); value = real_value_truncate (mode, value); return immed_real_const_1 (value, mode); } @@ -3227,7 +3247,7 @@ simplify_binary_operation (code, mode, op0, op1) && GET_CODE (op0) == CONST_DOUBLE && (GET_CODE (op1) == CONST_DOUBLE || GET_CODE (op1) == CONST_INT)) { - int l1, l2, h1, h2, lv, hv; + HOST_WIDE_INT l1, l2, h1, h2, lv, hv; l1 = CONST_DOUBLE_LOW (op0), h1 = CONST_DOUBLE_HIGH (op0); @@ -3271,30 +3291,40 @@ simplify_binary_operation (code, mode, op0, op1) break; case SMIN: - if (h1 < h2 || (h1 == h2 && (unsigned) l1 < (unsigned) l2)) + if (h1 < h2 + || (h1 == h2 + && ((unsigned HOST_WIDE_INT) l1 + < (unsigned HOST_WIDE_INT) l2))) lv = l1, hv = h1; else lv = l2, hv = h2; break; case SMAX: - if (h1 > h2 || (h1 == h2 && (unsigned) l1 > (unsigned) l2)) + if (h1 > h2 + || (h1 == h2 + && ((unsigned HOST_WIDE_INT) l1 + > (unsigned HOST_WIDE_INT) l2))) lv = l1, hv = h1; else lv = l2, hv = h2; break; case UMIN: - if ((unsigned) h1 < (unsigned) h2 - || (h1 == h2 && (unsigned) l1 < (unsigned) l2)) + if ((unsigned HOST_WIDE_INT) h1 < (unsigned HOST_WIDE_INT) h2 + || (h1 == h2 + && ((unsigned HOST_WIDE_INT) l1 + < (unsigned HOST_WIDE_INT) l2))) lv = l1, hv = h1; else lv = l2, hv = h2; break; case UMAX: - if ((unsigned) h1 > (unsigned) h2 - || (h1 == h2 && (unsigned) l1 > (unsigned) l2)) + if ((unsigned HOST_WIDE_INT) h1 > (unsigned HOST_WIDE_INT) h2 + || (h1 == h2 + && ((unsigned HOST_WIDE_INT) l1 + > (unsigned HOST_WIDE_INT) l2))) lv = l1, hv = h1; else lv = l2, hv = h2; @@ -3331,7 +3361,7 @@ simplify_binary_operation (code, mode, op0, op1) #endif /* not REAL_IS_NOT_DOUBLE, or REAL_ARITHMETIC */ if (GET_CODE (op0) != CONST_INT || GET_CODE (op1) != CONST_INT - || width > HOST_BITS_PER_INT || width == 0) + || width > HOST_BITS_PER_WIDE_INT || width == 0) { /* Even if we can't compute a constant result, there are some cases worth simplifying. */ @@ -3633,8 +3663,7 @@ simplify_binary_operation (code, mode, op0, op1) /* Convert multiply by constant power of two into shift. */ if (GET_CODE (op1) == CONST_INT && (val = exact_log2 (INTVAL (op1))) >= 0) - return gen_rtx (ASHIFT, mode, op0, - gen_rtx (CONST_INT, VOIDmode, val)); + return gen_rtx (ASHIFT, mode, op0, GEN_INT (val)); if (GET_CODE (op1) == CONST_DOUBLE && GET_MODE_CLASS (GET_MODE (op1)) == MODE_FLOAT) @@ -3698,8 +3727,7 @@ simplify_binary_operation (code, mode, op0, op1) below). */ if (GET_CODE (op1) == CONST_INT && (arg1 = exact_log2 (INTVAL (op1))) > 0) - return gen_rtx (LSHIFTRT, mode, op0, - gen_rtx (CONST_INT, VOIDmode, arg1)); + return gen_rtx (LSHIFTRT, mode, op0, GEN_INT (arg1)); /* ... fall through ... */ @@ -3737,8 +3765,7 @@ simplify_binary_operation (code, mode, op0, op1) /* Handle modulus by power of two (mod with 1 handled below). */ if (GET_CODE (op1) == CONST_INT && exact_log2 (INTVAL (op1)) > 0) - return gen_rtx (AND, mode, op0, - gen_rtx (CONST_INT, VOIDmode, INTVAL (op1) - 1)); + return gen_rtx (AND, mode, op0, GEN_INT (INTVAL (op1) - 1)); /* ... fall through ... */ @@ -3751,7 +3778,7 @@ simplify_binary_operation (code, mode, op0, op1) case ROTATERT: case ROTATE: /* Rotating ~0 always results in ~0. */ - if (GET_CODE (op0) == CONST_INT && width <= HOST_BITS_PER_INT + if (GET_CODE (op0) == CONST_INT && width <= HOST_BITS_PER_WIDE_INT && INTVAL (op0) == GET_MODE_MASK (mode) && ! side_effects_p (op1)) return op0; @@ -3769,8 +3796,8 @@ simplify_binary_operation (code, mode, op0, op1) break; case SMIN: - if (width <= HOST_BITS_PER_INT && GET_CODE (op1) == CONST_INT - && INTVAL (op1) == 1 << (width -1) + if (width <= HOST_BITS_PER_WIDE_INT && GET_CODE (op1) == CONST_INT + && INTVAL (op1) == (HOST_WIDE_INT) 1 << (width -1) && ! side_effects_p (op0)) return op1; else if (rtx_equal_p (op0, op1) && ! side_effects_p (op0)) @@ -3778,7 +3805,7 @@ simplify_binary_operation (code, mode, op0, op1) break; case SMAX: - if (width <= HOST_BITS_PER_INT && GET_CODE (op1) == CONST_INT + if (width <= HOST_BITS_PER_WIDE_INT && GET_CODE (op1) == CONST_INT && INTVAL (op1) == GET_MODE_MASK (mode) >> 1 && ! side_effects_p (op0)) return op1; @@ -3813,18 +3840,18 @@ simplify_binary_operation (code, mode, op0, op1) arg0 = INTVAL (op0); arg1 = INTVAL (op1); - if (width < HOST_BITS_PER_INT) + if (width < HOST_BITS_PER_WIDE_INT) { - arg0 &= (1 << width) - 1; - arg1 &= (1 << width) - 1; + arg0 &= ((HOST_WIDE_INT) 1 << width) - 1; + arg1 &= ((HOST_WIDE_INT) 1 << width) - 1; arg0s = arg0; - if (arg0s & (1 << (width - 1))) - arg0s |= ((-1) << width); + if (arg0s & ((HOST_WIDE_INT) 1 << (width - 1))) + arg0s |= ((HOST_WIDE_INT) (-1) << width); arg1s = arg1; - if (arg1s & (1 << (width - 1))) - arg1s |= ((-1) << width); + if (arg1s & ((HOST_WIDE_INT) 1 << (width - 1))) + arg1s |= ((HOST_WIDE_INT) (-1) << width); } else { @@ -3863,13 +3890,13 @@ simplify_binary_operation (code, mode, op0, op1) case UDIV: if (arg1 == 0) return 0; - val = (unsigned) arg0 / arg1; + val = (unsigned HOST_WIDE_INT) arg0 / arg1; break; case UMOD: if (arg1 == 0) return 0; - val = (unsigned) arg0 % arg1; + val = (unsigned HOST_WIDE_INT) arg0 % arg1; break; case AND: @@ -3897,7 +3924,7 @@ simplify_binary_operation (code, mode, op0, op1) if (arg1 >= width) return 0; - val = ((unsigned) arg0) >> arg1; + val = ((unsigned HOST_WIDE_INT) arg0) >> arg1; break; case ASHIFT: @@ -3912,7 +3939,7 @@ simplify_binary_operation (code, mode, op0, op1) if (arg1 >= width) return 0; - val = ((unsigned) arg0) << arg1; + val = ((unsigned HOST_WIDE_INT) arg0) << arg1; break; case ASHIFTRT: @@ -3934,8 +3961,8 @@ simplify_binary_operation (code, mode, op0, op1) return 0; arg1 %= width; - val = ((((unsigned) arg0) << (width - arg1)) - | (((unsigned) arg0) >> arg1)); + val = ((((unsigned HOST_WIDE_INT) arg0) << (width - arg1)) + | (((unsigned HOST_WIDE_INT) arg0) >> arg1)); break; case ROTATE: @@ -3943,8 +3970,8 @@ simplify_binary_operation (code, mode, op0, op1) return 0; arg1 %= width; - val = ((((unsigned) arg0) << arg1) - | (((unsigned) arg0) >> (width - arg1))); + val = ((((unsigned HOST_WIDE_INT) arg0) << arg1) + | (((unsigned HOST_WIDE_INT) arg0) >> (width - arg1))); break; case COMPARE: @@ -3956,7 +3983,8 @@ simplify_binary_operation (code, mode, op0, op1) break; case UMIN: - val = (unsigned int)arg0 <= (unsigned int)arg1 ? arg0 : arg1; + val = ((unsigned HOST_WIDE_INT) arg0 + <= (unsigned HOST_WIDE_INT) arg1 ? arg0 : arg1); break; case SMAX: @@ -3964,7 +3992,8 @@ simplify_binary_operation (code, mode, op0, op1) break; case UMAX: - val = (unsigned int)arg0 > (unsigned int)arg1 ? arg0 : arg1; + val = ((unsigned HOST_WIDE_INT) arg0 + > (unsigned HOST_WIDE_INT) arg1 ? arg0 : arg1); break; default: @@ -3974,11 +4003,12 @@ simplify_binary_operation (code, mode, op0, op1) /* Clear the bits that don't belong in our mode, unless they and our sign bit are all one. So we get either a reasonable negative value or a reasonable unsigned value for this mode. */ - if (width < HOST_BITS_PER_INT - && ((val & ((-1) << (width - 1))) != ((-1) << (width - 1)))) - val &= (1 << width) - 1; - - return gen_rtx (CONST_INT, VOIDmode, val); + if (width < HOST_BITS_PER_WIDE_INT + && ((val & ((HOST_WIDE_INT) (-1) << (width - 1))) + != ((HOST_WIDE_INT) (-1) << (width - 1)))) + val &= ((HOST_WIDE_INT) 1 << width) - 1; + + return GEN_INT (val); } /* Like simplify_binary_operation except used for relational operators. @@ -3990,8 +4020,8 @@ simplify_relational_operation (code, mode, op0, op1) enum machine_mode mode; rtx op0, op1; { - register int arg0, arg1, arg0s, arg1s; - int val; + register HOST_WIDE_INT arg0, arg1, arg0s, arg1s; + HOST_WIDE_INT val; int width = GET_MODE_BITSIZE (mode); /* If op0 is a compare, extract the comparison arguments from it. */ @@ -3999,7 +4029,7 @@ simplify_relational_operation (code, mode, op0, op1) op1 = XEXP (op0, 1), op0 = XEXP (op0, 0); if (GET_CODE (op0) != CONST_INT || GET_CODE (op1) != CONST_INT - || width > HOST_BITS_PER_INT || width == 0) + || width > HOST_BITS_PER_WIDE_INT || width == 0) { /* Even if we can't compute a constant result, there are some cases worth simplifying. */ @@ -4016,7 +4046,6 @@ simplify_relational_operation (code, mode, op0, op1) && GET_MODE_CLASS (GET_MODE (op0)) == MODE_FLOAT) { REAL_VALUE_TYPE d0, d1; - int value; jmp_buf handler; int op0lt, op1lt, equal; @@ -4029,7 +4058,7 @@ simplify_relational_operation (code, mode, op0, op1) equal = REAL_VALUES_EQUAL (d0, d1); op0lt = REAL_VALUES_LESS (d0, d1); op1lt = REAL_VALUES_LESS (d1, d0); - set_float_handler (0); + set_float_handler (NULL_PTR); switch (code) { @@ -4116,18 +4145,18 @@ simplify_relational_operation (code, mode, op0, op1) arg0 = INTVAL (op0); arg1 = INTVAL (op1); - if (width < HOST_BITS_PER_INT) + if (width < HOST_BITS_PER_WIDE_INT) { - arg0 &= (1 << width) - 1; - arg1 &= (1 << width) - 1; + arg0 &= ((HOST_WIDE_INT) 1 << width) - 1; + arg1 &= ((HOST_WIDE_INT) 1 << width) - 1; arg0s = arg0; - if (arg0s & (1 << (width - 1))) - arg0s |= ((-1) << width); + if (arg0s & ((HOST_WIDE_INT) 1 << (width - 1))) + arg0s |= ((HOST_WIDE_INT) (-1) << width); arg1s = arg1; - if (arg1s & (1 << (width - 1))) - arg1s |= ((-1) << width); + if (arg1s & ((HOST_WIDE_INT) 1 << (width - 1))) + arg1s |= ((HOST_WIDE_INT) (-1) << width); } else { @@ -4164,19 +4193,23 @@ simplify_relational_operation (code, mode, op0, op1) break; case LEU: - val = ((unsigned) arg0) <= ((unsigned) arg1) ? STORE_FLAG_VALUE : 0; + val = (((unsigned HOST_WIDE_INT) arg0) + <= ((unsigned HOST_WIDE_INT) arg1) ? STORE_FLAG_VALUE : 0); break; case LTU: - val = ((unsigned) arg0) < ((unsigned) arg1) ? STORE_FLAG_VALUE : 0; + val = (((unsigned HOST_WIDE_INT) arg0) + < ((unsigned HOST_WIDE_INT) arg1) ? STORE_FLAG_VALUE : 0); break; case GEU: - val = ((unsigned) arg0) >= ((unsigned) arg1) ? STORE_FLAG_VALUE : 0; + val = (((unsigned HOST_WIDE_INT) arg0) + >= ((unsigned HOST_WIDE_INT) arg1) ? STORE_FLAG_VALUE : 0); break; case GTU: - val = ((unsigned) arg0) > ((unsigned) arg1) ? STORE_FLAG_VALUE : 0; + val = (((unsigned HOST_WIDE_INT) arg0) + > ((unsigned HOST_WIDE_INT) arg1) ? STORE_FLAG_VALUE : 0); break; default: @@ -4186,11 +4219,12 @@ simplify_relational_operation (code, mode, op0, op1) /* Clear the bits that don't belong in our mode, unless they and our sign bit are all one. So we get either a reasonable negative value or a reasonable unsigned value for this mode. */ - if (width < HOST_BITS_PER_INT - && ((val & ((-1) << (width - 1))) != ((-1) << (width - 1)))) - val &= (1 << width) - 1; + if (width < HOST_BITS_PER_WIDE_INT + && ((val & ((HOST_WIDE_INT) (-1) << (width - 1))) + != ((HOST_WIDE_INT) (-1) << (width - 1)))) + val &= ((HOST_WIDE_INT) 1 << width) - 1; - return gen_rtx (CONST_INT, VOIDmode, val); + return GEN_INT (val); } /* Simplify CODE, an operation with result mode MODE and three operands, @@ -4207,7 +4241,7 @@ simplify_ternary_operation (code, mode, op0_mode, op0, op1, op2) /* VOIDmode means "infinite" precision. */ if (width == 0) - width = HOST_BITS_PER_INT; + width = HOST_BITS_PER_WIDE_INT; switch (code) { @@ -4217,34 +4251,36 @@ simplify_ternary_operation (code, mode, op0_mode, op0, op1, op2) && GET_CODE (op1) == CONST_INT && GET_CODE (op2) == CONST_INT && INTVAL (op1) + INTVAL (op2) <= GET_MODE_BITSIZE (op0_mode) - && width <= HOST_BITS_PER_INT) + && width <= HOST_BITS_PER_WIDE_INT) { /* Extracting a bit-field from a constant */ - int val = INTVAL (op0); + HOST_WIDE_INT val = INTVAL (op0); #if BITS_BIG_ENDIAN val >>= (GET_MODE_BITSIZE (op0_mode) - INTVAL (op2) - INTVAL (op1)); #else val >>= INTVAL (op2); #endif - if (HOST_BITS_PER_INT != INTVAL (op1)) + if (HOST_BITS_PER_WIDE_INT != INTVAL (op1)) { /* First zero-extend. */ - val &= (1 << INTVAL (op1)) - 1; + val &= ((HOST_WIDE_INT) 1 << INTVAL (op1)) - 1; /* If desired, propagate sign bit. */ - if (code == SIGN_EXTRACT && (val & (1 << (INTVAL (op1) - 1)))) - val |= ~ ((1 << INTVAL (op1)) - 1); + if (code == SIGN_EXTRACT + && (val & ((HOST_WIDE_INT) 1 << (INTVAL (op1) - 1)))) + val |= ~ (((HOST_WIDE_INT) 1 << INTVAL (op1)) - 1); } /* Clear the bits that don't belong in our mode, unless they and our sign bit are all one. So we get either a reasonable negative value or a reasonable unsigned value for this mode. */ - if (width < HOST_BITS_PER_INT - && ((val & ((-1) << (width - 1))) != ((-1) << (width - 1)))) - val &= (1 << width) - 1; + if (width < HOST_BITS_PER_WIDE_INT + && ((val & ((HOST_WIDE_INT) (-1) << (width - 1))) + != ((HOST_WIDE_INT) (-1) << (width - 1)))) + val &= ((HOST_WIDE_INT) 1 << width) - 1; - return gen_rtx (CONST_INT, VOIDmode, val); + return GEN_INT (val); } break; @@ -4281,7 +4317,7 @@ fold_rtx (x, insn) register enum rtx_code code; register enum machine_mode mode; register char *fmt; - register int i, val; + register int i; rtx new = 0; int copied = 0; int must_swap = 0; @@ -4367,7 +4403,7 @@ fold_rtx (x, insn) elt; elt = elt->next_same_value) if (GET_CODE (elt->exp) == SUBREG && GET_MODE (SUBREG_REG (elt->exp)) == mode - && exp_equiv_p (elt->exp, elt->exp, 1)) + && exp_equiv_p (elt->exp, elt->exp, 1, 0)) return copy_rtx (SUBREG_REG (elt->exp)); } @@ -4439,7 +4475,7 @@ fold_rtx (x, insn) rtx op0 = SUBREG_REG (XEXP (elt->exp, 0)); if (GET_CODE (op0) != REG && ! CONSTANT_P (op0)) - op0 = fold_rtx (op0, 0); + op0 = fold_rtx (op0, NULL_RTX); op0 = equiv_constant (op0); if (op0) @@ -4461,13 +4497,13 @@ fold_rtx (x, insn) rtx op1 = gen_lowpart_common (mode, XEXP (elt->exp, 1)); if (op0 && GET_CODE (op0) != REG && ! CONSTANT_P (op0)) - op0 = fold_rtx (op0, 0); + op0 = fold_rtx (op0, NULL_RTX); if (op0) op0 = equiv_constant (op0); if (op1 && GET_CODE (op1) != REG && ! CONSTANT_P (op1)) - op1 = fold_rtx (op1, 0); + op1 = fold_rtx (op1, NULL_RTX); if (op1) op1 = equiv_constant (op1); @@ -4481,7 +4517,7 @@ fold_rtx (x, insn) && GET_MODE (SUBREG_REG (elt->exp)) == mode && (GET_MODE_SIZE (GET_MODE (folded_arg0)) <= UNITS_PER_WORD) - && exp_equiv_p (elt->exp, elt->exp, 1)) + && exp_equiv_p (elt->exp, elt->exp, 1, 0)) new = copy_rtx (SUBREG_REG (elt->exp)); if (new) @@ -4510,9 +4546,9 @@ fold_rtx (x, insn) { /* Even if we don't fold in the insn itself, we can safely do so here, in hopes of getting a constant. */ - rtx addr = fold_rtx (XEXP (x, 0), 0); + rtx addr = fold_rtx (XEXP (x, 0), NULL_RTX); rtx base = 0; - int offset = 0; + HOST_WIDE_INT offset = 0; if (GET_CODE (addr) == REG && REGNO_QTY_VALID_P (REGNO (addr)) @@ -4912,8 +4948,9 @@ fold_rtx (x, insn) && INTVAL (inner_const) != 0) { int sign_bitnum = GET_MODE_BITSIZE (mode_arg0) - 1; - int has_sign = (HOST_BITS_PER_INT >= sign_bitnum - && (INTVAL (inner_const) & (1 << sign_bitnum))); + int has_sign = (HOST_BITS_PER_WIDE_INT >= sign_bitnum + && (INTVAL (inner_const) + & ((HOST_WIDE_INT) 1 << sign_bitnum))); rtx true = const_true_rtx, false = const0_rtx; #ifdef FLOAT_STORE_FLAG_VALUE @@ -5110,7 +5147,7 @@ equiv_constant (x) { struct table_elt *elt; - x = fold_rtx (x, 0); + x = fold_rtx (x, NULL_RTX); if (CONSTANT_P (x)) return x; @@ -5340,13 +5377,13 @@ record_jump_cond (code, mode, op0, op1, reversed_nonequality) new quantity number. */ if (op0_elt == 0) { - if (insert_regs (op0, 0, 0)) + if (insert_regs (op0, NULL_PTR, 0)) { rehash_using_reg (op0); op0_hash_code = HASH (op0, mode); } - op0_elt = insert (op0, 0, op0_hash_code, mode); + op0_elt = insert (op0, NULL_PTR, op0_hash_code, mode); op0_elt->in_memory = op0_in_memory; op0_elt->in_struct = op0_in_struct; } @@ -5357,13 +5394,13 @@ record_jump_cond (code, mode, op0, op1, reversed_nonequality) /* Put OP1 in the hash table so it gets a new quantity number. */ if (op1_elt == 0) { - if (insert_regs (op1, 0, 0)) + if (insert_regs (op1, NULL_PTR, 0)) { rehash_using_reg (op1); op1_hash_code = HASH (op1, mode); } - op1_elt = insert (op1, 0, op1_hash_code, mode); + op1_elt = insert (op1, NULL_PTR, op1_hash_code, mode); op1_elt->in_memory = op1_in_memory; op1_elt->in_struct = op1_in_struct; } @@ -5580,14 +5617,14 @@ cse_insn (insn, in_libcall_block) because we have already invalidated the reg. */ if (GET_CODE (XEXP (y, 0)) == MEM) { - canon_reg (XEXP (y, 0), 0); + canon_reg (XEXP (y, 0), NULL_RTX); note_mem_written (XEXP (y, 0), &writes_memory); } } else if (GET_CODE (y) == USE && ! (GET_CODE (XEXP (y, 0)) == REG && REGNO (XEXP (y, 0)) < FIRST_PSEUDO_REGISTER)) - canon_reg (y, 0); + canon_reg (y, NULL_RTX); else if (GET_CODE (y) == CALL) { canon_reg (y, insn); @@ -5600,7 +5637,7 @@ cse_insn (insn, in_libcall_block) { if (GET_CODE (XEXP (x, 0)) == MEM) { - canon_reg (XEXP (x, 0), 0); + canon_reg (XEXP (x, 0), NULL_RTX); note_mem_written (XEXP (x, 0), &writes_memory); } } @@ -5609,7 +5646,7 @@ cse_insn (insn, in_libcall_block) else if (GET_CODE (x) == USE && ! (GET_CODE (XEXP (x, 0)) == REG && REGNO (XEXP (x, 0)) < FIRST_PSEUDO_REGISTER)) - canon_reg (XEXP (x, 0), 0); + canon_reg (XEXP (x, 0), NULL_RTX); else if (GET_CODE (x) == CALL) { canon_reg (x, insn); @@ -5620,10 +5657,10 @@ cse_insn (insn, in_libcall_block) if (n_sets == 1 && REG_NOTES (insn) != 0) { /* Store the equivalent value in SRC_EQV, if different. */ - rtx tem = find_reg_note (insn, REG_EQUAL, 0); + rtx tem = find_reg_note (insn, REG_EQUAL, NULL_RTX); if (tem && ! rtx_equal_p (XEXP (tem, 0), SET_SRC (sets[0].rtl))) - src_eqv = canon_reg (XEXP (tem, 0), 0); + src_eqv = canon_reg (XEXP (tem, 0), NULL_RTX); } /* Canonicalize sources and addresses of destinations. @@ -5750,10 +5787,11 @@ cse_insn (insn, in_libcall_block) if (GET_CODE (src) == CONST_INT && GET_CODE (width) == CONST_INT - && INTVAL (width) < HOST_BITS_PER_INT - && (INTVAL (src) & ((-1) << INTVAL (width)))) - src_folded = gen_rtx (CONST_INT, VOIDmode, - INTVAL (src) & ((1 << INTVAL (width)) - 1)); + && INTVAL (width) < HOST_BITS_PER_WIDE_INT + && (INTVAL (src) & ((HOST_WIDE_INT) (-1) << INTVAL (width)))) + src_folded + = GEN_INT (INTVAL (src) & (((HOST_WIDE_INT) 1 + << INTVAL (width)) - 1)); } /* Compute SRC's hash code, and also notice if it @@ -5932,7 +5970,7 @@ cse_insn (insn, in_libcall_block) && GET_MODE_SIZE (mode) < UNITS_PER_WORD) { enum machine_mode tmode; - rtx new_and = gen_rtx (AND, VOIDmode, 0, XEXP (src, 1)); + rtx new_and = gen_rtx (AND, VOIDmode, NULL_RTX, XEXP (src, 1)); for (tmode = GET_MODE_WIDER_MODE (mode); GET_MODE_SIZE (tmode) <= UNITS_PER_WORD; @@ -6202,7 +6240,7 @@ cse_insn (insn, in_libcall_block) if (n_sets == 1 && src_const && GET_CODE (dest) == REG && GET_CODE (src_const) != REG) { - rtx tem = find_reg_note (insn, REG_EQUAL, 0); + rtx tem = find_reg_note (insn, REG_EQUAL, NULL_RTX); /* Record the actual constant value in a REG_EQUAL note, making a new one if one does not already exist. */ @@ -6227,7 +6265,7 @@ cse_insn (insn, in_libcall_block) && qty_const[reg_qty[REGNO (dest)]] == const0_rtx) { /* See if we previously had a REG_WAS_0 note. */ - rtx note = find_reg_note (insn, REG_WAS_0, 0); + rtx note = find_reg_note (insn, REG_WAS_0, NULL_RTX); rtx const_insn = qty_const_insn[reg_qty[REGNO (dest)]]; if ((tem = single_set (const_insn)) != 0 @@ -6287,8 +6325,9 @@ cse_insn (insn, in_libcall_block) if (src_const != 0 && GET_CODE (src_const) == CONST_INT && GET_CODE (width) == CONST_INT - && INTVAL (width) < HOST_BITS_PER_INT - && ! (INTVAL (src_const) & ((-1) << INTVAL (width)))) + && INTVAL (width) < HOST_BITS_PER_WIDE_INT + && ! (INTVAL (src_const) + & ((HOST_WIDE_INT) (-1) << INTVAL (width)))) /* Exception: if the value is constant, and it won't be truncated, record it. */ ; @@ -6696,7 +6735,7 @@ cse_insn (insn, in_libcall_block) && SET_DEST (PATTERN (prev)) == SET_SRC (sets[0].rtl)) { rtx dest = SET_DEST (sets[0].rtl); - rtx note = find_reg_note (prev, REG_EQUIV, 0); + rtx note = find_reg_note (prev, REG_EQUIV, NULL_RTX); validate_change (prev, & SET_DEST (PATTERN (prev)), dest, 1); validate_change (insn, & SET_DEST (sets[0].rtl), @@ -6710,11 +6749,11 @@ cse_insn (insn, in_libcall_block) /* If there was a REG_WAS_0 note on PREV, remove it. Move any REG_WAS_0 note on INSN to PREV. */ - note = find_reg_note (prev, REG_WAS_0, 0); + note = find_reg_note (prev, REG_WAS_0, NULL_RTX); if (note) remove_note (prev, note); - note = find_reg_note (insn, REG_WAS_0, 0); + note = find_reg_note (insn, REG_WAS_0, NULL_RTX); if (note) { remove_note (insn, note); @@ -6889,9 +6928,9 @@ cse_process_notes (x, object) case EXPR_LIST: case INSN_LIST: if (REG_NOTE_KIND (x) == REG_EQUAL) - XEXP (x, 0) = cse_process_notes (XEXP (x, 0), 0); + XEXP (x, 0) = cse_process_notes (XEXP (x, 0), NULL_RTX); if (XEXP (x, 1)) - XEXP (x, 1) = cse_process_notes (XEXP (x, 1), 0); + XEXP (x, 1) = cse_process_notes (XEXP (x, 1), NULL_RTX); return x; case SIGN_EXTEND: @@ -6920,13 +6959,13 @@ cse_process_notes (x, object) } /* Otherwise, canonicalize this register. */ - return canon_reg (x, 0); + return canon_reg (x, NULL_RTX); } for (i = 0; i < GET_RTX_LENGTH (code); i++) if (fmt[i] == 'e') validate_change (object, &XEXP (x, i), - cse_process_notes (XEXP (x, i), object), 0); + cse_process_notes (XEXP (x, i), object), NULL_RTX); return x; } @@ -7478,8 +7517,8 @@ cse_main (f, nregs, after_loop, file) /* Find the largest uid. */ i = get_max_uid (); - uid_cuid = (short *) alloca ((i + 1) * sizeof (short)); - bzero (uid_cuid, (i + 1) * sizeof (short)); + uid_cuid = (int *) alloca ((i + 1) * sizeof (int)); + bzero (uid_cuid, (i + 1) * sizeof (int)); /* Compute the mapping from uids to cuids. CUIDs are numbers assigned to insns, like uids, @@ -7678,7 +7717,7 @@ cse_basic_block (from, to, next_branch, around_loop) looking for duplicate operations. */ if (REG_NOTES (insn)) - REG_NOTES (insn) = cse_process_notes (REG_NOTES (insn), 0); + REG_NOTES (insn) = cse_process_notes (REG_NOTES (insn), NULL_RTX); /* Track when we are inside in LIBCALL block. Inside such a block, we do not want to record destinations. The last insn of a @@ -7686,9 +7725,9 @@ cse_basic_block (from, to, next_branch, around_loop) its destination is the result of the block and hence should be recorded. */ - if (find_reg_note (insn, REG_LIBCALL, 0)) + if (find_reg_note (insn, REG_LIBCALL, NULL_RTX)) in_libcall_block = 1; - else if (find_reg_note (insn, REG_RETVAL, 0)) + else if (find_reg_note (insn, REG_RETVAL, NULL_RTX)) in_libcall_block = 0; cse_insn (insn, in_libcall_block); @@ -7893,7 +7932,7 @@ delete_dead_from_cse (insns, nreg) /* Don't delete any insns that are part of a libcall block. Flow or loop might get confused if we did that. Remember that we are scanning backwards. */ - if (find_reg_note (insn, REG_RETVAL, 0)) + if (find_reg_note (insn, REG_RETVAL, NULL_RTX)) in_libcall = 1; if (in_libcall) @@ -7958,7 +7997,7 @@ delete_dead_from_cse (insns, nreg) delete_insn (insn); } - if (find_reg_note (insn, REG_LIBCALL, 0)) + if (find_reg_note (insn, REG_LIBCALL, NULL_RTX)) in_libcall = 0; } } diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c index 4000b7a1440..75080a9b5e6 100644 --- a/gcc/dwarfout.c +++ b/gcc/dwarfout.c @@ -1498,7 +1498,7 @@ output_bound_representation (bound, dim_num, u_or_l) if (! optimize) output_loc_descriptor - (eliminate_regs (SAVE_EXPR_RTL (bound), 0, 0)); + (eliminate_regs (SAVE_EXPR_RTL (bound), 0, NULL_RTX)); ASM_OUTPUT_LABEL (asm_out_file, end_label); } @@ -1573,7 +1573,7 @@ location_attribute (rtl) declaration, but not a definition. So sayeth the PLSIG. */ if (! is_pseudo_reg (rtl)) - output_loc_descriptor (eliminate_regs (rtl, 0, 0)); + output_loc_descriptor (eliminate_regs (rtl, 0, NULL_RTX)); ASM_OUTPUT_LABEL (asm_out_file, end_label); } @@ -1783,8 +1783,8 @@ const_value_attribute (rtl) simplicity we always just output CONST_DOUBLEs using 8 bytes. */ ASM_OUTPUT_DWARF_DATA8 (asm_out_file, - (unsigned) CONST_DOUBLE_HIGH (rtl), - (unsigned) CONST_DOUBLE_LOW (rtl)); + (unsigned HOST_WIDE_INT) CONST_DOUBLE_HIGH (rtl), + (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (rtl)); break; case CONST_STRING: @@ -4320,7 +4320,7 @@ dwarfout_file_scope_decl (decl, set_finalizing) fputc ('\n', asm_out_file); ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_SECTION); finalizing = set_finalizing; - output_decl (decl, NULL); + output_decl (decl, NULL_TREE); /* NOTE: The call above to `output_decl' may have caused one or more file-scope named types (i.e. tagged types) to be placed onto the @@ -4333,7 +4333,7 @@ dwarfout_file_scope_decl (decl, set_finalizing) `output_pending_types_for_scope' takes them off of the list and un-sets their TREE_ASM_WRITTEN flags. */ - output_pending_types_for_scope (NULL); + output_pending_types_for_scope (NULL_TREE); /* The above call should have totally emptied the pending_types_list. */ diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index db9e087b455..8af05c5c9d7 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -247,7 +247,7 @@ gen_rtx (va_alist) if (code == CONST_INT) { - int arg = va_arg (p, int); + HOST_WIDE_INT arg = va_arg (p, HOST_WIDE_INT); if (arg >= - MAX_SAVED_CONST_INT && arg <= MAX_SAVED_CONST_INT) return const_int_rtx[arg + MAX_SAVED_CONST_INT]; @@ -306,6 +306,10 @@ gen_rtx (va_alist) XINT (rt_val, i) = va_arg (p, int); break; + case 'w': /* A wide integer? */ + XWINT (rt_val, i) = va_arg (p, HOST_WIDE_INT); + break; + case 's': /* A string? */ XSTR (rt_val, i) = va_arg (p, char *); break; @@ -538,25 +542,26 @@ gen_lowpart_common (mode, x) either a reasonable negative value or a reasonable unsigned value for this mode. */ - if (GET_MODE_BITSIZE (mode) == 2 * HOST_BITS_PER_INT) + if (GET_MODE_BITSIZE (mode) == 2 * HOST_BITS_PER_WIDE_INT) return x; - else if (GET_MODE_BITSIZE (mode) > HOST_BITS_PER_INT) + else if (GET_MODE_BITSIZE (mode) > HOST_BITS_PER_WIDE_INT) return 0; - else if (GET_MODE_BITSIZE (mode) == HOST_BITS_PER_INT) + else if (GET_MODE_BITSIZE (mode) == HOST_BITS_PER_WIDE_INT) return (GET_CODE (x) == CONST_INT ? x - : gen_rtx (CONST_INT, VOIDmode, CONST_DOUBLE_LOW (x))); + : GEN_INT (CONST_DOUBLE_LOW (x))); else { /* MODE must be narrower than HOST_BITS_PER_INT. */ int width = GET_MODE_BITSIZE (mode); - int val = (GET_CODE (x) == CONST_INT ? INTVAL (x) - : CONST_DOUBLE_LOW (x)); + HOST_WIDE_INT val = (GET_CODE (x) == CONST_INT ? INTVAL (x) + : CONST_DOUBLE_LOW (x)); - if (((val & ((-1) << (width - 1))) != ((-1) << (width - 1)))) - val &= (1 << width) - 1; + if (((val & ((HOST_WIDE_INT) (-1) << (width - 1))) + != ((HOST_WIDE_INT) (-1) << (width - 1)))) + val &= ((HOST_WIDE_INT) 1 << width) - 1; return (GET_CODE (x) == CONST_INT && INTVAL (x) == val ? x - : gen_rtx (CONST_INT, VOIDmode, val)); + : GEN_INT (val)); } } @@ -567,33 +572,34 @@ gen_lowpart_common (mode, x) different. */ else if (((HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT - && HOST_BITS_PER_INT == BITS_PER_WORD) + && HOST_BITS_PER_WIDE_INT == BITS_PER_WORD) || flag_pretend_float) && GET_MODE_CLASS (mode) == MODE_FLOAT && GET_MODE_SIZE (mode) == UNITS_PER_WORD && GET_CODE (x) == CONST_INT - && sizeof (float) * HOST_BITS_PER_CHAR == HOST_BITS_PER_INT) + && sizeof (float) * HOST_BITS_PER_CHAR == HOST_BITS_PER_WIDE_INT) { - union {int i; float d; } u; + union {HOST_WIDE_INT i; float d; } u; u.i = INTVAL (x); return immed_real_const_1 (u.d, mode); } else if (((HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT - && HOST_BITS_PER_INT == BITS_PER_WORD) + && HOST_BITS_PER_WIDE_INT == BITS_PER_WORD) || flag_pretend_float) && GET_MODE_CLASS (mode) == MODE_FLOAT && GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD && (GET_CODE (x) == CONST_INT || GET_CODE (x) == CONST_DOUBLE) && GET_MODE (x) == VOIDmode - && sizeof (double) * HOST_BITS_PER_CHAR == 2 * HOST_BITS_PER_INT) + && (sizeof (double) * HOST_BITS_PER_CHAR + == 2 * HOST_BITS_PER_WIDE_INT)) { - union {int i[2]; double d; } u; - int low, high; + union {HOST_WIDE_INT i[2]; double d; } u; + HOST_WIDE_INT low, high; if (GET_CODE (x) == CONST_INT) - low = INTVAL (x), high = low >> (HOST_BITS_PER_INT -1); + low = INTVAL (x), high = low >> (HOST_BITS_PER_WIDE_INT -1); else low = CONST_DOUBLE_LOW (x), high = CONST_DOUBLE_HIGH (x); @@ -611,7 +617,7 @@ gen_lowpart_common (mode, x) compatible. */ else if (((HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT - && HOST_BITS_PER_INT == BITS_PER_WORD) + && HOST_BITS_PER_WIDE_INT == BITS_PER_WORD) || flag_pretend_float) && GET_MODE_CLASS (mode) == MODE_INT && GET_CODE (x) == CONST_DOUBLE @@ -625,7 +631,7 @@ gen_lowpart_common (mode, x) compatible. */ else if (((HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT - && HOST_BITS_PER_INT == BITS_PER_WORD) + && HOST_BITS_PER_WIDE_INT == BITS_PER_WORD) || flag_pretend_float) && GET_MODE_CLASS (mode) == MODE_INT && GET_CODE (x) == CONST_DOUBLE @@ -725,8 +731,8 @@ operand_subword (op, i, validate_address, mode) int validate_address; enum machine_mode mode; { - int val; - int size_ratio = HOST_BITS_PER_INT / BITS_PER_WORD; + HOST_WIDE_INT val; + int size_ratio = HOST_BITS_PER_WIDE_INT / BITS_PER_WORD; if (mode == VOIDmode) mode = GET_MODE (op); @@ -793,13 +799,12 @@ operand_subword (op, i, validate_address, mode) target floating formats are the same, handling two-word floating constants are easy. */ if (((HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT - && HOST_BITS_PER_INT == BITS_PER_WORD) + && HOST_BITS_PER_WIDE_INT == BITS_PER_WORD) || flag_pretend_float) && GET_MODE_CLASS (mode) == MODE_FLOAT && GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD && GET_CODE (op) == CONST_DOUBLE) - return gen_rtx (CONST_INT, VOIDmode, - i ^ (WORDS_BIG_ENDIAN != + return GEN_INT (i ^ (WORDS_BIG_ENDIAN != /* The constant is stored in the host's word-ordering, but we want to access it in the target's word-ordering. */ #ifdef HOST_WORDS_BIG_ENDIAN @@ -813,19 +818,19 @@ operand_subword (op, i, validate_address, mode) values often do not have the same high-order bits. We have already verified that we want the only defined word of the single-word value. */ if (((HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT - && HOST_BITS_PER_INT == BITS_PER_WORD) + && HOST_BITS_PER_WIDE_INT == BITS_PER_WORD) || flag_pretend_float) && GET_MODE_CLASS (mode) == MODE_FLOAT && GET_MODE_SIZE (mode) == UNITS_PER_WORD && GET_CODE (op) == CONST_DOUBLE) { double d; - union {float f; int i; } u; + union {float f; HOST_WIDE_INT i; } u; REAL_VALUE_FROM_CONST_DOUBLE (d, op); u.f = d; - return gen_rtx (CONST_INT, VOIDmode, u.i); + return GEN_INT (u.i); } /* The only remaining cases that we can handle are integers. @@ -854,11 +859,12 @@ operand_subword (op, i, validate_address, mode) ? (INTVAL (op) < 0 ? ~0 : 0) : CONST_DOUBLE_HIGH (op))); /* If BITS_PER_WORD is smaller than an int, get the appropriate bits. */ - if (BITS_PER_WORD < HOST_BITS_PER_INT) + if (BITS_PER_WORD < HOST_BITS_PER_WIDE_INT) val = ((val >> ((i % size_ratio) * BITS_PER_WORD)) - & ((1 << (BITS_PER_WORD % HOST_BITS_PER_INT)) - 1)); + & (((HOST_WIDE_INT) 1 + << (BITS_PER_WORD % HOST_BITS_PER_WIDE_INT)) - 1)); - return gen_rtx (CONST_INT, VOIDmode, val); + return GEN_INT (val); } /* Similar to `operand_subword', but never return 0. If we can't extract @@ -965,7 +971,8 @@ change_address (memref, mode, addr) rtx gen_label_rtx () { - register rtx label = gen_rtx (CODE_LABEL, VOIDmode, 0, 0, 0, label_num++, 0); + register rtx label = gen_rtx (CODE_LABEL, VOIDmode, 0, 0, 0, + label_num++, NULL_PTR); LABEL_NUSES (label) = 0; return label; } @@ -991,7 +998,7 @@ gen_inline_header_rtx (first_insn, first_parm_insn, first_labelno, rtx original_decl_initial; { rtx header = gen_rtx (INLINE_HEADER, VOIDmode, - cur_insn_uid++, NULL, + cur_insn_uid++, NULL_RTX, first_insn, first_parm_insn, first_labelno, last_labelno, max_parm_regnum, max_regnum, args_size, pops_args, @@ -1577,7 +1584,7 @@ rtx next_cc0_user (insn) rtx insn; { - rtx note = find_reg_note (insn, REG_CC_USER, 0); + rtx note = find_reg_note (insn, REG_CC_USER, NULL_RTX); if (note) return XEXP (note, 0); @@ -1600,7 +1607,7 @@ rtx prev_cc0_setter (insn) rtx insn; { - rtx note = find_reg_note (insn, REG_CC_SETTER, 0); + rtx note = find_reg_note (insn, REG_CC_SETTER, NULL_RTX); rtx link; if (note) @@ -1903,7 +1910,7 @@ emit_insn_before (pattern, before) } else { - insn = make_insn_raw (pattern, 0); + insn = make_insn_raw (pattern, NULL_RTVEC); add_insn_after (insn, PREV_INSN (before)); } @@ -1923,7 +1930,7 @@ emit_jump_insn_before (pattern, before) insn = emit_insn_before (pattern, before); else { - insn = make_jump_insn_raw (pattern, 0); + insn = make_jump_insn_raw (pattern, NULL_RTVEC); add_insn_after (insn, PREV_INSN (before)); } @@ -1997,7 +2004,7 @@ emit_insn_after (pattern, after) } else { - insn = make_insn_raw (pattern, 0); + insn = make_insn_raw (pattern, NULL_RTVEC); add_insn_after (insn, after); } @@ -2017,7 +2024,7 @@ emit_jump_insn_after (pattern, after) insn = emit_insn_after (pattern, after); else { - insn = make_jump_insn_raw (pattern, 0); + insn = make_jump_insn_raw (pattern, NULL_RTVEC); add_insn_after (insn, after); } @@ -2123,7 +2130,7 @@ emit_insn (pattern) } else { - insn = make_insn_raw (pattern, NULL); + insn = make_insn_raw (pattern, NULL_RTVEC); add_insn (insn); } @@ -2182,7 +2189,7 @@ emit_jump_insn (pattern) return emit_insn (pattern); else { - register rtx insn = make_jump_insn_raw (pattern, NULL); + register rtx insn = make_jump_insn_raw (pattern, NULL_RTVEC); add_insn (insn); return insn; } @@ -2199,7 +2206,7 @@ emit_call_insn (pattern) return emit_insn (pattern); else { - register rtx insn = make_insn_raw (pattern, NULL); + register rtx insn = make_insn_raw (pattern, NULL_RTVEC); add_insn (insn); PUT_CODE (insn, CALL_INSN); return insn; @@ -2712,13 +2719,13 @@ init_emit_once (line_numbers) } /* These four calls obtain some of the rtx expressions made above. */ - const0_rtx = gen_rtx (CONST_INT, VOIDmode, 0); - const1_rtx = gen_rtx (CONST_INT, VOIDmode, 1); - const2_rtx = gen_rtx (CONST_INT, VOIDmode, 2); - constm1_rtx = gen_rtx (CONST_INT, VOIDmode, -1); + const0_rtx = GEN_INT (0); + const1_rtx = GEN_INT (1); + const2_rtx = GEN_INT (2); + constm1_rtx = GEN_INT (-1); /* This will usually be one of the above constants, but may be a new rtx. */ - const_true_rtx = gen_rtx (CONST_INT, VOIDmode, STORE_FLAG_VALUE); + const_true_rtx = GEN_INT (STORE_FLAG_VALUE); dconst0 = REAL_VALUE_ATOF ("0"); dconst1 = REAL_VALUE_ATOF ("1"); @@ -2743,11 +2750,11 @@ init_emit_once (line_numbers) const_tiny_rtx[i][(int) mode] = tem; } - const_tiny_rtx[i][(int) VOIDmode] = gen_rtx (CONST_INT, VOIDmode, i); + const_tiny_rtx[i][(int) VOIDmode] = GEN_INT (i); for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT); mode != VOIDmode; mode = GET_MODE_WIDER_MODE (mode)) - const_tiny_rtx[i][(int) mode] = gen_rtx (CONST_INT, VOIDmode, i); + const_tiny_rtx[i][(int) mode] = GEN_INT (i); } stack_pointer_rtx = gen_rtx (REG, Pmode, STACK_POINTER_REGNUM); diff --git a/gcc/expr.c b/gcc/expr.c index 5da6892213f..e1a94e7e359 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -242,7 +242,7 @@ enqueue_insn (var, body) rtx var, body; { pending_chain = gen_rtx (QUEUED, GET_MODE (var), - var, 0, 0, body, pending_chain); + var, NULL_RTX, NULL_RTX, body, pending_chain); return pending_chain; } @@ -601,7 +601,8 @@ convert_move (to, from, unsignedp) && insn_operand_mode[(int) CODE_FOR_slt][0] == word_mode && STORE_FLAG_VALUE == -1) { - emit_cmp_insn (lowfrom, const0_rtx, NE, 0, lowpart_mode, 0, 0); + emit_cmp_insn (lowfrom, const0_rtx, NE, NULL_RTX, + lowpart_mode, 0, 0); fill_value = gen_reg_rtx (word_mode); emit_insn (gen_slt (fill_value)); } @@ -611,7 +612,7 @@ convert_move (to, from, unsignedp) fill_value = expand_shift (RSHIFT_EXPR, lowpart_mode, lowfrom, size_int (GET_MODE_BITSIZE (lowpart_mode) - 1), - 0, 0); + NULL_RTX, 0); fill_value = convert_to_mode (word_mode, fill_value, 1); } } @@ -632,7 +633,7 @@ convert_move (to, from, unsignedp) insns = get_insns (); end_sequence (); - emit_no_conflict_block (insns, to, from, 0, + emit_no_conflict_block (insns, to, from, NULL_RTX, gen_rtx (equiv_code, to_mode, from)); return; } @@ -844,15 +845,15 @@ convert_to_mode (mode, x, unsignedp) return x; /* There is one case that we must handle specially: If we are converting - a CONST_INT into a mode whose size is twice HOST_BITS_PER_INT and + a CONST_INT into a mode whose size is twice HOST_BITS_PER_WIDE_INT and we are to interpret the constant as unsigned, gen_lowpart will do the wrong if the constant appears negative. What we want to do is make the high-order word of the constant zero, not all ones. */ if (unsignedp && GET_MODE_CLASS (mode) == MODE_INT - && GET_MODE_BITSIZE (mode) == 2 * HOST_BITS_PER_INT + && GET_MODE_BITSIZE (mode) == 2 * HOST_BITS_PER_WIDE_INT && GET_CODE (x) == CONST_INT && INTVAL (x) < 0) - return immed_double_const (INTVAL (x), 0, mode); + return immed_double_const (INTVAL (x), (HOST_WIDE_INT) 0, mode); /* We can do this with a gen_lowpart if both desired and current modes are integer, and this is either a constant integer, a register, or a @@ -1074,21 +1075,17 @@ move_by_pieces_1 (genfun, mode, data) #ifdef HAVE_PRE_DECREMENT if (data->explicit_inc_to < 0) - emit_insn (gen_add2_insn (data->to_addr, - gen_rtx (CONST_INT, VOIDmode, -size))); + emit_insn (gen_add2_insn (data->to_addr, GEN_INT (-size))); if (data->explicit_inc_from < 0) - emit_insn (gen_add2_insn (data->from_addr, - gen_rtx (CONST_INT, VOIDmode, -size))); + emit_insn (gen_add2_insn (data->from_addr, GEN_INT (-size))); #endif emit_insn ((*genfun) (to1, from1)); #ifdef HAVE_POST_INCREMENT if (data->explicit_inc_to > 0) - emit_insn (gen_add2_insn (data->to_addr, - gen_rtx (CONST_INT, VOIDmode, size))); + emit_insn (gen_add2_insn (data->to_addr, GEN_INT (size))); if (data->explicit_inc_from > 0) - emit_insn (gen_add2_insn (data->from_addr, - gen_rtx (CONST_INT, VOIDmode, size))); + emit_insn (gen_add2_insn (data->from_addr, GEN_INT (size))); #endif if (! data->reverse) data->offset += size; @@ -1130,8 +1127,7 @@ emit_block_move (x, y, size, align) abort (); if (GET_CODE (size) == CONST_INT - && (move_by_pieces_ninsns ((unsigned) INTVAL (size), align) - < MOVE_RATIO)) + && (move_by_pieces_ninsns (INTVAL (size), align) < MOVE_RATIO)) move_by_pieces (x, y, INTVAL (size), align); else { @@ -1144,8 +1140,7 @@ emit_block_move (x, y, size, align) && ((unsigned) INTVAL (size) < (1 << (GET_MODE_BITSIZE (QImode) - 1)))) { - rtx insn = gen_movstrqi (x, y, size, - gen_rtx (CONST_INT, VOIDmode, align)); + rtx insn = gen_movstrqi (x, y, size, GEN_INT (align)); if (insn) { emit_insn (insn); @@ -1159,8 +1154,7 @@ emit_block_move (x, y, size, align) && ((unsigned) INTVAL (size) < (1 << (GET_MODE_BITSIZE (HImode) - 1)))) { - rtx insn = gen_movstrhi (x, y, size, - gen_rtx (CONST_INT, VOIDmode, align)); + rtx insn = gen_movstrhi (x, y, size, GEN_INT (align)); if (insn) { emit_insn (insn); @@ -1171,8 +1165,7 @@ emit_block_move (x, y, size, align) #ifdef HAVE_movstrsi if (HAVE_movstrsi) { - rtx insn = gen_movstrsi (x, y, size, - gen_rtx (CONST_INT, VOIDmode, align)); + rtx insn = gen_movstrsi (x, y, size, GEN_INT (align)); if (insn) { emit_insn (insn); @@ -1183,8 +1176,7 @@ emit_block_move (x, y, size, align) #ifdef HAVE_movstrdi if (HAVE_movstrdi) { - rtx insn = gen_movstrdi (x, y, size, - gen_rtx (CONST_INT, VOIDmode, align)); + rtx insn = gen_movstrdi (x, y, size, GEN_INT (align)); if (insn) { emit_insn (insn); @@ -1227,7 +1219,7 @@ move_block_to_reg (regno, x, nregs, mode) #ifdef HAVE_load_multiple last = get_last_insn (); pat = gen_load_multiple (gen_rtx (REG, word_mode, regno), x, - gen_rtx (CONST_INT, VOIDmode, nregs)); + GEN_INT (nregs)); if (pat) { emit_insn (pat); @@ -1258,7 +1250,7 @@ move_block_from_reg (regno, x, nregs) #ifdef HAVE_store_multiple last = get_last_insn (); pat = gen_store_multiple (x, gen_rtx (REG, word_mode, regno), - gen_rtx (CONST_INT, VOIDmode, nregs)); + GEN_INT (nregs)); if (pat) { emit_insn (pat); @@ -1306,12 +1298,12 @@ clear_storage (object, size) emit_library_call (memset_libfunc, 1, VOIDmode, 3, XEXP (object, 0), Pmode, const0_rtx, Pmode, - gen_rtx (CONST_INT, VOIDmode, size), Pmode); + GEN_INT (size), Pmode); #else emit_library_call (bzero_libfunc, 1, VOIDmode, 2, XEXP (object, 0), Pmode, - gen_rtx (CONST_INT, VOIDmode, size), Pmode); + GEN_INT (size), Pmode); #endif } else @@ -1424,9 +1416,7 @@ push_block (size, extra, below) { rtx temp = copy_to_mode_reg (Pmode, size); if (extra != 0) - temp = expand_binop (Pmode, add_optab, - temp, - gen_rtx (CONST_INT, VOIDmode, extra), + temp = expand_binop (Pmode, add_optab, temp, GEN_INT (extra), temp, 0, OPTAB_LIB_WIDEN); anti_adjust_stack (temp); } @@ -1568,7 +1558,7 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra, But if space already allocated, this has already been done. */ if (extra && args_addr == 0 && where_pad != none && where_pad != stack_direction) - anti_adjust_stack (gen_rtx (CONST_INT, VOIDmode, extra)); + anti_adjust_stack (GEN_INT (extra)); move_by_pieces (gen_rtx (MEM, BLKmode, gen_push_operand ()), xinner, INTVAL (size) - used, align); @@ -1583,11 +1573,11 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra, if (partial != 0) { if (GET_CODE (size) == CONST_INT) - size = gen_rtx (CONST_INT, VOIDmode, INTVAL (size) - used); + size = GEN_INT (INTVAL (size) - used); else size = expand_binop (GET_MODE (size), sub_optab, size, - gen_rtx (CONST_INT, VOIDmode, used), - 0, 0, OPTAB_LIB_WIDEN); + GEN_INT (used), NULL_RTX, 0, + OPTAB_LIB_WIDEN); } /* Get the address of the stack space. @@ -1627,8 +1617,7 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra, < (1 << (GET_MODE_BITSIZE (QImode) - 1)))) { emit_insn (gen_movstrqi (gen_rtx (MEM, BLKmode, temp), - xinner, size, - gen_rtx (CONST_INT, VOIDmode, align))); + xinner, size, GEN_INT (align))); goto ret; } #endif @@ -1639,8 +1628,7 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra, < (1 << (GET_MODE_BITSIZE (HImode) - 1)))) { emit_insn (gen_movstrhi (gen_rtx (MEM, BLKmode, temp), - xinner, size, - gen_rtx (CONST_INT, VOIDmode, align))); + xinner, size, GEN_INT (align))); goto ret; } #endif @@ -1648,8 +1636,7 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra, if (HAVE_movstrsi) { emit_insn (gen_movstrsi (gen_rtx (MEM, BLKmode, temp), - xinner, size, - gen_rtx (CONST_INT, VOIDmode, align))); + xinner, size, GEN_INT (align))); goto ret; } #endif @@ -1657,8 +1644,7 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra, if (HAVE_movstrdi) { emit_insn (gen_movstrdi (gen_rtx (MEM, BLKmode, temp), - xinner, size, - gen_rtx (CONST_INT, VOIDmode, align))); + xinner, size, GEN_INT (align))); goto ret; } #endif @@ -1706,7 +1692,7 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra, But if space already allocated, this has already been done. */ if (extra && args_addr == 0 && where_pad != none && where_pad != stack_direction) - anti_adjust_stack (gen_rtx (CONST_INT, VOIDmode, extra)); + anti_adjust_stack (GEN_INT (extra)); /* If we make space by pushing it, we might as well push the real data. Otherwise, we can leave OFFSET nonzero @@ -1747,9 +1733,9 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra, #endif if (i >= not_stack + offset) emit_push_insn (operand_subword_force (x, i, mode), - word_mode, 0, 0, align, 0, 0, 0, args_addr, - gen_rtx (CONST_INT, VOIDmode, - args_offset + ((i - not_stack + skip) + word_mode, NULL_TREE, NULL_RTX, align, 0, NULL_RTX, + 0, args_addr, + GEN_INT (args_offset + ((i - not_stack + skip) * UNITS_PER_WORD))); } else @@ -1761,7 +1747,7 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra, But if space already allocated, this has already been done. */ if (extra && args_addr == 0 && where_pad != none && where_pad != stack_direction) - anti_adjust_stack (gen_rtx (CONST_INT, VOIDmode, extra)); + anti_adjust_stack (GEN_INT (extra)); #ifdef PUSH_ROUNDING if (args_addr == 0) @@ -1787,7 +1773,7 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra, move_block_to_reg (REGNO (reg), x, partial, mode); if (extra && args_addr == 0 && where_pad == stack_direction) - anti_adjust_stack (gen_rtx (CONST_INT, VOIDmode, extra)); + anti_adjust_stack (GEN_INT (extra)); } /* Output a library call to function FUN (a SYMBOL_REF rtx) @@ -1864,29 +1850,29 @@ emit_library_call (va_alist) /* Make sure it is a reasonable operand for a move or push insn. */ if (GET_CODE (val) != REG && GET_CODE (val) != MEM && ! (CONSTANT_P (val) && LEGITIMATE_CONSTANT_P (val))) - val = force_operand (val, 0); + val = force_operand (val, NULL_RTX); argvec[count].value = val; argvec[count].mode = mode; #ifdef FUNCTION_ARG_PASS_BY_REFERENCE - if (FUNCTION_ARG_PASS_BY_REFERENCE (args_so_far, mode, (tree)0, 1)) + if (FUNCTION_ARG_PASS_BY_REFERENCE (args_so_far, mode, NULL_TREE, 1)) abort (); #endif - argvec[count].reg = FUNCTION_ARG (args_so_far, mode, (tree)0, 1); + argvec[count].reg = FUNCTION_ARG (args_so_far, mode, NULL_TREE, 1); if (argvec[count].reg && GET_CODE (argvec[count].reg) == EXPR_LIST) abort (); #ifdef FUNCTION_ARG_PARTIAL_NREGS argvec[count].partial - = FUNCTION_ARG_PARTIAL_NREGS (args_so_far, mode, (tree)0, 1); + = FUNCTION_ARG_PARTIAL_NREGS (args_so_far, mode, NULL_TREE, 1); #else argvec[count].partial = 0; #endif - locate_and_pad_parm (mode, 0, + locate_and_pad_parm (mode, NULL_TREE, argvec[count].reg && argvec[count].partial == 0, - 0, &args_size, &argvec[count].offset, + NULL_TREE, &args_size, &argvec[count].offset, &argvec[count].size); if (argvec[count].size.var) @@ -1942,8 +1928,7 @@ emit_library_call (va_alist) #endif #ifndef PUSH_ROUNDING - argblock = push_block (gen_rtx (CONST_INT, VOIDmode, args_size.constant), - 0, 0); + argblock = push_block (GEN_INT (args_size.constant), 0, 0); #endif #ifdef PUSH_ARGS_REVERSED @@ -1964,9 +1949,8 @@ emit_library_call (va_alist) int partial = argvec[argnum].partial; if (! (reg != 0 && partial == 0)) - emit_push_insn (val, mode, 0, 0, 0, partial, reg, 0, argblock, - gen_rtx (CONST_INT, VOIDmode, - argvec[count].offset.constant)); + emit_push_insn (val, mode, NULL_TREE, NULL_RTX, 0, partial, reg, 0, + argblock, GEN_INT (argvec[count].offset.constant)); NO_DEFER_POP; } @@ -2003,7 +1987,7 @@ emit_library_call (va_alist) use_insns = get_insns (); end_sequence (); - fun = prepare_call_address (fun, 0, &use_insns); + fun = prepare_call_address (fun, NULL_TREE, &use_insns); /* Don't allow popping to be deferred, since then cse'ing of library calls could delete a call and leave the pop. */ @@ -2014,7 +1998,7 @@ emit_library_call (va_alist) emit_call_1 (fun, get_identifier (XSTR (orgfun, 0)), args_size.constant, 0, FUNCTION_ARG (args_so_far, VOIDmode, void_type_node, 1), - outmode != VOIDmode ? hard_libcall_value (outmode) : 0, + outmode != VOIDmode ? hard_libcall_value (outmode) : NULL_RTX, old_inhibit_defer_pop + 1, use_insns, no_queue); /* Now restore inhibit_defer_pop to its actual original value. */ @@ -2045,7 +2029,7 @@ expand_assignment (to, from, want_value, suggest_reg) /* Don't crash if the lhs of the assignment was erroneous. */ if (TREE_CODE (to) == ERROR_MARK) - return expand_expr (from, 0, VOIDmode, 0); + return expand_expr (from, NULL_RTX, VOIDmode, 0); /* Assignment of a structure component needs special treatment if the structure component's rtx is not simply a MEM. @@ -2073,10 +2057,10 @@ expand_assignment (to, from, want_value, suggest_reg) if (mode1 == VOIDmode && want_value) tem = stabilize_reference (tem); - to_rtx = expand_expr (tem, 0, VOIDmode, 0); + to_rtx = expand_expr (tem, NULL_RTX, VOIDmode, 0); if (offset != 0) { - rtx offset_rtx = expand_expr (offset, 0, VOIDmode, 0); + rtx offset_rtx = expand_expr (offset, NULL_RTX, VOIDmode, 0); if (GET_CODE (to_rtx) != MEM) abort (); @@ -2115,7 +2099,7 @@ expand_assignment (to, from, want_value, suggest_reg) Don't re-expand if it was expanded already (in COMPONENT_REF case). */ if (to_rtx == 0) - to_rtx = expand_expr (to, 0, VOIDmode, 0); + to_rtx = expand_expr (to, NULL_RTX, VOIDmode, 0); /* In case we are returning the contents of an object which overlaps the place the value is being stored, use a safe function when copying @@ -2124,7 +2108,7 @@ expand_assignment (to, from, want_value, suggest_reg) && current_function_returns_struct && !current_function_returns_pcc_struct) { - rtx from_rtx = expand_expr (from, 0, VOIDmode, 0); + rtx from_rtx = expand_expr (from, NULL_RTX, VOIDmode, 0); rtx size = expr_size (from); #ifdef TARGET_MEM_FUNCTIONS @@ -2211,7 +2195,7 @@ store_expr (exp, target, suggest_reg) if EXP is another assignment, SUGGEST_REG will be nonzero for it. We know expand_expr will not use the target in that case. */ { - temp = expand_expr (exp, cse_not_expected ? 0 : target, + temp = expand_expr (exp, cse_not_expected ? NULL_RTX : target, GET_MODE (target), 0); if (GET_MODE (temp) != BLKmode && GET_MODE (temp) != VOIDmode) temp = copy_to_reg (temp); @@ -2231,7 +2215,7 @@ store_expr (exp, target, suggest_reg) temp = expand_expr (exp, temp, GET_MODE (target), 0); } else - temp = expand_expr (exp, 0, GET_MODE (target), 0); + temp = expand_expr (exp, NULL_RTX, GET_MODE (target), 0); dont_return_target = 1; } else @@ -2291,7 +2275,8 @@ store_expr (exp, target, suggest_reg) size_int (BITS_PER_UNIT)), convert (sizetype, build_int_2 (TREE_STRING_LENGTH (exp), 0)))); - rtx copy_size_rtx = expand_expr (copy_size, 0, VOIDmode, 0); + rtx copy_size_rtx = expand_expr (copy_size, NULL_RTX, + VOIDmode, 0); rtx label = 0; /* Copy that much. */ @@ -2313,12 +2298,14 @@ store_expr (exp, target, suggest_reg) temp = force_reg (Pmode, XEXP (target, 0)); temp = expand_binop (size_mode, add_optab, temp, - copy_size_rtx, 0, 0, OPTAB_LIB_WIDEN); + copy_size_rtx, NULL_RTX, 0, + OPTAB_LIB_WIDEN); size = expand_binop (size_mode, sub_optab, size, - copy_size_rtx, 0, 0, OPTAB_LIB_WIDEN); + copy_size_rtx, NULL_RTX, 0, + OPTAB_LIB_WIDEN); - emit_cmp_insn (size, const0_rtx, LT, 0, + emit_cmp_insn (size, const0_rtx, LT, NULL_RTX, GET_MODE (size), 0, 0); label = gen_label_rtx (); emit_jump_insn (gen_blt (label)); @@ -2438,8 +2425,8 @@ store_constructor (exp, target) register tree elt; register int i; tree domain = TYPE_DOMAIN (type); - int minelt = TREE_INT_CST_LOW (TYPE_MIN_VALUE (domain)); - int maxelt = TREE_INT_CST_LOW (TYPE_MAX_VALUE (domain)); + HOST_WIDE_INT minelt = TREE_INT_CST_LOW (TYPE_MIN_VALUE (domain)); + HOST_WIDE_INT maxelt = TREE_INT_CST_LOW (TYPE_MAX_VALUE (domain)); tree elttype = TREE_TYPE (type); /* If the constructor has fewer fields than the structure, @@ -2511,10 +2498,10 @@ store_field (target, bitsize, bitpos, mode, exp, value_mode, int align; int total_size; { - int width_mask = 0; + HOST_WIDE_INT width_mask = 0; - if (bitsize < HOST_BITS_PER_INT) - width_mask = (1 << bitsize) - 1; + if (bitsize < HOST_BITS_PER_WIDE_INT) + width_mask = ((HOST_WIDE_INT) 1 << bitsize) - 1; /* If we are storing into an unaligned field of an aligned union that is in a register, we may have the mode of TARGET being an integer mode but @@ -2556,7 +2543,7 @@ store_field (target, bitsize, bitpos, mode, exp, value_mode, || GET_CODE (target) == REG || GET_CODE (target) == SUBREG) { - rtx temp = expand_expr (exp, 0, VOIDmode, 0); + rtx temp = expand_expr (exp, NULL_RTX, VOIDmode, 0); /* Store the value in the bitfield. */ store_bit_field (target, bitsize, bitpos, mode, temp, align, total_size); if (value_mode != VOIDmode) @@ -2565,10 +2552,10 @@ store_field (target, bitsize, bitpos, mode, exp, value_mode, /* If possible, avoid refetching from the bitfield itself. */ if (width_mask != 0 && ! (GET_CODE (target) == MEM && MEM_VOLATILE_P (target))) - return expand_and (temp, - gen_rtx (CONST_INT, VOIDmode, width_mask), 0); + return expand_and (temp, GEN_INT (width_mask), NULL_RTX); return extract_bit_field (target, bitsize, bitpos, unsignedp, - 0, value_mode, 0, align, total_size); + NULL_RTX, value_mode, 0, align, + total_size); } return const0_rtx; } @@ -2785,7 +2772,7 @@ force_operand (value, target) subtarget = 0; tmp = force_operand (XEXP (value, 0), subtarget); return expand_mult (GET_MODE (value), tmp, - force_operand (op2, 0), + force_operand (op2, NULL_RTX), target, 0); } @@ -2823,7 +2810,7 @@ force_operand (value, target) tmp = force_operand (XEXP (value, 0), subtarget); return expand_binop (GET_MODE (value), binoptab, tmp, - force_operand (op2, 0), + force_operand (op2, NULL_RTX), target, 0, OPTAB_LIB_WIDEN); /* We give UNSIGNEP = 0 to expand_binop because the only operations we are expanding here are signed ones. */ @@ -2851,13 +2838,14 @@ save_noncopied_parts (lhs, list) { tree part = TREE_VALUE (tail); tree part_type = TREE_TYPE (part); - tree to_be_saved = build (COMPONENT_REF, part_type, lhs, part, 0); + tree to_be_saved = build (COMPONENT_REF, part_type, lhs, part); rtx target = assign_stack_temp (TYPE_MODE (part_type), int_size_in_bytes (part_type), 0); if (! memory_address_p (TYPE_MODE (part_type), XEXP (target, 0))) - target = change_address (target, TYPE_MODE (part_type), 0); + target = change_address (target, TYPE_MODE (part_type), NULL_RTX); parts = tree_cons (to_be_saved, - build (RTL_EXPR, part_type, 0, (tree) target), + build (RTL_EXPR, part_type, NULL_TREE, + (tree) target), parts); store_expr (TREE_PURPOSE (parts), RTL_EXPR_RTL (TREE_VALUE (parts)), 0); } @@ -2883,7 +2871,7 @@ init_noncopied_parts (lhs, list) { tree part = TREE_VALUE (tail); tree part_type = TREE_TYPE (part); - tree to_be_initialized = build (COMPONENT_REF, part_type, lhs, part, 0); + tree to_be_initialized = build (COMPONENT_REF, part_type, lhs, part); parts = tree_cons (TREE_PURPOSE (tail), to_be_initialized, parts); } return parts; @@ -3304,8 +3292,8 @@ expand_expr (exp, target, tmode, modifier) /* Exit the current loop if the body-expression is true. */ { rtx label = gen_label_rtx (); - do_jump (TREE_OPERAND (exp, 0), label, 0); - expand_exit_loop (0); + do_jump (TREE_OPERAND (exp, 0), label, NULL_RTX); + expand_exit_loop (NULL_PTR); emit_label (label); } return const0_rtx; @@ -3416,14 +3404,15 @@ expand_expr (exp, target, tmode, modifier) && TYPE_MODE (TREE_TYPE (exp1)) == Pmode && TYPE_MODE (TREE_TYPE (exp2)) == Pmode) { - temp = expand_expr (TREE_OPERAND (exp1, 0), 0, VOIDmode, EXPAND_SUM); + temp = expand_expr (TREE_OPERAND (exp1, 0), NULL_RTX, + VOIDmode, EXPAND_SUM); op0 = memory_address (mode, temp); op0 = copy_all_regs (op0); SAVE_EXPR_RTL (exp1) = op0; } else { - op0 = expand_expr (exp1, 0, VOIDmode, EXPAND_SUM); + op0 = expand_expr (exp1, NULL_RTX, VOIDmode, EXPAND_SUM); op0 = memory_address (mode, op0); } @@ -3577,8 +3566,7 @@ expand_expr (exp, target, tmode, modifier) else if (TREE_CODE (init) == STRING_CST && i < TREE_STRING_LENGTH (init)) { - temp = gen_rtx (CONST_INT, VOIDmode, - TREE_STRING_POINTER (init)[i]); + temp = GEN_INT (TREE_STRING_POINTER (init)[i]); return convert_to_mode (mode, temp, 0); } } @@ -3612,7 +3600,7 @@ expand_expr (exp, target, tmode, modifier) /* In some cases, we will be offsetting OP0's address by a constant. So get it as a sum, if possible. If we will be using it directly in an insn, we validate it. */ - op0 = expand_expr (tem, 0, VOIDmode, EXPAND_SUM); + op0 = expand_expr (tem, NULL_RTX, VOIDmode, EXPAND_SUM); /* If this is a constant, put it into a register if it is a legimate constant and memory if it isn't. */ @@ -3627,7 +3615,7 @@ expand_expr (exp, target, tmode, modifier) if (offset != 0) { - rtx offset_rtx = expand_expr (offset, 0, VOIDmode, 0); + rtx offset_rtx = expand_expr (offset, NULL_RTX, VOIDmode, 0); if (GET_CODE (op0) != MEM) abort (); @@ -3701,7 +3689,7 @@ expand_expr (exp, target, tmode, modifier) { tree base = build_unary_op (ADDR_EXPR, TREE_OPERAND (exp, 0), 0); tree addr = build (PLUS_EXPR, type, base, TREE_OPERAND (exp, 1)); - op0 = expand_expr (addr, 0, VOIDmode, EXPAND_SUM); + op0 = expand_expr (addr, NULL_RTX, VOIDmode, EXPAND_SUM); temp = gen_rtx (MEM, mode, memory_address (mode, op0)); MEM_IN_STRUCT_P (temp) = 1; MEM_VOLATILE_P (temp) = TREE_THIS_VOLATILE (exp) || flag_volatile; @@ -3724,7 +3712,8 @@ expand_expr (exp, target, tmode, modifier) { RTL_EXPR_RTL (exp) = expand_expr (TREE_OPERAND (exp, 0), target, tmode, modifier); - cleanups_this_call = tree_cons (0, TREE_OPERAND (exp, 2), cleanups_this_call); + cleanups_this_call + = tree_cons (NULL_TREE, TREE_OPERAND (exp, 2), cleanups_this_call); /* That's it for this cleanup. */ TREE_OPERAND (exp, 2) = 0; } @@ -3774,7 +3763,8 @@ expand_expr (exp, target, tmode, modifier) if (GET_CODE (target) == MEM) /* Store data into beginning of memory target. */ store_expr (TREE_OPERAND (exp, 0), - change_address (target, TYPE_MODE (valtype), 0), 0); + change_address (target, TYPE_MODE (valtype), 0), + NULL_RTX); else if (GET_CODE (target) == REG) /* Store this field into a union of the proper type. */ store_field (target, GET_MODE_BITSIZE (TYPE_MODE (valtype)), 0, @@ -3787,7 +3777,7 @@ expand_expr (exp, target, tmode, modifier) /* Return the entire union. */ return target; } - op0 = expand_expr (TREE_OPERAND (exp, 0), 0, mode, 0); + op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, mode, 0); if (GET_MODE (op0) == mode || GET_MODE (op0) == VOIDmode) return op0; if (flag_force_mem && GET_CODE (op0) == MEM) @@ -3837,7 +3827,7 @@ expand_expr (exp, target, tmode, modifier) If this is an EXPAND_SUM call, always return the sum. */ if (TREE_CODE (TREE_OPERAND (exp, 0)) == INTEGER_CST - && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_INT + && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT && (modifier == EXPAND_SUM || modifier == EXPAND_INITIALIZER || mode == Pmode)) { @@ -3874,7 +3864,7 @@ expand_expr (exp, target, tmode, modifier) subtarget = 0; op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, modifier); - op1 = expand_expr (TREE_OPERAND (exp, 1), 0, VOIDmode, modifier); + op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, modifier); /* Make sure any term that's a sum with a constant comes last. */ if (GET_CODE (op0) == PLUS @@ -3929,8 +3919,10 @@ expand_expr (exp, target, tmode, modifier) && really_constant_p (TREE_OPERAND (exp, 0)) && really_constant_p (TREE_OPERAND (exp, 1))) { - rtx op0 = expand_expr (TREE_OPERAND (exp, 0), 0, VOIDmode, modifier); - rtx op1 = expand_expr (TREE_OPERAND (exp, 1), 0, VOIDmode, modifier); + rtx op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, + VOIDmode, modifier); + rtx op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, + VOIDmode, modifier); return gen_rtx (MINUS, mode, op0, op1); } /* Convert A - const to A + (-const). */ @@ -3961,7 +3953,7 @@ expand_expr (exp, target, tmode, modifier) if (modifier == EXPAND_SUM && mode == Pmode && TREE_CODE (TREE_OPERAND (exp, 1)) == INTEGER_CST - && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_INT) + && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT) { op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, EXPAND_SUM); @@ -3970,20 +3962,17 @@ expand_expr (exp, target, tmode, modifier) && GET_CODE (XEXP (op0, 1)) == CONST_INT) return gen_rtx (PLUS, mode, gen_rtx (MULT, mode, XEXP (op0, 0), - gen_rtx (CONST_INT, VOIDmode, - TREE_INT_CST_LOW (TREE_OPERAND (exp, 1)))), - gen_rtx (CONST_INT, VOIDmode, - (TREE_INT_CST_LOW (TREE_OPERAND (exp, 1)) - * INTVAL (XEXP (op0, 1))))); + GEN_INT (TREE_INT_CST_LOW (TREE_OPERAND (exp, 1)))), + GEN_INT (TREE_INT_CST_LOW (TREE_OPERAND (exp, 1)) + * INTVAL (XEXP (op0, 1)))); if (GET_CODE (op0) != REG) - op0 = force_operand (op0, 0); + op0 = force_operand (op0, NULL_RTX); if (GET_CODE (op0) != REG) op0 = copy_to_mode_reg (mode, op0); return gen_rtx (MULT, mode, op0, - gen_rtx (CONST_INT, VOIDmode, - TREE_INT_CST_LOW (TREE_OPERAND (exp, 1)))); + GEN_INT (TREE_INT_CST_LOW (TREE_OPERAND (exp, 1)))); } if (! safe_from_p (subtarget, TREE_OPERAND (exp, 1))) @@ -4002,7 +3991,7 @@ expand_expr (exp, target, tmode, modifier) TREE_TYPE (TREE_OPERAND (TREE_OPERAND (exp, 0), 0))) /* Don't use a widening multiply if a shift will do. */ && ((GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 1)))) - > HOST_BITS_PER_INT) + > HOST_BITS_PER_WIDE_INT) || exact_log2 (TREE_INT_CST_LOW (TREE_OPERAND (exp, 1))) < 0)) || (TREE_CODE (TREE_OPERAND (exp, 1)) == NOP_EXPR @@ -4023,17 +4012,18 @@ expand_expr (exp, target, tmode, modifier) && this_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing) { op0 = expand_expr (TREE_OPERAND (TREE_OPERAND (exp, 0), 0), - 0, VOIDmode, 0); + NULL_RTX, VOIDmode, 0); if (TREE_CODE (TREE_OPERAND (exp, 1)) == INTEGER_CST) - op1 = expand_expr (TREE_OPERAND (exp, 1), 0, VOIDmode, 0); + op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, + VOIDmode, 0); else op1 = expand_expr (TREE_OPERAND (TREE_OPERAND (exp, 1), 0), - 0, VOIDmode, 0); + NULL_RTX, VOIDmode, 0); goto binop2; } } op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0); - op1 = expand_expr (TREE_OPERAND (exp, 1), 0, VOIDmode, 0); + op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0); return expand_mult (mode, op0, op1, target, unsignedp); case TRUNC_DIV_EXPR: @@ -4048,7 +4038,7 @@ expand_expr (exp, target, tmode, modifier) then if the divisor is constant can optimize the case where some terms of the dividend have coeffs divisible by it. */ op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0); - op1 = expand_expr (TREE_OPERAND (exp, 1), 0, VOIDmode, 0); + op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0); return expand_divmod (0, code, mode, op0, op1, target, unsignedp); case RDIV_EXPR: @@ -4063,7 +4053,7 @@ expand_expr (exp, target, tmode, modifier) if (! safe_from_p (subtarget, TREE_OPERAND (exp, 1))) subtarget = 0; op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0); - op1 = expand_expr (TREE_OPERAND (exp, 1), 0, VOIDmode, 0); + op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0); return expand_divmod (1, code, mode, op0, op1, target, unsignedp); case FIX_ROUND_EXPR: @@ -4072,14 +4062,14 @@ expand_expr (exp, target, tmode, modifier) abort (); /* Not used for C. */ case FIX_TRUNC_EXPR: - op0 = expand_expr (TREE_OPERAND (exp, 0), 0, VOIDmode, 0); + op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, VOIDmode, 0); if (target == 0) target = gen_reg_rtx (mode); expand_fix (target, op0, unsignedp); return target; case FLOAT_EXPR: - op0 = expand_expr (TREE_OPERAND (exp, 0), 0, VOIDmode, 0); + op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, VOIDmode, 0); if (target == 0) target = gen_reg_rtx (mode); /* expand_float can't figure out what to do if FROM has VOIDmode. @@ -4119,7 +4109,7 @@ expand_expr (exp, target, tmode, modifier) { rtx extended = expand_shift (RSHIFT_EXPR, mode, op0, size_int (GET_MODE_BITSIZE (mode) - 1), - 0, 0); + NULL_RTX, 0); temp = expand_binop (mode, xor_optab, extended, op0, target, 0, OPTAB_LIB_WIDEN); @@ -4141,8 +4131,8 @@ expand_expr (exp, target, tmode, modifier) emit_move_insn (target, op0); emit_cmp_insn (target, expand_expr (convert (type, integer_zero_node), - 0, VOIDmode, 0), - GE, 0, mode, 0, 0); + NULL_RTX, VOIDmode, 0), + GE, NULL_RTX, mode, 0, 0); NO_DEFER_POP; emit_jump_insn (gen_bge (temp)); op0 = expand_unop (mode, neg_optab, target, target, 0); @@ -4159,7 +4149,7 @@ expand_expr (exp, target, tmode, modifier) || (GET_CODE (target) == REG && REGNO (target) < FIRST_PSEUDO_REGISTER)) target = gen_reg_rtx (mode); - op1 = expand_expr (TREE_OPERAND (exp, 1), 0, VOIDmode, 0); + op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0); op0 = expand_expr (TREE_OPERAND (exp, 0), target, VOIDmode, 0); /* First try to do it with a special MIN or MAX instruction. @@ -4179,12 +4169,12 @@ expand_expr (exp, target, tmode, modifier) op0 = gen_label_rtx (); if (code == MAX_EXPR) temp = (TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 1))) - ? compare_from_rtx (target, op1, GEU, 1, mode, 0, 0) - : compare_from_rtx (target, op1, GE, 0, mode, 0, 0)); + ? compare_from_rtx (target, op1, GEU, 1, mode, NULL_RTX, 0) + : compare_from_rtx (target, op1, GE, 0, mode, NULL_RTX, 0)); else temp = (TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 1))) - ? compare_from_rtx (target, op1, LEU, 1, mode, 0, 0) - : compare_from_rtx (target, op1, LE, 0, mode, 0, 0)); + ? compare_from_rtx (target, op1, LEU, 1, mode, NULL_RTX, 0) + : compare_from_rtx (target, op1, LE, 0, mode, NULL_RTX, 0)); if (temp == const0_rtx) emit_move_insn (target, op1); else if (temp != const_true_rtx) @@ -4278,7 +4268,7 @@ expand_expr (exp, target, tmode, modifier) if (temp != original_target) temp = copy_to_reg (temp); op1 = gen_label_rtx (); - emit_cmp_insn (temp, const0_rtx, EQ, 0, + emit_cmp_insn (temp, const0_rtx, EQ, NULL_RTX, GET_MODE (temp), unsignedp, 0); emit_jump_insn (gen_beq (op1)); emit_move_insn (temp, const1_rtx); @@ -4308,8 +4298,7 @@ expand_expr (exp, target, tmode, modifier) op0 = expand_expr (TREE_OPERAND (exp, 0), target, VOIDmode, 0); /* The parser is careful to generate TRUTH_NOT_EXPR only with operands that are always zero or one. */ - temp = expand_binop (mode, xor_optab, op0, - gen_rtx (CONST_INT, mode, 1), + temp = expand_binop (mode, xor_optab, op0, const1_rtx, target, 1, OPTAB_LIB_WIDEN); if (temp == 0) abort (); @@ -4430,12 +4419,13 @@ expand_expr (exp, target, tmode, modifier) = invert_truthvalue (TREE_OPERAND (exp, 0)); result = do_store_flag (TREE_OPERAND (exp, 0), - safe_from_p (temp, singleton) ? temp : 0, + (safe_from_p (temp, singleton) + ? temp : NULL_RTX), mode, BRANCH_COST <= 1); if (result) { - op1 = expand_expr (singleton, 0, VOIDmode, 0); + op1 = expand_expr (singleton, NULL_RTX, VOIDmode, 0); return expand_binop (mode, boptab, op1, result, temp, unsignedp, OPTAB_LIB_WIDEN); } @@ -4463,7 +4453,8 @@ expand_expr (exp, target, tmode, modifier) store_expr (singleton, temp, 0); } else - expand_expr (singleton, ignore ? const1_rtx : 0, VOIDmode, 0); + expand_expr (singleton, + ignore ? const1_rtx : NULL_RTX, VOIDmode, 0); if (cleanups_this_call) { sorry ("aggregate value in COND_EXPR"); @@ -4477,7 +4468,7 @@ expand_expr (exp, target, tmode, modifier) if (binary_op && temp == 0) /* Just touch the other operand. */ expand_expr (TREE_OPERAND (binary_op, 1), - ignore ? const0_rtx : 0, VOIDmode, 0); + ignore ? const0_rtx : NULL_RTX, VOIDmode, 0); else if (binary_op) store_expr (build (TREE_CODE (binary_op), type, make_tree (type, temp), @@ -4560,8 +4551,8 @@ expand_expr (exp, target, tmode, modifier) if (temp != 0) store_expr (TREE_OPERAND (exp, 1), temp, 0); else - expand_expr (TREE_OPERAND (exp, 1), ignore ? const0_rtx : 0, - VOIDmode, 0); + expand_expr (TREE_OPERAND (exp, 1), + ignore ? const0_rtx : NULL_RTX, VOIDmode, 0); if (cleanups_this_call) { sorry ("aggregate value in COND_EXPR"); @@ -4575,8 +4566,8 @@ expand_expr (exp, target, tmode, modifier) if (temp != 0) store_expr (TREE_OPERAND (exp, 2), temp, 0); else - expand_expr (TREE_OPERAND (exp, 2), ignore ? const0_rtx : 0, - VOIDmode, 0); + expand_expr (TREE_OPERAND (exp, 2), + ignore ? const0_rtx : NULL_RTX, VOIDmode, 0); } if (cleanups_this_call) @@ -4631,8 +4622,8 @@ expand_expr (exp, target, tmode, modifier) if (TREE_OPERAND (exp, 2) == 0) TREE_OPERAND (exp, 2) = maybe_build_cleanup (slot); if (TREE_OPERAND (exp, 2)) - cleanups_this_call = tree_cons (0, TREE_OPERAND (exp, 2), - cleanups_this_call); + cleanups_this_call = tree_cons (NULL_TREE, TREE_OPERAND (exp, 2), + cleanups_this_call); #endif } else @@ -4755,7 +4746,7 @@ expand_expr (exp, target, tmode, modifier) } else { - op0 = expand_expr (TREE_OPERAND (exp, 0), 0, VOIDmode, + op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, VOIDmode, (modifier == EXPAND_INITIALIZER ? modifier : EXPAND_CONST_ADDRESS)); if (GET_CODE (op0) != MEM) @@ -4786,7 +4777,7 @@ expand_expr (exp, target, tmode, modifier) if (! safe_from_p (subtarget, TREE_OPERAND (exp, 1))) subtarget = 0; op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode, 0); - op1 = expand_expr (TREE_OPERAND (exp, 1), 0, VOIDmode, 0); + op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0); binop2: temp = expand_binop (mode, this_optab, op0, op1, target, unsignedp, OPTAB_LIB_WIDEN); @@ -5041,7 +5032,7 @@ expand_builtin (exp, target, subtarget, mode, ignore) { /* By checking op > 0 we are able to catch all of the IEEE special cases with a single if conditional. */ - emit_cmp_insn (op0, CONST0_RTX (GET_MODE (op0)), GT, 0, + emit_cmp_insn (op0, CONST0_RTX (GET_MODE (op0)), GT, NULL_RTX, GET_MODE (op0), 0, 0); emit_jump_insn (gen_bgt (lab1)); @@ -5162,7 +5153,7 @@ expand_builtin (exp, target, subtarget, mode, ignore) if (wordnum < 0 || wordnum >= nwords) error ("argument of __builtin_args_info out of range"); else - return gen_rtx (CONST_INT, VOIDmode, word_ptr[wordnum]); + return GEN_INT (word_ptr[wordnum]); } } else @@ -5181,7 +5172,7 @@ expand_builtin (exp, target, subtarget, mode, ignore) TREE_STATIC (result) = 1; result = build (INDIRECT_REF, build_pointer_type (type), result); TREE_CONSTANT (result) = 1; - return expand_expr (result, 0, VOIDmode, 0); + return expand_expr (result, NULL_RTX, VOIDmode, 0); #endif } @@ -5201,7 +5192,7 @@ expand_builtin (exp, target, subtarget, mode, ignore) return expand_binop (Pmode, add_optab, current_function_internal_arg_pointer, current_function_arg_offset_rtx, - 0, 0, OPTAB_LIB_WIDEN); + NULL_RTX, 0, OPTAB_LIB_WIDEN); case BUILT_IN_CLASSIFY_TYPE: if (arglist != 0) @@ -5209,45 +5200,45 @@ expand_builtin (exp, target, subtarget, mode, ignore) tree type = TREE_TYPE (TREE_VALUE (arglist)); enum tree_code code = TREE_CODE (type); if (code == VOID_TYPE) - return gen_rtx (CONST_INT, VOIDmode, void_type_class); + return GEN_INT (void_type_class); if (code == INTEGER_TYPE) - return gen_rtx (CONST_INT, VOIDmode, integer_type_class); + return GEN_INT (integer_type_class); if (code == CHAR_TYPE) - return gen_rtx (CONST_INT, VOIDmode, char_type_class); + return GEN_INT (char_type_class); if (code == ENUMERAL_TYPE) - return gen_rtx (CONST_INT, VOIDmode, enumeral_type_class); + return GEN_INT (enumeral_type_class); if (code == BOOLEAN_TYPE) - return gen_rtx (CONST_INT, VOIDmode, boolean_type_class); + return GEN_INT (boolean_type_class); if (code == POINTER_TYPE) - return gen_rtx (CONST_INT, VOIDmode, pointer_type_class); + return GEN_INT (pointer_type_class); if (code == REFERENCE_TYPE) - return gen_rtx (CONST_INT, VOIDmode, reference_type_class); + return GEN_INT (reference_type_class); if (code == OFFSET_TYPE) - return gen_rtx (CONST_INT, VOIDmode, offset_type_class); + return GEN_INT (offset_type_class); if (code == REAL_TYPE) - return gen_rtx (CONST_INT, VOIDmode, real_type_class); + return GEN_INT (real_type_class); if (code == COMPLEX_TYPE) - return gen_rtx (CONST_INT, VOIDmode, complex_type_class); + return GEN_INT (complex_type_class); if (code == FUNCTION_TYPE) - return gen_rtx (CONST_INT, VOIDmode, function_type_class); + return GEN_INT (function_type_class); if (code == METHOD_TYPE) - return gen_rtx (CONST_INT, VOIDmode, method_type_class); + return GEN_INT (method_type_class); if (code == RECORD_TYPE) - return gen_rtx (CONST_INT, VOIDmode, record_type_class); + return GEN_INT (record_type_class); if (code == UNION_TYPE) - return gen_rtx (CONST_INT, VOIDmode, union_type_class); + return GEN_INT (union_type_class); if (code == ARRAY_TYPE) - return gen_rtx (CONST_INT, VOIDmode, array_type_class); + return GEN_INT (array_type_class); if (code == STRING_TYPE) - return gen_rtx (CONST_INT, VOIDmode, string_type_class); + return GEN_INT (string_type_class); if (code == SET_TYPE) - return gen_rtx (CONST_INT, VOIDmode, set_type_class); + return GEN_INT (set_type_class); if (code == FILE_TYPE) - return gen_rtx (CONST_INT, VOIDmode, file_type_class); + return GEN_INT (file_type_class); if (code == LANG_TYPE) - return gen_rtx (CONST_INT, VOIDmode, lang_type_class); + return GEN_INT (lang_type_class); } - return gen_rtx (CONST_INT, VOIDmode, no_type_class); + return GEN_INT (no_type_class); case BUILT_IN_CONSTANT_P: if (arglist == 0) @@ -5317,14 +5308,14 @@ expand_builtin (exp, target, subtarget, mode, ignore) return const0_rtx; current_function_calls_alloca = 1; /* Compute the argument. */ - op0 = expand_expr (TREE_VALUE (arglist), 0, VOIDmode, 0); + op0 = expand_expr (TREE_VALUE (arglist), NULL_RTX, VOIDmode, 0); /* Allocate the desired space. */ target = allocate_dynamic_stack_space (op0, target, BITS_PER_UNIT); /* Record the new stack level for nonlocal gotos. */ if (nonlocal_goto_handler_slot != 0) - emit_stack_save (SAVE_NONLOCAL, &nonlocal_goto_stack_level, 0); + emit_stack_save (SAVE_NONLOCAL, &nonlocal_goto_stack_level, NULL_RTX); return target; case BUILT_IN_FFS: @@ -5403,7 +5394,7 @@ expand_builtin (exp, target, subtarget, mode, ignore) result = gen_reg_rtx (insn_mode); src_rtx = memory_address (BLKmode, - expand_expr (src, 0, Pmode, + expand_expr (src, NULL_RTX, Pmode, EXPAND_NORMAL)); if (! (*insn_operand_predicate[(int)icode][1]) (src_rtx, Pmode)) src_rtx = copy_to_mode_reg (Pmode, src_rtx); @@ -5415,8 +5406,7 @@ expand_builtin (exp, target, subtarget, mode, ignore) emit_insn (GEN_FCN (icode) (result, gen_rtx (MEM, BLKmode, src_rtx), - char_rtx, - gen_rtx (CONST_INT, VOIDmode, align))); + char_rtx, GEN_INT (align))); /* Return the value in the proper mode for this function. */ if (GET_MODE (result) == value_mode) @@ -5450,7 +5440,7 @@ expand_builtin (exp, target, subtarget, mode, ignore) len = size_binop (PLUS_EXPR, len, integer_one_node); - chainon (arglist, build_tree_list (0, len)); + chainon (arglist, build_tree_list (NULL_TREE, len)); } /* Drops in. */ @@ -5488,16 +5478,17 @@ expand_builtin (exp, target, subtarget, mode, ignore) break; } - dest_rtx = expand_expr (dest, 0, Pmode, EXPAND_NORMAL); + dest_rtx = expand_expr (dest, NULL_RTX, Pmode, EXPAND_NORMAL); /* Copy word part most expediently. */ emit_block_move (gen_rtx (MEM, BLKmode, memory_address (BLKmode, dest_rtx)), gen_rtx (MEM, BLKmode, memory_address (BLKmode, - expand_expr (src, 0, Pmode, + expand_expr (src, NULL_RTX, + Pmode, EXPAND_NORMAL))), - expand_expr (len, 0, VOIDmode, 0), + expand_expr (len, NULL_RTX, VOIDmode, 0), MIN (src_align, dest_align)); return dest_rtx; } @@ -5555,7 +5546,7 @@ expand_builtin (exp, target, subtarget, mode, ignore) len = len2; } - chainon (arglist, build_tree_list (0, len)); + chainon (arglist, build_tree_list (NULL_TREE, len)); } /* Drops in. */ @@ -5604,12 +5595,13 @@ expand_builtin (exp, target, subtarget, mode, ignore) emit_insn (gen_cmpstrsi (result, gen_rtx (MEM, BLKmode, - expand_expr (arg1, 0, Pmode, EXPAND_NORMAL)), + expand_expr (arg1, NULL_RTX, Pmode, + EXPAND_NORMAL)), gen_rtx (MEM, BLKmode, - expand_expr (arg2, 0, Pmode, EXPAND_NORMAL)), - expand_expr (len, 0, VOIDmode, 0), - gen_rtx (CONST_INT, VOIDmode, - MIN (arg1_align, arg2_align)))); + expand_expr (arg2, NULL_RTX, Pmode, + EXPAND_NORMAL)), + expand_expr (len, NULL_RTX, VOIDmode, 0), + GEN_INT (MIN (arg1_align, arg2_align)))); /* Return the value in the proper mode for this function. */ mode = TYPE_MODE (TREE_TYPE (exp)); @@ -5670,10 +5662,10 @@ expand_increment (exp, post) I believe it is a copy iff it is a register or subreg and insns were generated in computing it. */ temp = get_last_insn (); - op0 = expand_expr (incremented, 0, VOIDmode, 0); + op0 = expand_expr (incremented, NULL_RTX, VOIDmode, 0); op0_is_copy = ((GET_CODE (op0) == SUBREG || GET_CODE (op0) == REG) && temp != get_last_insn ()); - op1 = expand_expr (TREE_OPERAND (exp, 1), 0, VOIDmode, 0); + op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0); /* Decide whether incrementing or decrementing. */ if (TREE_CODE (exp) == POSTDECREMENT_EXPR @@ -5705,7 +5697,7 @@ expand_increment (exp, post) if (this_optab == sub_optab && GET_CODE (op1) == CONST_INT) { - op1 = gen_rtx (CONST_INT, VOIDmode, - INTVAL (op1)); + op1 = GEN_INT (- INTVAL (op1)); this_optab = add_optab; } @@ -5784,7 +5776,7 @@ preexpand_calls (exp) if (TREE_CODE (TREE_OPERAND (exp, 0)) != ADDR_EXPR || TREE_CODE (TREE_OPERAND (TREE_OPERAND (exp, 0), 0)) != FUNCTION_DECL || ! DECL_BUILT_IN (TREE_OPERAND (TREE_OPERAND (exp, 0), 0))) - CALL_EXPR_RTL (exp) = expand_call (exp, 0, 0); + CALL_EXPR_RTL (exp) = expand_call (exp, NULL_RTX, 0); return; case COMPOUND_EXPR: @@ -5851,7 +5843,7 @@ do_pending_stack_adjust () if (inhibit_defer_pop == 0) { if (pending_stack_adjust != 0) - adjust_stack (gen_rtx (CONST_INT, VOIDmode, pending_stack_adjust)); + adjust_stack (GEN_INT (pending_stack_adjust)); pending_stack_adjust = 0; } } @@ -5865,7 +5857,7 @@ expand_cleanups_to (old_cleanups) { while (cleanups_this_call != old_cleanups) { - expand_expr (TREE_VALUE (cleanups_this_call), 0, VOIDmode, 0); + expand_expr (TREE_VALUE (cleanups_this_call), NULL_RTX, VOIDmode, 0); cleanups_this_call = TREE_CHAIN (cleanups_this_call); } } @@ -5881,7 +5873,7 @@ jumpifnot (exp, label) tree exp; rtx label; { - do_jump (exp, label, 0); + do_jump (exp, label, NULL_RTX); } /* Generate code to evaluate EXP and jump to LABEL if the value is nonzero. */ @@ -5891,7 +5883,7 @@ jumpif (exp, label) tree exp; rtx label; { - do_jump (exp, 0, label); + do_jump (exp, NULL_RTX, label); } /* Generate code to evaluate EXP and jump to IF_FALSE_LABEL if @@ -5994,7 +5986,7 @@ do_jump (exp, if_false_label, if_true_label) if (! SLOW_BYTE_ACCESS && TREE_CODE (TREE_OPERAND (exp, 1)) == INTEGER_CST - && TYPE_PRECISION (TREE_TYPE (exp)) <= HOST_BITS_PER_INT + && TYPE_PRECISION (TREE_TYPE (exp)) <= HOST_BITS_PER_WIDE_INT && (i = floor_log2 (TREE_INT_CST_LOW (TREE_OPERAND (exp, 1)))) >= 0 && (type = type_for_size (i + 1, 1)) != 0 && TYPE_PRECISION (type) < TYPE_PRECISION (TREE_TYPE (exp)) @@ -6013,14 +6005,14 @@ do_jump (exp, if_false_label, if_true_label) case TRUTH_ANDIF_EXPR: if (if_false_label == 0) if_false_label = drop_through_label = gen_label_rtx (); - do_jump (TREE_OPERAND (exp, 0), if_false_label, 0); + do_jump (TREE_OPERAND (exp, 0), if_false_label, NULL_RTX); do_jump (TREE_OPERAND (exp, 1), if_false_label, if_true_label); break; case TRUTH_ORIF_EXPR: if (if_true_label == 0) if_true_label = drop_through_label = gen_label_rtx (); - do_jump (TREE_OPERAND (exp, 0), 0, if_true_label); + do_jump (TREE_OPERAND (exp, 0), NULL_RTX, if_true_label); do_jump (TREE_OPERAND (exp, 1), if_false_label, if_true_label); break; @@ -6074,7 +6066,7 @@ do_jump (exp, if_false_label, if_true_label) { register rtx label1 = gen_label_rtx (); drop_through_label = gen_label_rtx (); - do_jump (TREE_OPERAND (exp, 0), label1, 0); + do_jump (TREE_OPERAND (exp, 0), label1, NULL_RTX); /* Now the THEN-expression. */ do_jump (TREE_OPERAND (exp, 1), if_false_label ? if_false_label : drop_through_label, @@ -6151,7 +6143,7 @@ do_jump (exp, if_false_label, if_true_label) default: normal: - temp = expand_expr (exp, 0, VOIDmode, 0); + temp = expand_expr (exp, NULL_RTX, VOIDmode, 0); #if 0 /* This is not needed any more and causes poor code since it causes comparisons and tests from non-SI objects to have different code @@ -6172,7 +6164,7 @@ do_jump (exp, if_false_label, if_true_label) do_jump_by_parts_equality_rtx (temp, if_true_label, if_false_label); else if (GET_MODE (temp) != VOIDmode) comparison = compare_from_rtx (temp, CONST0_RTX (GET_MODE (temp)), - NE, 1, GET_MODE (temp), 0, 0); + NE, 1, GET_MODE (temp), NULL_RTX, 0); else abort (); } @@ -6220,8 +6212,8 @@ do_jump_by_parts_greater (exp, swap, if_false_label, if_true_label) int swap; rtx if_false_label, if_true_label; { - rtx op0 = expand_expr (TREE_OPERAND (exp, swap), 0, VOIDmode, 0); - rtx op1 = expand_expr (TREE_OPERAND (exp, !swap), 0, VOIDmode, 0); + rtx op0 = expand_expr (TREE_OPERAND (exp, swap), NULL_RTX, VOIDmode, 0); + rtx op1 = expand_expr (TREE_OPERAND (exp, !swap), NULL_RTX, VOIDmode, 0); enum machine_mode mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0))); int nwords = (GET_MODE_SIZE (mode) / UNITS_PER_WORD); rtx drop_through_label = 0; @@ -6255,19 +6247,19 @@ do_jump_by_parts_greater (exp, swap, if_false_label, if_true_label) /* All but high-order word must be compared as unsigned. */ comp = compare_from_rtx (op0_word, op1_word, (unsignedp || i > 0) ? GTU : GT, - unsignedp, word_mode, 0, 0); + unsignedp, word_mode, NULL_RTX, 0); if (comp == const_true_rtx) emit_jump (if_true_label); else if (comp != const0_rtx) - do_jump_for_compare (comp, 0, if_true_label); + do_jump_for_compare (comp, NULL_RTX, if_true_label); /* Consider lower words only if these are equal. */ comp = compare_from_rtx (op0_word, op1_word, NE, unsignedp, word_mode, - 0, 0); + NULL_RTX, 0); if (comp == const_true_rtx) emit_jump (if_false_label); else if (comp != const0_rtx) - do_jump_for_compare (comp, 0, if_false_label); + do_jump_for_compare (comp, NULL_RTX, if_false_label); } if (if_false_label) @@ -6284,8 +6276,8 @@ do_jump_by_parts_equality (exp, if_false_label, if_true_label) tree exp; rtx if_false_label, if_true_label; { - rtx op0 = expand_expr (TREE_OPERAND (exp, 0), 0, VOIDmode, 0); - rtx op1 = expand_expr (TREE_OPERAND (exp, 1), 0, VOIDmode, 0); + rtx op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, VOIDmode, 0); + rtx op1 = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0); enum machine_mode mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0))); int nwords = (GET_MODE_SIZE (mode) / UNITS_PER_WORD); int i; @@ -6298,11 +6290,11 @@ do_jump_by_parts_equality (exp, if_false_label, if_true_label) { rtx comp = compare_from_rtx (operand_subword_force (op0, i, mode), operand_subword_force (op1, i, mode), - EQ, 0, word_mode, 0, 0); + EQ, 0, word_mode, NULL_RTX, 0); if (comp == const_true_rtx) emit_jump (if_false_label); else if (comp != const0_rtx) - do_jump_for_compare (comp, if_false_label, 0); + do_jump_for_compare (comp, if_false_label, NULL_RTX); } if (if_true_label) @@ -6331,11 +6323,11 @@ do_jump_by_parts_equality_rtx (op0, if_false_label, if_true_label) { rtx comp = compare_from_rtx (operand_subword_force (op0, i, GET_MODE (op0)), - const0_rtx, EQ, 0, word_mode, 0, 0); + const0_rtx, EQ, 0, word_mode, NULL_RTX, 0); if (comp == const_true_rtx) emit_jump (if_false_label); else if (comp != const0_rtx) - do_jump_for_compare (comp, if_false_label, 0); + do_jump_for_compare (comp, if_false_label, NULL_RTX); } if (if_true_label) @@ -6422,8 +6414,10 @@ compare (exp, signed_code, unsigned_code) register tree exp; enum rtx_code signed_code, unsigned_code; { - register rtx op0 = expand_expr (TREE_OPERAND (exp, 0), 0, VOIDmode, 0); - register rtx op1 = expand_expr (TREE_OPERAND (exp, 1), 0, VOIDmode, 0); + register rtx op0 + = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, VOIDmode, 0); + register rtx op1 + = expand_expr (TREE_OPERAND (exp, 1), NULL_RTX, VOIDmode, 0); register tree type = TREE_TYPE (TREE_OPERAND (exp, 0)); register enum machine_mode mode = TYPE_MODE (type); int unsignedp = TREE_UNSIGNED (type); @@ -6431,7 +6425,7 @@ compare (exp, signed_code, unsigned_code) return compare_from_rtx (op0, op1, code, unsignedp, mode, ((mode == BLKmode) - ? expr_size (TREE_OPERAND (exp, 0)) : 0), + ? expr_size (TREE_OPERAND (exp, 0)) : NULL_RTX), TYPE_ALIGN (TREE_TYPE (exp)) / BITS_PER_UNIT); } @@ -6482,12 +6476,11 @@ compare_from_rtx (op0, op1, code, unsignedp, mode, size, align) sign-extension is. If we are comparing against a constant, we must convert it to what it would look like unsigned. */ if ((code == EQ || code == NE) && ! unsignedp - && GET_MODE_BITSIZE (GET_MODE (op0)) <= HOST_BITS_PER_INT) + && GET_MODE_BITSIZE (GET_MODE (op0)) <= HOST_BITS_PER_WIDE_INT) { if (GET_CODE (op1) == CONST_INT && (INTVAL (op1) & GET_MODE_MASK (GET_MODE (op0))) != INTVAL (op1)) - op1 = gen_rtx (CONST_INT, VOIDmode, - INTVAL (op1) & GET_MODE_MASK (GET_MODE (op0))); + op1 = GEN_INT (INTVAL (op1) & GET_MODE_MASK (GET_MODE (op0))); unsignedp = 1; } @@ -6618,10 +6611,10 @@ do_store_flag (exp, target, mode, only_cheap) if ((code == NE || code == EQ) && TREE_CODE (arg0) == BIT_AND_EXPR && integer_zerop (arg1) && integer_pow2p (TREE_OPERAND (arg0, 1)) - && TYPE_PRECISION (type) <= HOST_BITS_PER_INT) + && TYPE_PRECISION (type) <= HOST_BITS_PER_WIDE_INT) { int bitnum = exact_log2 (INTVAL (expand_expr (TREE_OPERAND (arg0, 1), - 0, VOIDmode, 0))); + NULL_RTX, VOIDmode, 0))); if (subtarget == 0 || GET_CODE (subtarget) != REG || GET_MODE (subtarget) != operand_mode @@ -6678,7 +6671,7 @@ do_store_flag (exp, target, mode, only_cheap) subtarget = 0; op0 = expand_expr (arg0, subtarget, VOIDmode, 0); - op1 = expand_expr (arg1, 0, VOIDmode, 0); + op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); if (target == 0) target = gen_reg_rtx (mode); @@ -6700,7 +6693,8 @@ do_store_flag (exp, target, mode, only_cheap) target = gen_reg_rtx (GET_MODE (target)); emit_move_insn (target, invert ? const0_rtx : const1_rtx); - result = compare_from_rtx (op0, op1, code, unsignedp, operand_mode, 0, 0); + result = compare_from_rtx (op0, op1, code, unsignedp, + operand_mode, NULL_RTX, 0); if (GET_CODE (result) == CONST_INT) return (((result == const0_rtx && ! invert) || (result != const0_rtx && invert)) @@ -6745,7 +6739,7 @@ do_tablejump (index, mode, range, table_label, default_label) or equal to the minimum value of the range and less than or equal to the maximum value of the range. */ - emit_cmp_insn (range, index, LTU, 0, mode, 0, 0); + emit_cmp_insn (range, index, LTU, NULL_RTX, mode, 0, 0); emit_jump_insn (gen_bltu (default_label)); /* If index is in range, it must fit in Pmode. @@ -6765,8 +6759,7 @@ do_tablejump (index, mode, range, table_label, default_label) (CASE_VECTOR_MODE, gen_rtx (PLUS, Pmode, gen_rtx (MULT, Pmode, index, - gen_rtx (CONST_INT, VOIDmode, - GET_MODE_SIZE (CASE_VECTOR_MODE))), + GEN_INT (GET_MODE_SIZE (CASE_VECTOR_MODE))), gen_rtx (LABEL_REF, Pmode, table_label))); temp = gen_reg_rtx (CASE_VECTOR_MODE); vector = gen_rtx (MEM, CASE_VECTOR_MODE, index); diff --git a/gcc/final.c b/gcc/final.c index 2aa09f85221..d05aa70d24b 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -283,8 +283,7 @@ end_final (filename) assemble_integer (gen_rtx (SYMBOL_REF, Pmode, name), UNITS_PER_WORD, 1); ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 2); assemble_integer (gen_rtx (SYMBOL_REF, Pmode, name), UNITS_PER_WORD, 1); - assemble_integer (gen_rtx (CONST_INT, VOIDmode, count_basic_blocks), - UNITS_PER_WORD, 1); + assemble_integer (GEN_INT (count_basic_blocks), UNITS_PER_WORD, 1); assemble_integer (const0_rtx, UNITS_PER_WORD, 1); ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 3); assemble_integer (gen_rtx (SYMBOL_REF, Pmode, name), UNITS_PER_WORD, 1); @@ -600,7 +599,8 @@ asm_insn_count (body) char *template; int count = 1; - for (template = decode_asm_operands (body, 0, 0, 0, 0); + for (template = decode_asm_operands (body, NULL_PTR, NULL_PTR, + NULL_PTR, NULL_PTR); *template; template++) if (*template == ';' || *template == '\n') count++; @@ -1174,7 +1174,7 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) of the insn that branched here. So recover the cc status from the insn that set it. */ - note = find_reg_note (insn, REG_CC_SETTER, 0); + note = find_reg_note (insn, REG_CC_SETTER, NULL_RTX); if (note) { NOTICE_UPDATE_CC (PATTERN (XEXP (note, 0)), XEXP (note, 0)); @@ -1277,7 +1277,8 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) } /* Get out the operand values. */ - string = decode_asm_operands (body, ops, 0, 0, 0); + string = decode_asm_operands (body, ops, NULL_PTR, + NULL_PTR, NULL_PTR); /* Inhibit aborts on what would otherwise be compiler bugs. */ insn_noperands = noperands; this_is_asm_operands = insn; @@ -1982,7 +1983,13 @@ output_asm_insn (template, operands) else if (letter == 'n') { if (GET_CODE (operands[c]) == CONST_INT) - fprintf (asm_out_file, "%d", - INTVAL (operands[c])); + fprintf (asm_out_file, +#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT + "%d", +#else + "%ld", +#endif + - INTVAL (operands[c])); else { putc ('-', asm_out_file); @@ -2009,7 +2016,7 @@ output_asm_insn (template, operands) The PRINT_OPERAND macro decides what is actually done. */ #ifdef PRINT_OPERAND_PUNCT_VALID_P else if (PRINT_OPERAND_PUNCT_VALID_P (*p)) - output_operand (0, *p++); + output_operand (NULL_RTX, *p++); #endif else output_operand_lossage ("invalid %%-code"); @@ -2123,7 +2130,13 @@ output_addr_const (file, x) break; case CONST_INT: - fprintf (file, "%d", INTVAL (x)); + fprintf (file, +#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT + "%d", +#else + "%ld", +#endif + INTVAL (x)); break; case CONST: @@ -2135,12 +2148,31 @@ output_addr_const (file, x) case CONST_DOUBLE: if (GET_MODE (x) == VOIDmode) { - /* We can use %d if the number is <32 bits and positive. */ + /* We can use %d if the number is one word and positive. */ if (CONST_DOUBLE_HIGH (x) || CONST_DOUBLE_LOW (x) < 0) - fprintf (file, "0x%x%08x", + fprintf (file, +#if HOST_BITS_PER_WIDE_INT == 64 +#if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT + " 0x%lx%016lx", +#else + " 0x%x%016x", +#endif +#else +#if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT + " 0x%lx%08lx", +#else + " 0x%x%08x", +#endif +#endif CONST_DOUBLE_HIGH (x), CONST_DOUBLE_LOW (x)); else - fprintf (file, "%d", CONST_DOUBLE_LOW (x)); + fprintf (file, +#if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT + "%d", +#else + "%ld", +#endif + CONST_DOUBLE_LOW (x)); } else /* We can't handle floating point constants; @@ -2320,27 +2352,27 @@ split_double (value, first, second) /* In an integer, the words are defined as most and least significant. So order them by the target's convention. */ #if WORDS_BIG_ENDIAN - *first = gen_rtx (CONST_INT, VOIDmode, CONST_DOUBLE_HIGH (value)); - *second = gen_rtx (CONST_INT, VOIDmode, CONST_DOUBLE_LOW (value)); + *first = GEN_INT (CONST_DOUBLE_HIGH (value)); + *second = GEN_INT (CONST_DOUBLE_LOW (value)); #else - *first = gen_rtx (CONST_INT, VOIDmode, CONST_DOUBLE_LOW (value)); - *second = gen_rtx (CONST_INT, VOIDmode, CONST_DOUBLE_HIGH (value)); + *first = GEN_INT (CONST_DOUBLE_LOW (value)); + *second = GEN_INT (CONST_DOUBLE_HIGH (value)); #endif } else { if ((HOST_FLOAT_FORMAT != TARGET_FLOAT_FORMAT - || HOST_BITS_PER_INT != BITS_PER_WORD) + || HOST_BITS_PER_WIDE_INT != BITS_PER_WORD) && ! flag_pretend_float) abort (); #if defined (HOST_WORDS_BIG_ENDIAN) == WORDS_BIG_ENDIAN /* Host and target agree => no need to swap. */ - *first = gen_rtx (CONST_INT, VOIDmode, CONST_DOUBLE_LOW (value)); - *second = gen_rtx (CONST_INT, VOIDmode, CONST_DOUBLE_HIGH (value)); + *first = GEN_INT (CONST_DOUBLE_LOW (value)); + *second = GEN_INT (CONST_DOUBLE_HIGH (value)); #else - *second = gen_rtx (CONST_INT, VOIDmode, CONST_DOUBLE_LOW (value)); - *first = gen_rtx (CONST_INT, VOIDmode, CONST_DOUBLE_HIGH (value)); + *second = GEN_INT (CONST_DOUBLE_LOW (value)); + *first = GEN_INT (CONST_DOUBLE_HIGH (value)); #endif } } diff --git a/gcc/fold-const.c b/gcc/fold-const.c index ddd5614b539..035c2292337 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -58,44 +58,47 @@ static tree const_binop (); #define BRANCH_COST 1 #endif -/* To do constant folding on INTEGER_CST nodes requires 64-bit arithmetic. - We do that by representing the 64-bit integer as 8 shorts, +/* To do constant folding on INTEGER_CST nodes requires two-word arithmetic. + We do that by representing the two-word integer as MAX_SHORTS shorts, with only 8 bits stored in each short, as a positive number. */ -/* Unpack a 64-bit integer into 8 shorts. - LOW and HI are the integer, as two `int' pieces. +/* Unpack a two-word integer into MAX_SHORTS shorts. + LOW and HI are the integer, as two `HOST_WIDE_INT' pieces. SHORTS points to the array of shorts. */ static void encode (shorts, low, hi) short *shorts; - int low, hi; + HOST_WIDE_INT low, hi; { - shorts[0] = low & 0xff; - shorts[1] = (low >> 8) & 0xff; - shorts[2] = (low >> 16) & 0xff; - shorts[3] = (low >> 24) & 0xff; - shorts[4] = hi & 0xff; - shorts[5] = (hi >> 8) & 0xff; - shorts[6] = (hi >> 16) & 0xff; - shorts[7] = (hi >> 24) & 0xff; + register int i; + + for (i = 0; i < MAX_SHORTS / 2; i++) + { + shorts[i] = (low >> (i * 8)) & 0xff; + shorts[i + MAX_SHORTS / 2] = (hi >> (i * 8) & 0xff); + } } -/* Pack an array of 8 shorts into a 64-bit integer. +/* Pack an array of MAX_SHORTS shorts into a two-word integer. SHORTS points to the array of shorts. - The integer is stored into *LOW and *HI as two `int' pieces. */ + The integer is stored into *LOW and *HI as two `HOST_WIDE_INT' pieces. */ static void decode (shorts, low, hi) short *shorts; - int *low, *hi; + HOST_WIDE_INT *low, *hi; { - /* The casts in the following statement should not be - needed, but they get around bugs in some C compilers. */ - *low = (((long)shorts[3] << 24) | ((long)shorts[2] << 16) - | ((long)shorts[1] << 8) | (long)shorts[0]); - *hi = (((long)shorts[7] << 24) | ((long)shorts[6] << 16) - | ((long)shorts[5] << 8) | (long)shorts[4]); + register int i; + HOST_WIDE_INT lv = 0, hv = 0; + + for (i = 0; i < MAX_SHORTS / 2; i++) + { + lv |= (HOST_WIDE_INT) shorts[i] << (i * 8); + hv |= (HOST_WIDE_INT) shorts[i + MAX_SHORTS / 2] << (i * 8); + } + + *low = lv, *hi = hv; } /* Make the integer constant T valid for its type @@ -113,66 +116,65 @@ force_fit_type (t) /* First clear all bits that are beyond the type's precision. */ - if (prec == 2 * HOST_BITS_PER_INT) + if (prec == 2 * HOST_BITS_PER_WIDE_INT) ; - else if (prec > HOST_BITS_PER_INT) + else if (prec > HOST_BITS_PER_WIDE_INT) { TREE_INT_CST_HIGH (t) - &= ~((-1) << (prec - HOST_BITS_PER_INT)); + &= ~((HOST_WIDE_INT) (-1) << (prec - HOST_BITS_PER_WIDE_INT)); } else { TREE_INT_CST_HIGH (t) = 0; - if (prec < HOST_BITS_PER_INT) - TREE_INT_CST_LOW (t) - &= ~((-1) << prec); + if (prec < HOST_BITS_PER_WIDE_INT) + TREE_INT_CST_LOW (t) &= ~((HOST_WIDE_INT) (-1) << prec); } /* If it's a signed type and value's sign bit is set, extend the sign. */ if (! TREE_UNSIGNED (TREE_TYPE (t)) - && prec != 2 * HOST_BITS_PER_INT - && (prec > HOST_BITS_PER_INT - ? TREE_INT_CST_HIGH (t) & (1 << (prec - HOST_BITS_PER_INT - 1)) - : TREE_INT_CST_LOW (t) & (1 << (prec - 1)))) + && prec != 2 * HOST_BITS_PER_WIDE_INT + && (prec > HOST_BITS_PER_WIDE_INT + ? (TREE_INT_CST_HIGH (t) + & ((HOST_WIDE_INT) 1 << (prec - HOST_BITS_PER_WIDE_INT - 1))) + : TREE_INT_CST_LOW (t) & ((HOST_WIDE_INT) 1 << (prec - 1)))) { /* Value is negative: set to 1 all the bits that are outside this type's precision. */ - if (prec > HOST_BITS_PER_INT) + if (prec > HOST_BITS_PER_WIDE_INT) { TREE_INT_CST_HIGH (t) - |= ((-1) << (prec - HOST_BITS_PER_INT)); + |= ((HOST_WIDE_INT) (-1) << (prec - HOST_BITS_PER_WIDE_INT)); } else { TREE_INT_CST_HIGH (t) = -1; - if (prec < HOST_BITS_PER_INT) - TREE_INT_CST_LOW (t) - |= ((-1) << prec); + if (prec < HOST_BITS_PER_WIDE_INT) + TREE_INT_CST_LOW (t) |= ((HOST_WIDE_INT) (-1) << prec); } } } -/* Add two 64-bit integers with 64-bit result. - Each argument is given as two `int' pieces. +/* Add two doubleword integers with doubleword result. + Each argument is given as two `HOST_WIDE_INT' pieces. One argument is L1 and H1; the other, L2 and H2. - The value is stored as two `int' pieces in *LV and *HV. + The value is stored as two `HOST_WIDE_INT' pieces in *LV and *HV. We use the 8-shorts representation internally. */ void add_double (l1, h1, l2, h2, lv, hv) - int l1, h1, l2, h2; - int *lv, *hv; + HOST_WIDE_INT l1, h1, l2, h2; + HOST_WIDE_INT *lv, *hv; { - short arg1[8]; - short arg2[8]; + short arg1[MAX_SHORTS]; + short arg2[MAX_SHORTS]; register int carry = 0; register int i; encode (arg1, l1, h1); encode (arg2, l2, h2); - for (i = 0; i < 8; i++) + for (i = 0; i < MAX_SHORTS; i++) { carry += arg1[i] + arg2[i]; arg1[i] = carry & 0xff; @@ -182,15 +184,15 @@ add_double (l1, h1, l2, h2, lv, hv) decode (arg1, lv, hv); } -/* Negate a 64-bit integers with 64-bit result. - The argument is given as two `int' pieces in L1 and H1. - The value is stored as two `int' pieces in *LV and *HV. +/* Negate a doubleword integer with doubleword result. + The argument is given as two `HOST_WIDE_INT' pieces in L1 and H1. + The value is stored as two `HOST_WIDE_INT' pieces in *LV and *HV. We use the 8-shorts representation internally. */ void neg_double (l1, h1, lv, hv) - int l1, h1; - int *lv, *hv; + HOST_WIDE_INT l1, h1; + HOST_WIDE_INT *lv, *hv; { if (l1 == 0) { @@ -204,20 +206,20 @@ neg_double (l1, h1, lv, hv) } } -/* Multiply two 64-bit integers with 64-bit result. - Each argument is given as two `int' pieces. +/* Multiply two doubleword integers with doubleword result. + Each argument is given as two `HOST_WIDE_INT' pieces. One argument is L1 and H1; the other, L2 and H2. - The value is stored as two `int' pieces in *LV and *HV. + The value is stored as two `HOST_WIDE_INT' pieces in *LV and *HV. We use the 8-shorts representation internally. */ void mul_double (l1, h1, l2, h2, lv, hv) - int l1, h1, l2, h2; - int *lv, *hv; + HOST_WIDE_INT l1, h1, l2, h2; + HOST_WIDE_INT *lv, *hv; { - short arg1[8]; - short arg2[8]; - short prod[16]; + short arg1[MAX_SHORTS]; + short arg2[MAX_SHORTS]; + short prod[MAX_SHORTS * 2]; register int carry = 0; register int i, j, k; @@ -227,14 +229,14 @@ mul_double (l1, h1, l2, h2, lv, hv) { if (l2 == 2) { - unsigned temp = l1 + l1; + unsigned HOST_WIDE_INT temp = l1 + l1; *hv = h1 * 2 + (temp < l1); *lv = temp; return; } if (l2 == 4) { - unsigned temp = l1 + l1; + unsigned HOST_WIDE_INT temp = l1 + l1; h1 = h1 * 4 + ((temp < l1) << 1); l1 = temp; temp += temp; @@ -245,7 +247,7 @@ mul_double (l1, h1, l2, h2, lv, hv) } if (l2 == 8) { - unsigned temp = l1 + l1; + unsigned HOST_WIDE_INT temp = l1 + l1; h1 = h1 * 8 + ((temp < l1) << 2); l1 = temp; temp += temp; @@ -264,8 +266,8 @@ mul_double (l1, h1, l2, h2, lv, hv) bzero (prod, sizeof prod); - for (i = 0; i < 8; i++) - for (j = 0; j < 8; j++) + for (i = 0; i < MAX_SHORTS; i++) + for (j = 0; j < MAX_SHORTS; j++) { k = i + j; carry = arg1[i] * arg2[j]; @@ -278,22 +280,24 @@ mul_double (l1, h1, l2, h2, lv, hv) } } - decode (prod, lv, hv); /* @@decode ignores prod[8] -> prod[15] */ + decode (prod, lv, hv); /* ?? decode ignores + prod[MAX_SHORTS] -> prod[MAX_SHORTS*2-1] */ } -/* Shift the 64-bit integer in L1, H1 left by COUNT places +/* Shift the doubleword integer in L1, H1 left by COUNT places keeping only PREC bits of result. Shift right if COUNT is negative. ARITH nonzero specifies arithmetic shifting; otherwise use logical shift. - Store the value as two `int' pieces in *LV and *HV. */ + Store the value as two `HOST_WIDE_INT' pieces in *LV and *HV. */ void lshift_double (l1, h1, count, prec, lv, hv, arith) - int l1, h1, count, prec; - int *lv, *hv; + HOST_WIDE_INT l1, h1; + int count, prec; + HOST_WIDE_INT *lv, *hv; int arith; { - short arg1[8]; + short arg1[MAX_SHORTS]; register int i; register int carry; @@ -311,7 +315,7 @@ lshift_double (l1, h1, count, prec, lv, hv, arith) while (count > 0) { carry = 0; - for (i = 0; i < 8; i++) + for (i = 0; i < MAX_SHORTS; i++) { carry += arg1[i] << 1; arg1[i] = carry & 0xff; @@ -323,18 +327,18 @@ lshift_double (l1, h1, count, prec, lv, hv, arith) decode (arg1, lv, hv); } -/* Shift the 64-bit integer in L1, H1 right by COUNT places +/* Shift the doubleword integer in L1, H1 right by COUNT places keeping only PREC bits of result. COUNT must be positive. ARITH nonzero specifies arithmetic shifting; otherwise use logical shift. - Store the value as two `int' pieces in *LV and *HV. */ + Store the value as two `HOST_WIDE_INT' pieces in *LV and *HV. */ void rshift_double (l1, h1, count, prec, lv, hv, arith) - int l1, h1, count, prec; - int *lv, *hv; + HOST_WIDE_INT l1, h1, count, prec; + HOST_WIDE_INT *lv, *hv; int arith; { - short arg1[8]; + short arg1[MAX_SHORTS]; register int i; register int carry; @@ -346,7 +350,7 @@ rshift_double (l1, h1, count, prec, lv, hv, arith) while (count > 0) { carry = arith && arg1[7] >> 7; - for (i = 7; i >= 0; i--) + for (i = MAX_SHORTS - 1; i >= 0; i--) { carry <<= 8; carry += arg1[i]; @@ -358,17 +362,17 @@ rshift_double (l1, h1, count, prec, lv, hv, arith) decode (arg1, lv, hv); } -/* Rotate the 64-bit integer in L1, H1 left by COUNT places +/* Rotate the doubldword integer in L1, H1 left by COUNT places keeping only PREC bits of result. Rotate right if COUNT is negative. - Store the value as two `int' pieces in *LV and *HV. */ + Store the value as two `HOST_WIDE_INT' pieces in *LV and *HV. */ void lrotate_double (l1, h1, count, prec, lv, hv) - int l1, h1, count, prec; - int *lv, *hv; + HOST_WIDE_INT l1, h1, count, prec; + HOST_WIDE_INT *lv, *hv; { - short arg1[8]; + short arg1[MAX_SHORTS]; register int i; register int carry; @@ -383,10 +387,10 @@ lrotate_double (l1, h1, count, prec, lv, hv) if (count > prec) count = prec; - carry = arg1[7] >> 7; + carry = arg1[MAX_SHORTS - 1] >> 7; while (count > 0) { - for (i = 0; i < 8; i++) + for (i = 0; i < MAX_SHORTS; i++) { carry += arg1[i] << 1; arg1[i] = carry & 0xff; @@ -398,16 +402,16 @@ lrotate_double (l1, h1, count, prec, lv, hv) decode (arg1, lv, hv); } -/* Rotate the 64-bit integer in L1, H1 left by COUNT places +/* Rotate the doubleword integer in L1, H1 left by COUNT places keeping only PREC bits of result. COUNT must be positive. - Store the value as two `int' pieces in *LV and *HV. */ + Store the value as two `HOST_WIDE_INT' pieces in *LV and *HV. */ void rrotate_double (l1, h1, count, prec, lv, hv) - int l1, h1, count, prec; - int *lv, *hv; + HOST_WIDE_INT l1, h1, count, prec; + HOST_WIDE_INT *lv, *hv; { - short arg1[8]; + short arg1[MAX_SHORTS]; register int i; register int carry; @@ -419,7 +423,7 @@ rrotate_double (l1, h1, count, prec, lv, hv) carry = arg1[0] & 1; while (count > 0) { - for (i = 7; i >= 0; i--) + for (i = MAX_SHORTS - 1; i >= 0; i--) { carry <<= 8; carry += arg1[i]; @@ -431,7 +435,7 @@ rrotate_double (l1, h1, count, prec, lv, hv) decode (arg1, lv, hv); } -/* Divide 64 bit integer LNUM, HNUM by 64 bit integer LDEN, HDEN +/* Divide doubleword integer LNUM, HNUM by doubleword integer LDEN, HDEN for a quotient (stored in *LQUO, *HQUO) and remainder (in *LREM, *HREM). CODE is a tree code for a kind of division, one of TRUNC_DIV_EXPR, FLOOR_DIV_EXPR, CEIL_DIV_EXPR, ROUND_DIV_EXPR @@ -445,12 +449,13 @@ div_and_round_double (code, uns, lquo, hquo, lrem, hrem) enum tree_code code; int uns; - int lnum_orig, hnum_orig; /* num == numerator == dividend */ - int lden_orig, hden_orig; /* den == denominator == divisor */ - int *lquo, *hquo, *lrem, *hrem; + HOST_WIDE_INT lnum_orig, hnum_orig; /* num == numerator == dividend */ + HOST_WIDE_INT lden_orig, hden_orig; /* den == denominator == divisor */ + HOST_WIDE_INT *lquo, *hquo, *lrem, *hrem; { int quo_neg = 0; - short num[9], den[8], quo[8]; /* extra element for scaling. */ + short num[MAX_SHORTS + 1]; /* extra element for scaling. */ + short den[MAX_SHORTS], quo[MAX_SHORTS]; register int i, j, work; register int carry = 0; unsigned int lnum = lnum_orig; @@ -507,7 +512,7 @@ div_and_round_double (code, uns, if (hden == 0 && ((lden << 8) >> 8) == lden) { /* simpler algorithm */ /* hnum != 0 already checked. */ - for (i = 7; i >= 0; i--) + for (i = MAX_SHORTS - 1; i >= 0; i--) { work = num[i] + (carry << 8); quo[i] = work / lden; @@ -521,12 +526,12 @@ div_and_round_double (code, uns, int quo_est, scale, num_hi_sig, den_hi_sig, quo_hi_sig; /* Find the highest non-zero divisor digit. */ - for (i = 7; ; i--) + for (i = MAX_SHORTS - 1; ; i--) if (den[i] != 0) { den_hi_sig = i; break; } - for (i = 7; ; i--) + for (i = MAX_SHORTS - 1; ; i--) if (num[i] != 0) { num_hi_sig = i; break; @@ -539,14 +544,14 @@ div_and_round_double (code, uns, scale = BASE / (den[den_hi_sig] + 1); if (scale > 1) { /* scale divisor and dividend */ carry = 0; - for (i = 0; i <= 8; i++) { + for (i = 0; i <= MAX_SHORTS - 1; i++) { work = (num[i] * scale) + carry; num[i] = work & 0xff; carry = work >> 8; if (num[i] != 0) num_hi_sig = i; } carry = 0; - for (i = 0; i <= 7; i++) { + for (i = 0; i <= MAX_SHORTS - 1; i++) { work = (den[i] * scale) + carry; den[i] = work & 0xff; carry = work >> 8; @@ -652,7 +657,8 @@ div_and_round_double (code, uns, if (quo_neg && (*lrem != 0 || *hrem != 0)) /* ratio < 0 && rem != 0 */ { /* quo = quo - 1; */ - add_double (*lquo, *hquo, -1, -1, lquo, hquo); + add_double (*lquo, *hquo, (HOST_WIDE_INT) -1, (HOST_WIDE_INT) -1, + lquo, hquo); } else return; break; @@ -661,7 +667,8 @@ div_and_round_double (code, uns, case CEIL_MOD_EXPR: /* round toward positive infinity */ if (!quo_neg && (*lrem != 0 || *hrem != 0)) /* ratio > 0 && rem != 0 */ { - add_double (*lquo, *hquo, 1, 0, lquo, hquo); + add_double (*lquo, *hquo, (HOST_WIDE_INT) 1, (HOST_WIDE_INT) 0, + lquo, hquo); } else return; break; @@ -669,25 +676,31 @@ div_and_round_double (code, uns, case ROUND_DIV_EXPR: case ROUND_MOD_EXPR: /* round to closest integer */ { - int labs_rem = *lrem, habs_rem = *hrem; - int labs_den = lden, habs_den = hden, ltwice, htwice; + HOST_WIDE_INT labs_rem = *lrem, habs_rem = *hrem; + HOST_WIDE_INT labs_den = lden, habs_den = hden, ltwice, htwice; /* get absolute values */ if (*hrem < 0) neg_double (*lrem, *hrem, &labs_rem, &habs_rem); if (hden < 0) neg_double (lden, hden, &labs_den, &habs_den); /* if (2 * abs (lrem) >= abs (lden)) */ - mul_double (2, 0, labs_rem, habs_rem, <wice, &htwice); - if (((unsigned) habs_den < (unsigned) htwice) - || (((unsigned) habs_den == (unsigned) htwice) - && ((unsigned) labs_den < (unsigned) ltwice))) + mul_double ((HOST_WIDE_INT) 2, (HOST_WIDE_INT) 0, + labs_rem, habs_rem, <wice, &htwice); + if (((unsigned HOST_WIDE_INT) habs_den + < (unsigned HOST_WIDE_INT) htwice) + || (((unsigned HOST_WIDE_INT) habs_den + == (unsigned HOST_WIDE_INT) htwice) + && ((HOST_WIDE_INT unsigned) labs_den + < (unsigned HOST_WIDE_INT) ltwice))) { if (*hquo < 0) /* quo = quo - 1; */ - add_double (*lquo, *hquo, -1, -1, lquo, hquo); + add_double (*lquo, *hquo, + (HOST_WIDE_INT) -1, (HOST_WIDE_INT) -1, lquo, hquo); else /* quo = quo + 1; */ - add_double (*lquo, *hquo, 1, 0, lquo, hquo); + add_double (*lquo, *hquo, (HOST_WIDE_INT) 1, (HOST_WIDE_INT) 0, + lquo, hquo); } else return; } @@ -728,7 +741,7 @@ real_value_truncate (mode, arg) } set_float_handler (handler); value = REAL_VALUE_TRUNCATE (mode, arg); - set_float_handler (0); + set_float_handler (NULL_PTR); return value; } @@ -981,12 +994,12 @@ const_binop (code, arg1, arg2) { if (TREE_CODE (arg1) == INTEGER_CST) { - register int int1l = TREE_INT_CST_LOW (arg1); - register int int1h = TREE_INT_CST_HIGH (arg1); - int int2l = TREE_INT_CST_LOW (arg2); - int int2h = TREE_INT_CST_HIGH (arg2); - int low, hi; - int garbagel, garbageh; + register HOST_WIDE_INT int1l = TREE_INT_CST_LOW (arg1); + register HOST_WIDE_INT int1h = TREE_INT_CST_HIGH (arg1); + HOST_WIDE_INT int2l = TREE_INT_CST_LOW (arg2); + HOST_WIDE_INT int2h = TREE_INT_CST_HIGH (arg2); + HOST_WIDE_INT low, hi; + HOST_WIDE_INT garbagel, garbageh; register tree t; int uns = TREE_UNSIGNED (TREE_TYPE (arg1)); @@ -1031,7 +1044,7 @@ const_binop (code, arg1, arg2) if (int1h == 0) { int2l += int1l; - if ((unsigned) int2l < int1l) + if ((unsigned HOST_WIDE_INT) int2l < int1l) int2h += 1; t = build_int_2 (int2l, int2h); break; @@ -1039,7 +1052,7 @@ const_binop (code, arg1, arg2) if (int2h == 0) { int1l += int2l; - if ((unsigned) int1l < int2l) + if ((unsigned HOST_WIDE_INT) int1l < int2l) int1h += 1; t = build_int_2 (int1l, int1h); break; @@ -1063,7 +1076,7 @@ const_binop (code, arg1, arg2) /* Optimize simple cases. */ if (int1h == 0) { - unsigned temp; + unsigned HOST_WIDE_INT temp; switch (int1l) { @@ -1168,15 +1181,19 @@ const_binop (code, arg1, arg2) case MAX_EXPR: if (uns) { - low = (((unsigned) int1h < (unsigned) int2h) - || (((unsigned) int1h == (unsigned) int2h) - && ((unsigned) int1l < (unsigned) int2l))); + low = (((unsigned HOST_WIDE_INT) int1h + < (unsigned HOST_WIDE_INT) int2h) + || (((unsigned HOST_WIDE_INT) int1h + == (unsigned HOST_WIDE_INT) int2h) + && ((unsigned HOST_WIDE_INT) int1l + < (unsigned HOST_WIDE_INT) int2l))); } else { low = ((int1h < int2h) || ((int1h == int2h) - && ((unsigned) int1l < (unsigned) int2l))); + && ((unsigned HOST_WIDE_INT) int1l + < (unsigned HOST_WIDE_INT) int2l))); } if (low == (code == MIN_EXPR)) t = build_int_2 (int1l, int1h); @@ -1249,7 +1266,7 @@ const_binop (code, arg1, arg2) #endif /* no REAL_ARITHMETIC */ t = build_real (TREE_TYPE (arg1), real_value_truncate (TYPE_MODE (TREE_TYPE (arg1)), value)); - set_float_handler (0); + set_float_handler (NULL_PTR); return t; } #endif /* not REAL_IS_NOT_DOUBLE, or REAL_ARITHMETIC */ @@ -1318,11 +1335,12 @@ size_int (number) { register tree t; /* Type-size nodes already made for small sizes. */ - static tree size_table[2*HOST_BITS_PER_INT+1]; + static tree size_table[2*HOST_BITS_PER_WIDE_INT + 1]; - if (number >= 0 && number < 2*HOST_BITS_PER_INT+1 && size_table[number] != 0) + if (number >= 0 && number < 2*HOST_BITS_PER_WIDE_INT + 1 + && size_table[number] != 0) return size_table[number]; - if (number >= 0 && number < 2*HOST_BITS_PER_INT+1) + if (number >= 0 && number < 2*HOST_BITS_PER_WIDE_INT + 1) { push_obstacks_nochange (); /* Make this a permanent node. */ @@ -1423,23 +1441,24 @@ fold_convert (t, arg1) #ifndef REAL_ARITHMETIC { REAL_VALUE_TYPE d; - int low, high; - int half_word = 1 << (HOST_BITS_PER_INT / 2); + HOST_WIDE_INT low, high; + HOST_WIDE_INT half_word + = (HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT / 2); d = TREE_REAL_CST (arg1); if (d < 0) d = -d; - high = (int) (d / half_word / half_word); + high = (HOST_WIDE_INT) (d / half_word / half_word); d -= (REAL_VALUE_TYPE) high * half_word * half_word; - low = (unsigned) d; + low = (unsigned HOST_WIDE_INT) d; if (TREE_REAL_CST (arg1) < 0) neg_double (low, high, &low, &high); t = build_int_2 (low, high); } #else { - int low, high; + HOST_WIDE_INT low, high; REAL_VALUE_TO_INT (low, high, TREE_REAL_CST (arg1)); t = build_int_2 (low, high); } @@ -1467,7 +1486,7 @@ fold_convert (t, arg1) t = build_real (type, real_value_truncate (TYPE_MODE (type), TREE_REAL_CST (arg1))); - set_float_handler (0); + set_float_handler (NULL_PTR); return t; } } @@ -3377,16 +3396,18 @@ fold (expr) && TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (arg1, 0)))) { int prec = TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (arg1, 0))); - if (prec < BITS_PER_WORD && prec < HOST_BITS_PER_INT - && (~TREE_INT_CST_LOW (arg0) & ((1 << prec) - 1)) == 0) + if (prec < BITS_PER_WORD && prec < HOST_BITS_PER_WIDE_INT + && (~TREE_INT_CST_LOW (arg0) + & (((HOST_WIDE_INT) 1 << prec) - 1)) == 0) return build1 (NOP_EXPR, type, TREE_OPERAND (arg1, 0)); } if (TREE_CODE (arg1) == INTEGER_CST && TREE_CODE (arg0) == NOP_EXPR && TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (arg0, 0)))) { int prec = TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (arg0, 0))); - if (prec < BITS_PER_WORD && prec < HOST_BITS_PER_INT - && (~TREE_INT_CST_LOW (arg1) & ((1 << prec) - 1)) == 0) + if (prec < BITS_PER_WORD && prec < HOST_BITS_PER_WIDE_INT + && (~TREE_INT_CST_LOW (arg1) + & (((HOST_WIDE_INT) 1 << prec) - 1)) == 0) return build1 (NOP_EXPR, type, TREE_OPERAND (arg0, 0)); } goto associate; @@ -3429,7 +3450,7 @@ fold (expr) { tree new_op = build_int_2 (TREE_INT_CST_LOW (TREE_OPERAND (arg0, 1)) - / TREE_INT_CST_LOW (arg1)); + / TREE_INT_CST_LOW (arg1), 0); TREE_TYPE (new_op) = type; return build (MULT_EXPR, type, TREE_OPERAND (arg0, 0), new_op); @@ -3450,7 +3471,7 @@ fold (expr) { tree new_op = build_int_2 (TREE_INT_CST_LOW (TREE_OPERAND (TREE_OPERAND (arg0, 0), 1)) - / TREE_INT_CST_LOW (arg1)); + / TREE_INT_CST_LOW (arg1), 0); TREE_TYPE (new_op) = type; return build (MULT_EXPR, type, diff --git a/gcc/gcc.c b/gcc/gcc.c index cc18d6d7ce7..a2fc595dd01 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -47,6 +47,14 @@ compilation is specified by a string called a "spec". */ #define X_OK 1 #endif +#ifndef NULL +#define NULL 0 +#endif + +#ifndef NULL_PTR +#define NULL_PTR (char *) NULL +#endif + #ifdef USG #define vfork fork #endif /* USG */ @@ -1716,8 +1724,8 @@ process_command (argc, argv) if (gcc_exec_prefix) { - add_prefix (&exec_prefix, gcc_exec_prefix, 0, 0, 0); - add_prefix (&startfile_prefix, gcc_exec_prefix, 0, 0, 0); + add_prefix (&exec_prefix, gcc_exec_prefix, 0, 0, NULL_PTR); + add_prefix (&startfile_prefix, gcc_exec_prefix, 0, 0, NULL_PTR); } /* COMPILER_PATH and LIBRARY_PATH have values @@ -1746,7 +1754,7 @@ process_command (argc, argv) } else nstore[endp-startp] = 0; - add_prefix (&exec_prefix, nstore, 0, 0, 0); + add_prefix (&exec_prefix, nstore, 0, 0, NULL_PTR); if (*endp == 0) break; endp = startp = endp + 1; @@ -1779,9 +1787,9 @@ process_command (argc, argv) } else nstore[endp-startp] = 0; - add_prefix (&startfile_prefix, nstore, 0, 0, 0); + add_prefix (&startfile_prefix, nstore, 0, 0, NULL_PTR); /* Make separate list of dirs that came from LIBRARY_PATH. */ - add_prefix (&library_prefix, nstore, 0, 0, 0); + add_prefix (&library_prefix, nstore, 0, 0, NULL_PTR); if (*endp == 0) break; endp = startp = endp + 1; @@ -1815,9 +1823,9 @@ process_command (argc, argv) } else nstore[endp-startp] = 0; - add_prefix (&startfile_prefix, nstore, 0, 0, 0); + add_prefix (&startfile_prefix, nstore, 0, 0, NULL_PTR); /* Make separate list of dirs that came from LIBRARY_PATH. */ - add_prefix (&library_prefix, nstore, 0, 0, 0); + add_prefix (&library_prefix, nstore, 0, 0, NULL_PTR); if (*endp == 0) break; endp = startp = endp + 1; @@ -1947,11 +1955,11 @@ process_command (argc, argv) /* These come before the md prefixes so that we will find gcc's subcommands (such as cpp) rather than those of the host system. */ - add_prefix (&exec_prefix, standard_exec_prefix, 0, 1, 0); - add_prefix (&exec_prefix, standard_exec_prefix_1, 0, 1, 0); + add_prefix (&exec_prefix, standard_exec_prefix, 0, 1, NULL_PTR); + add_prefix (&exec_prefix, standard_exec_prefix_1, 0, 1, NULL_PTR); - add_prefix (&startfile_prefix, standard_exec_prefix, 0, 1, 0); - add_prefix (&startfile_prefix, standard_exec_prefix_1, 0, 1, 0); + add_prefix (&startfile_prefix, standard_exec_prefix, 0, 1, NULL_PTR); + add_prefix (&startfile_prefix, standard_exec_prefix_1, 0, 1, NULL_PTR); /* More prefixes are enabled in main, after we read the specs file and determine whether this is cross-compilation or not. */ @@ -2115,7 +2123,7 @@ do_spec (spec) this_is_output_file = 0; this_is_library_file = 0; - value = do_spec_1 (spec, 0, NULL); + value = do_spec_1 (spec, 0, NULL_PTR); /* Force out any unfinished command. If -pipe, this forces out the last command if it ended in `|'. */ @@ -2287,11 +2295,11 @@ do_spec_1 (spec, inswitch, soft_matched_part) { if (is_linker_dir (pl->prefix, machine_suffix)) { - do_spec_1 ("-L", 0, 0); + do_spec_1 ("-L", 0, NULL_PTR); #ifdef SPACE_AFTER_L_OPTION - do_spec_1 (" ", 0, 0); + do_spec_1 (" ", 0, NULL_PTR); #endif - do_spec_1 (pl->prefix, 1, 0); + do_spec_1 (pl->prefix, 1, NULL_PTR); /* Remove slash from machine_suffix. */ if (strlen (machine_suffix) >= bufsize) bufsize = strlen (machine_suffix) * 2 + 1; @@ -2300,18 +2308,18 @@ do_spec_1 (spec, inswitch, soft_matched_part) idx = strlen (buffer); if (buffer[idx - 1] == '/') buffer[idx - 1] = 0; - do_spec_1 (buffer, 1, 0); + do_spec_1 (buffer, 1, NULL_PTR); /* Make this a separate argument. */ - do_spec_1 (" ", 0, 0); + do_spec_1 (" ", 0, NULL_PTR); } } if (!pl->require_machine_suffix) { if (is_linker_dir (pl->prefix, "")) { - do_spec_1 ("-L", 0, 0); + do_spec_1 ("-L", 0, NULL_PTR); #ifdef SPACE_AFTER_L_OPTION - do_spec_1 (" ", 0, 0); + do_spec_1 (" ", 0, NULL_PTR); #endif /* Remove slash from pl->prefix. */ if (strlen (pl->prefix) >= bufsize) @@ -2321,9 +2329,9 @@ do_spec_1 (spec, inswitch, soft_matched_part) idx = strlen (buffer); if (buffer[idx - 1] == '/') buffer[idx - 1] = 0; - do_spec_1 (buffer, 1, 0); + do_spec_1 (buffer, 1, NULL_PTR); /* Make this a separate argument. */ - do_spec_1 (" ", 0, 0); + do_spec_1 (" ", 0, NULL_PTR); } } } @@ -2444,9 +2452,9 @@ do_spec_1 (spec, inswitch, soft_matched_part) case 'X': for (i = 0; i < n_linker_options; i++) { - do_spec_1 (linker_options[i], 1, NULL); + do_spec_1 (linker_options[i], 1, NULL_PTR); /* Make each accumulated option a separate argument. */ - do_spec_1 (" ", 0, NULL); + do_spec_1 (" ", 0, NULL_PTR); } break; @@ -2454,39 +2462,39 @@ do_spec_1 (spec, inswitch, soft_matched_part) a certain constant string as a spec. */ case '1': - do_spec_1 (cc1_spec, 0, NULL); + do_spec_1 (cc1_spec, 0, NULL_PTR); break; case '2': - do_spec_1 (cc1plus_spec, 0, NULL); + do_spec_1 (cc1plus_spec, 0, NULL_PTR); break; case 'a': - do_spec_1 (asm_spec, 0, NULL); + do_spec_1 (asm_spec, 0, NULL_PTR); break; case 'A': - do_spec_1 (asm_final_spec, 0, NULL); + do_spec_1 (asm_final_spec, 0, NULL_PTR); break; case 'c': - do_spec_1 (signed_char_spec, 0, NULL); + do_spec_1 (signed_char_spec, 0, NULL_PTR); break; case 'C': - do_spec_1 (cpp_spec, 0, NULL); + do_spec_1 (cpp_spec, 0, NULL_PTR); break; case 'E': - do_spec_1 (endfile_spec, 0, NULL); + do_spec_1 (endfile_spec, 0, NULL_PTR); break; case 'l': - do_spec_1 (link_spec, 0, NULL); + do_spec_1 (link_spec, 0, NULL_PTR); break; case 'L': - do_spec_1 (lib_spec, 0, NULL); + do_spec_1 (lib_spec, 0, NULL_PTR); break; case 'p': @@ -2513,7 +2521,7 @@ do_spec_1 (spec, inswitch, soft_matched_part) *x = 0; - do_spec_1 (buf, 0, NULL); + do_spec_1 (buf, 0, NULL_PTR); } break; @@ -2619,12 +2627,12 @@ do_spec_1 (spec, inswitch, soft_matched_part) *x = 0; - do_spec_1 (buf, 0, NULL); + do_spec_1 (buf, 0, NULL_PTR); } break; case 'S': - do_spec_1 (startfile_spec, 0, NULL); + do_spec_1 (startfile_spec, 0, NULL_PTR); break; /* Here we define characters other than letters and digits. */ @@ -2640,8 +2648,8 @@ do_spec_1 (spec, inswitch, soft_matched_part) break; case '*': - do_spec_1 (soft_matched_part, 1, NULL); - do_spec_1 (" ", 0, NULL); + do_spec_1 (soft_matched_part, 1, NULL_PTR); + do_spec_1 (" ", 0, NULL_PTR); break; /* Process a string found as the value of a spec given by name. @@ -2672,7 +2680,7 @@ do_spec_1 (spec, inswitch, soft_matched_part) if (sl) { if (c == '(') - do_spec_1 (name, 0, NULL); + do_spec_1 (name, 0, NULL_PTR); else { char *x = (char *) alloca (strlen (name) * 2 + 1); @@ -2705,7 +2713,7 @@ do_spec_1 (spec, inswitch, soft_matched_part) } *x = 0; - do_spec_1 (buf, 0, NULL); + do_spec_1 (buf, 0, NULL_PTR); } } @@ -2797,7 +2805,7 @@ handle_braces (p) abort (); if (negate != found - && do_spec_1 (save_string (p + 1, q - p - 2), 0, NULL) < 0) + && do_spec_1 (save_string (p + 1, q - p - 2), 0, NULL_PTR) < 0) return 0; return q; @@ -2895,7 +2903,7 @@ handle_braces (p) } else { - if (do_spec_1 (save_string (p + 1, q - p - 2), 0, NULL) < 0) + if (do_spec_1 (save_string (p + 1, q - p - 2), 0, NULL_PTR) < 0) return 0; } } @@ -2903,7 +2911,7 @@ handle_braces (p) { /* Here if a %{|...} conditional fails: output a minus sign, which means "standard output" or "standard input". */ - do_spec_1 ("-", 0, NULL); + do_spec_1 ("-", 0, NULL_PTR); } } @@ -2925,17 +2933,17 @@ give_switch (switchnum, omit_first_word) { if (!omit_first_word) { - do_spec_1 ("-", 0, NULL); - do_spec_1 (switches[switchnum].part1, 1, NULL); + do_spec_1 ("-", 0, NULL_PTR); + do_spec_1 (switches[switchnum].part1, 1, NULL_PTR); } - do_spec_1 (" ", 0, NULL); + do_spec_1 (" ", 0, NULL_PTR); if (switches[switchnum].args != 0) { char **p; for (p = switches[switchnum].args; *p; p++) { - do_spec_1 (*p, 1, NULL); - do_spec_1 (" ", 0, NULL); + do_spec_1 (*p, 1, NULL_PTR); + do_spec_1 (" ", 0, NULL_PTR); } } switches[switchnum].valid = 1; @@ -3072,23 +3080,26 @@ main (argc, argv) if (!cross_compile) { #ifdef MD_EXEC_PREFIX - add_prefix (&exec_prefix, md_exec_prefix, 0, 0, 0); - add_prefix (&startfile_prefix, md_exec_prefix, 0, 0, 0); + add_prefix (&exec_prefix, md_exec_prefix, 0, 0, NULL_PTR); + add_prefix (&startfile_prefix, md_exec_prefix, 0, 0, NULL_PTR); #endif #ifdef MD_STARTFILE_PREFIX - add_prefix (&startfile_prefix, md_startfile_prefix, 0, 0, 0); + add_prefix (&startfile_prefix, md_startfile_prefix, 0, 0, NULL_PTR); #endif #ifdef MD_STARTFILE_PREFIX_1 - add_prefix (&startfile_prefix, md_startfile_prefix_1, 0, 0, 0); + add_prefix (&startfile_prefix, md_startfile_prefix_1, 0, 0, NULL_PTR); #endif - add_prefix (&startfile_prefix, standard_startfile_prefix, 0, 0, 0); - add_prefix (&startfile_prefix, standard_startfile_prefix_1, 0, 0, 0); - add_prefix (&startfile_prefix, standard_startfile_prefix_2, 0, 0, 0); + add_prefix (&startfile_prefix, standard_startfile_prefix, 0, 0, + NULL_PTR); + add_prefix (&startfile_prefix, standard_startfile_prefix_1, 0, 0, + NULL_PTR); + add_prefix (&startfile_prefix, standard_startfile_prefix_2, 0, 0, + NULL_PTR); #if 0 /* Can cause surprises, and one can use -B./ instead. */ - add_prefix (&startfile_prefix, "./", 0, 1, 0); + add_prefix (&startfile_prefix, "./", 0, 1, NULL_PTR); #endif } @@ -3315,7 +3326,7 @@ lookup_compiler (name, length, language) language = cp->spec + 1; new = (struct compiler *) xmalloc (sizeof (struct compiler)); new->suffix = cp->suffix; - new->spec = lookup_compiler (0, 0, language)->spec; + new->spec = lookup_compiler (NULL_PTR, 0, language)->spec; return new; } /* A non-alias entry: return it. */ diff --git a/gcc/print-tree.c b/gcc/print-tree.c index 74a6026c8d3..b7aaddef7b2 100644 --- a/gcc/print-tree.c +++ b/gcc/print-tree.c @@ -79,8 +79,8 @@ print_node_brief (file, prefix, node, indent) name if any. */ if (indent > 0) fprintf (file, " "); - fprintf (file, "%s <%s %x", prefix, - tree_code_name[(int) TREE_CODE (node)], (int) node); + fprintf (file, "%s <%s ", prefix, tree_code_name[(int) TREE_CODE (node)]); + fprintf (file, HOST_PTR_PRINTF, node); if (class == 'd') { @@ -110,9 +110,21 @@ print_node_brief (file, prefix, node, indent) && TREE_INT_CST_LOW (node) != 0) fprintf (file, " -%1u", -TREE_INT_CST_LOW (node)); else - fprintf (file, " 0x%x%08x", - TREE_INT_CST_HIGH (node), - TREE_INT_CST_LOW (node)); + fprintf (file, +#if HOST_BITS_PER_WIDE_INT == 64 +#if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT + " 0x%lx%016lx", +#else + " 0x%x%016x", +#endif +#else +#if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT + " 0x%lx%08lx", +#else + " 0x%x%08x", +#endif +#endif + TREE_INT_CST_HIGH (node), TREE_INT_CST_LOW (node)); } if (TREE_CODE (node) == REAL_CST) { @@ -213,8 +225,8 @@ print_node (file, prefix, node, indent) indent_to (file, indent); /* Print the slot this node is in, and its code, and address. */ - fprintf (file, "%s <%s %x", prefix, - tree_code_name[(int) TREE_CODE (node)], (int) node); + fprintf (file, "%s <%s ", prefix, tree_code_name[(int) TREE_CODE (node)]); + fprintf (file, HOST_PTR_PRINTF, node); /* Print the name, if any. */ if (class == 'd') @@ -374,7 +386,10 @@ print_node (file, prefix, node, indent) print_rtl (file, DECL_INCOMING_RTL (node)); } else if (TREE_CODE (node) == FUNCTION_DECL) - fprintf (file, "saved-insns 0x%x", DECL_SAVED_INSNS (node)); + { + fprintf (file, "saved-insns "); + fprintf (file, HOST_PTR_PRINTF, DECL_SAVED_INSNS (node)); + } } /* Print the decl chain only if decl is at second level. */ @@ -525,9 +540,21 @@ print_node (file, prefix, node, indent) && TREE_INT_CST_LOW (node) != 0) fprintf (file, " -%1u", -TREE_INT_CST_LOW (node)); else - fprintf (file, " 0x%x%08x", - TREE_INT_CST_HIGH (node), - TREE_INT_CST_LOW (node)); + fprintf (file, +#if HOST_BITS_PER_WIDE_INT == 64 +#if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT + " 0x%lx%016lx", +#else + " 0x%x%016x", +#endif +#else +#if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT + " 0x%lx%08lx", +#else + " 0x%x%08x", +#endif +#endif + TREE_INT_CST_HIGH (node), TREE_INT_CST_LOW (node)); break; case REAL_CST: -- 2.30.2