diff options
author | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-01-01 22:22:25 +0000 |
---|---|---|
committer | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-01-01 22:22:25 +0000 |
commit | 80fabb9006953bd8adbe038b8e1182238917a1d5 (patch) | |
tree | 5db1dfd712c394d01480a188c6968a697f6d4ef4 /gcc | |
parent | ffa4ba83e7991139f3c53f6df642deadac99ddc8 (diff) | |
download | gcc-80fabb9006953bd8adbe038b8e1182238917a1d5.tar.gz |
* attribs.c (handle_vector_size_attribute): Use host_integerp
and tree_int_cst; remove warnings.
* caller-save.c (insert_restore): Add cast to get rid of warning.
(insert_save): Likewise.
* emit-rtl.c (adjust_address_1, offset_address): Likewise.
* regmove.c (find_matches): Add temporary var to kill a warning.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48452 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/attribs.c | 22 | ||||
-rw-r--r-- | gcc/caller-save.c | 9 | ||||
-rw-r--r-- | gcc/emit-rtl.c | 14 | ||||
-rw-r--r-- | gcc/regmove.c | 6 |
5 files changed, 37 insertions, 23 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dfc09c8ea44..f17fa1df6ed 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +Tue Jan 1 17:12:56 2002 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * attribs.c (handle_vector_size_attribute): Use host_integerp + and tree_int_cst; remove warnings. + * caller-save.c (insert_restore): Add cast to get rid of warning. + (insert_save): Likewise. + * emit-rtl.c (adjust_address_1, offset_address): Likewise. + * regmove.c (find_matches): Add temporary var to kill a warning. + 2002-01-01 Douglas B Rupp <rupp@gnat.com> * config/alpha/vms.h (DWARF2_UNWIND_INFO, EH_RETURN_HANDLER_RTX, diff --git a/gcc/attribs.c b/gcc/attribs.c index 73d9d39961f..19e99ad3055 100644 --- a/gcc/attribs.c +++ b/gcc/attribs.c @@ -1,6 +1,6 @@ /* Functions dealing with attribute handling, used by most front ends. - Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 - Free Software Foundation, Inc. + Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, + 2002 Free Software Foundation, Inc. This file is part of GCC. @@ -1142,20 +1142,20 @@ handle_vector_size_attribute (node, name, args, flags, no_add_attrs) int flags ATTRIBUTE_UNUSED; bool *no_add_attrs; { - unsigned int vecsize, nunits; + unsigned HOST_WIDE_INT vecsize, nunits; enum machine_mode mode, orig_mode, new_mode; tree type = *node, new_type; *no_add_attrs = true; - if (TREE_CODE (TREE_VALUE (args)) != INTEGER_CST) + if (! host_integerp (TREE_VALUE (args), 1)) { warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); return NULL_TREE; } /* Get the vector size (in bytes). */ - vecsize = TREE_INT_CST_LOW (TREE_VALUE (args)); + vecsize = tree_low_cst (TREE_VALUE (args), 1); /* We need to provide for vector pointers, vector arrays, and functions returning vectors. For example: @@ -1173,9 +1173,10 @@ handle_vector_size_attribute (node, name, args, flags, no_add_attrs) /* Get the mode of the type being modified. */ orig_mode = TYPE_MODE (type); - if (TREE_CODE (type) == RECORD_TYPE || - (GET_MODE_CLASS (orig_mode) != MODE_FLOAT - && GET_MODE_CLASS (orig_mode) != MODE_INT)) + if (TREE_CODE (type) == RECORD_TYPE + || (GET_MODE_CLASS (orig_mode) != MODE_FLOAT + && GET_MODE_CLASS (orig_mode) != MODE_INT) + || ! host_integerp (TYPE_SIZE_UNIT (type), 1)) { error ("invalid vector type for attribute `%s'", IDENTIFIER_POINTER (name)); @@ -1183,7 +1184,7 @@ handle_vector_size_attribute (node, name, args, flags, no_add_attrs) } /* Calculate how many units fit in the vector. */ - nunits = vecsize / TREE_INT_CST_LOW (TYPE_SIZE_UNIT (type)); + nunits = vecsize / tree_low_cst (TYPE_SIZE_UNIT (type), 1); /* Find a suitably sized vector. */ new_mode = VOIDmode; @@ -1192,7 +1193,8 @@ handle_vector_size_attribute (node, name, args, flags, no_add_attrs) : MODE_VECTOR_FLOAT); mode != VOIDmode; mode = GET_MODE_WIDER_MODE (mode)) - if (vecsize == GET_MODE_SIZE (mode) && nunits == GET_MODE_NUNITS (mode)) + if (vecsize == GET_MODE_SIZE (mode) + && nunits == (unsigned HOST_WIDE_INT) GET_MODE_NUNITS (mode)) { new_mode = mode; break; diff --git a/gcc/caller-save.c b/gcc/caller-save.c index 1e6e6349aa1..87a13dc0fad 100644 --- a/gcc/caller-save.c +++ b/gcc/caller-save.c @@ -1,6 +1,6 @@ /* Save and restore call-clobbered registers which are live across a call. Copyright (C) 1989, 1992, 1994, 1995, 1997, 1998, - 1999, 2000, 2001 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GCC. @@ -675,7 +675,7 @@ insert_restore (chain, before_p, regno, maxrestore, save_mode) mem = regno_save_mem [regno][numregs]; if (save_mode [regno] != VOIDmode && save_mode [regno] != GET_MODE (mem) - && numregs == HARD_REGNO_NREGS (regno, save_mode [regno])) + && numregs == (unsigned int) HARD_REGNO_NREGS (regno, save_mode [regno])) mem = adjust_address (mem, save_mode[regno], 0); pat = gen_rtx_SET (VOIDmode, gen_rtx_REG (GET_MODE (mem), @@ -691,13 +691,12 @@ insert_restore (chain, before_p, regno, maxrestore, save_mode) n_regs_saved--; } - - /* Tell our callers how many extra registers we saved/restored */ return numregs - 1; } /* Like insert_restore above, but save registers instead. */ + static int insert_save (chain, before_p, regno, to_save, save_mode) struct insn_chain *chain; @@ -752,7 +751,7 @@ insert_save (chain, before_p, regno, to_save, save_mode) mem = regno_save_mem [regno][numregs]; if (save_mode [regno] != VOIDmode && save_mode [regno] != GET_MODE (mem) - && numregs == HARD_REGNO_NREGS (regno, save_mode [regno])) + && numregs == (unsigned int) HARD_REGNO_NREGS (regno, save_mode [regno])) mem = adjust_address (mem, save_mode[regno], 0); pat = gen_rtx_SET (VOIDmode, mem, gen_rtx_REG (GET_MODE (mem), diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 8faef453c86..6efdad7cb07 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -1,6 +1,6 @@ /* Emit RTL for the GNU C-Compiler expander. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GCC. @@ -1996,7 +1996,8 @@ adjust_address_1 (memref, mode, offset, validate, adjust) lowest-order set bit in OFFSET, but don't change the alignment if OFFSET if zero. */ if (offset != 0) - memalign = MIN (memalign, (offset & -offset) * BITS_PER_UNIT); + memalign = MIN (memalign, + (unsigned int) (offset & -offset) * BITS_PER_UNIT); /* We can compute the size in a number of ways. */ if (GET_MODE (new) != BLKmode) @@ -2045,10 +2046,11 @@ offset_address (memref, offset, pow2) /* Update the alignment to reflect the offset. Reset the offset, which we don't know. */ - MEM_ATTRS (new) = get_mem_attrs (MEM_ALIAS_SET (memref), MEM_EXPR (memref), - 0, 0, MIN (MEM_ALIGN (memref), - pow2 * BITS_PER_UNIT), - GET_MODE (new)); + MEM_ATTRS (new) + = get_mem_attrs (MEM_ALIAS_SET (memref), MEM_EXPR (memref), 0, 0, + MIN (MEM_ALIGN (memref), + (unsigned int) pow2 * BITS_PER_UNIT), + GET_MODE (new)); return new; } diff --git a/gcc/regmove.c b/gcc/regmove.c index 31b935500e3..c11fbcbb15f 100644 --- a/gcc/regmove.c +++ b/gcc/regmove.c @@ -1,6 +1,6 @@ /* Move registers around to reduce number of move instructions needed. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GCC. @@ -1581,7 +1581,9 @@ find_matches (insn, matchp) case '5': case '6': case '7': case '8': case '9': { char *end; - unsigned long match = strtoul (p - 1, &end, 10); + unsigned long match_ul = strtoul (p - 1, &end, 10); + int match = match_ul; + p = end; if (match < op_no && likely_spilled[match]) |