attribs.c (handle_vector_size_attribute): Use host_integerp and tree_int_cst; remove warnings.

* 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.

From-SVN: r48452
This commit is contained in:
Richard Kenner 2002-01-01 22:22:25 +00:00 committed by Richard Kenner
parent 16b617648e
commit 2cc2d4bbcd
5 changed files with 37 additions and 23 deletions

View File

@ -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,

View File

@ -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;

View File

@ -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),

View File

@ -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;
}

View File

@ -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])