From: Olivier Hainque Date: Mon, 14 Apr 2003 21:07:12 +0000 (+0200) Subject: expr.c (highest_pow2_factor): Return unsigned. X-Git-Tag: releases/gcc-3.4.0~7306 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9ceca3020a62d208756ff281a189ce9f955fbc80;p=thirdparty%2Fgcc.git expr.c (highest_pow2_factor): Return unsigned. * expr.c (highest_pow2_factor): Return unsigned. * expr.h (offset_address): Likewise. * emit-rtl.c (offset_address): POW2 argument now unsigned. From-SVN: r65589 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 72d5d0a6e465..0ffd927494a7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-04-14 Olivier Hainque + + * expr.c (highest_pow2_factor): Return unsigned. + * expr.h (offset_address): Likewise. + * emit-rtl.c (offset_address): POW2 argument now unsigned. + 2003-04-14 Roger Sayle * builtins.c (expand_builtin_strlen): Evaluate the lengths of diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 7b1d2ba7fb8f..058100c07726 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -2314,7 +2314,7 @@ rtx offset_address (memref, offset, pow2) rtx memref; rtx offset; - HOST_WIDE_INT pow2; + unsigned HOST_WIDE_INT pow2; { rtx new, addr = XEXP (memref, 0); @@ -2342,8 +2342,7 @@ offset_address (memref, offset, pow2) we don't know. */ MEM_ATTRS (new) = get_mem_attrs (MEM_ALIAS_SET (memref), MEM_EXPR (memref), 0, 0, - MIN (MEM_ALIGN (memref), - (unsigned HOST_WIDE_INT) pow2 * BITS_PER_UNIT), + MIN (MEM_ALIGN (memref), pow2 * BITS_PER_UNIT), GET_MODE (new)); return new; } diff --git a/gcc/expr.c b/gcc/expr.c index ad8993d3a0ec..d20342413339 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -166,8 +166,11 @@ static rtx store_field PARAMS ((rtx, HOST_WIDE_INT, tree, enum machine_mode, int, tree, int)); static rtx var_rtx PARAMS ((tree)); -static HOST_WIDE_INT highest_pow2_factor PARAMS ((tree)); -static HOST_WIDE_INT highest_pow2_factor_for_type PARAMS ((tree, tree)); + +static unsigned HOST_WIDE_INT highest_pow2_factor PARAMS ((tree)); +static unsigned HOST_WIDE_INT highest_pow2_factor_for_type PARAMS ((tree, + tree)); + static int is_aligning_offset PARAMS ((tree, tree)); static rtx expand_increment PARAMS ((tree, int, int)); static rtx do_store_flag PARAMS ((tree, rtx, enum machine_mode, int)); @@ -6335,11 +6338,11 @@ check_max_integer_computation_mode (exp) /* Return the highest power of two that EXP is known to be a multiple of. This is used in updating alignment of MEMs in array references. */ -static HOST_WIDE_INT +static unsigned HOST_WIDE_INT highest_pow2_factor (exp) tree exp; { - HOST_WIDE_INT c0, c1; + unsigned HOST_WIDE_INT c0, c1; switch (TREE_CODE (exp)) { @@ -6405,12 +6408,12 @@ highest_pow2_factor (exp) /* Similar, except that it is known that the expression must be a multiple of the alignment of TYPE. */ -static HOST_WIDE_INT +static unsigned HOST_WIDE_INT highest_pow2_factor_for_type (type, exp) tree type; tree exp; { - HOST_WIDE_INT type_align, factor; + unsigned HOST_WIDE_INT type_align, factor; factor = highest_pow2_factor (exp); type_align = TYPE_ALIGN (type) / BITS_PER_UNIT; diff --git a/gcc/expr.h b/gcc/expr.h index cf794fc7401f..214ada97bdac 100644 --- a/gcc/expr.h +++ b/gcc/expr.h @@ -642,7 +642,7 @@ extern rtx adjust_automodify_address_1 PARAMS ((rtx, enum machine_mode, /* Return a memory reference like MEMREF, but whose address is changed by adding OFFSET, an RTX, to it. POW2 is the highest power of two factor known to be in OFFSET (possibly 1). */ -extern rtx offset_address PARAMS ((rtx, rtx, HOST_WIDE_INT)); +extern rtx offset_address PARAMS ((rtx, rtx, unsigned HOST_WIDE_INT)); /* Return a memory reference like MEMREF, but with its address changed to ADDR. The caller is asserting that the actual piece of memory pointed