Commit 5197bd50 by Richard Kenner Committed by Richard Kenner

alias.c (clear_reg_alias_info): Use K&R format definition.

	* alias.c (clear_reg_alias_info): Use K&R format definition.
	Avoid unsigned warning.
	* builtins.c: Use "unsigned int", not "unsigned".
	(target_char_cast): Use host_integerp and tree_low_cst.
	(expand_builtin_args_info, expand_builtin_frame_address): Likewise.
	(c_strlen): Likewise; OFFSET now HOST_WIDE_INT.
	(c_getstr): Likewise.
	(std_expand_builtin_va_arg): Use int_size_in_bytes.
	(builtin_memcpy_read_str): Avoid unsigned warning.
	(expand_builtin_memcpy): Alignments are unsigned.
	(expand_builtin_strncpy, expand_builtin_memset): Likewise.
	(expand_builtin_expect_jump): Use integer_zerop and integer_onep.
	* predict.c (expensive_function_p): LIMIT now unsigned.
	* resource.c (mark_target_live_regs): Make some vars unsigned.
	* sdbout.c: Use "unsigned int", not "unsigned".
	(MAKE_LINE_SAFE): Add cast to avoid unsigned warning.
	(sdbout_source_line): Likewise.
	(sdbout_record_type_name): Remove "const" for NAME declaration.
	* config/alpha/alpha.c (alpha_expand_block_move): Whitespace fixes.

From-SVN: r45503
parent 2e547b13
Mon Sep 10 06:47:35 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* alias.c (clear_reg_alias_info): Use K&R format definition.
Avoid unsigned warning.
* builtins.c: Use "unsigned int", not "unsigned".
(target_char_cast): Use host_integerp and tree_low_cst.
(expand_builtin_args_info, expand_builtin_frame_address): Likewise.
(c_strlen): Likewise; OFFSET now HOST_WIDE_INT.
(c_getstr): Likewise.
(std_expand_builtin_va_arg): Use int_size_in_bytes.
(builtin_memcpy_read_str): Avoid unsigned warning.
(expand_builtin_memcpy): Alignments are unsigned.
(expand_builtin_strncpy, expand_builtin_memset): Likewise.
(expand_builtin_expect_jump): Use integer_zerop and integer_onep.
* predict.c (expensive_function_p): LIMIT now unsigned.
* resource.c (mark_target_live_regs): Make some vars unsigned.
* sdbout.c: Use "unsigned int", not "unsigned".
(MAKE_LINE_SAFE): Add cast to avoid unsigned warning.
(sdbout_source_line): Likewise.
(sdbout_record_type_name): Remove "const" for NAME declaration.
* config/alpha/alpha.c (alpha_expand_block_move): Whitespace fixes.
2001-09-10 Richard Sandiford <rsandifo@redhat.com> 2001-09-10 Richard Sandiford <rsandifo@redhat.com>
* calls.c (store_one_arg): Expand comment. * calls.c (store_one_arg): Expand comment.
......
...@@ -966,12 +966,11 @@ record_base_value (regno, val, invariant) ...@@ -966,12 +966,11 @@ record_base_value (regno, val, invariant)
changes the offset. */ changes the offset. */
void void
clear_reg_alias_info (rtx reg) clear_reg_alias_info (reg)
rtx reg;
{ {
int regno = REGNO (reg); if (REGNO (reg) < reg_known_value_size)
reg_known_value[REGNO (reg)] = reg;
if (regno < reg_known_value_size)
reg_known_value[regno] = reg;
} }
/* Returns a canonical version of X, from the point of view alias /* Returns a canonical version of X, from the point of view alias
......
...@@ -74,7 +74,7 @@ tree built_in_decls[(int) END_BUILTINS]; ...@@ -74,7 +74,7 @@ tree built_in_decls[(int) END_BUILTINS];
tree (*lang_type_promotes_to) PARAMS ((tree)); tree (*lang_type_promotes_to) PARAMS ((tree));
static int get_pointer_alignment PARAMS ((tree, unsigned)); static int get_pointer_alignment PARAMS ((tree, unsigned int));
static tree c_strlen PARAMS ((tree)); static tree c_strlen PARAMS ((tree));
static const char *c_getstr PARAMS ((tree)); static const char *c_getstr PARAMS ((tree));
static rtx c_readstr PARAMS ((const char *, static rtx c_readstr PARAMS ((const char *,
...@@ -150,7 +150,7 @@ static int validate_arglist PARAMS ((tree, ...)); ...@@ -150,7 +150,7 @@ static int validate_arglist PARAMS ((tree, ...));
/* Return the alignment in bits of EXP, a pointer valued expression. /* Return the alignment in bits of EXP, a pointer valued expression.
But don't return more than MAX_ALIGN no matter what. But don't return more than MAX_ALIGN no matter what.
The alignment returned is, by default, the alignment of the thing that The alignment returned is, by default, the alignment of the thing that
EXP points to (if it is not a POINTER_TYPE, 0 is returned). EXP points to. If it is not a POINTER_TYPE, 0 is returned.
Otherwise, look at the expression to see if we can do better, i.e., if the Otherwise, look at the expression to see if we can do better, i.e., if the
expression is actually pointing at an object whose alignment is tighter. */ expression is actually pointing at an object whose alignment is tighter. */
...@@ -158,9 +158,9 @@ static int validate_arglist PARAMS ((tree, ...)); ...@@ -158,9 +158,9 @@ static int validate_arglist PARAMS ((tree, ...));
static int static int
get_pointer_alignment (exp, max_align) get_pointer_alignment (exp, max_align)
tree exp; tree exp;
unsigned max_align; unsigned int max_align;
{ {
unsigned align, inner; unsigned int align, inner;
if (TREE_CODE (TREE_TYPE (exp)) != POINTER_TYPE) if (TREE_CODE (TREE_TYPE (exp)) != POINTER_TYPE)
return 0; return 0;
...@@ -231,7 +231,8 @@ c_strlen (src) ...@@ -231,7 +231,8 @@ c_strlen (src)
tree src; tree src;
{ {
tree offset_node; tree offset_node;
int offset, max; HOST_WIDE_INT offset;
int max;
const char *ptr; const char *ptr;
src = string_constant (src, &offset_node); src = string_constant (src, &offset_node);
...@@ -263,16 +264,11 @@ c_strlen (src) ...@@ -263,16 +264,11 @@ c_strlen (src)
} }
/* We have a known offset into the string. Start searching there for /* We have a known offset into the string. Start searching there for
a null character. */ a null character if we can represent it as a single HOST_WIDE_INT. */
if (offset_node == 0) if (offset_node == 0 || ! host_integerp (offset_node, 0))
offset = 0; offset = 0;
else else
{ offset = tree_low_cst (offset_node, 0);
/* Did we get a long long offset? If so, punt. */
if (TREE_INT_CST_HIGH (offset_node) != 0)
return 0;
offset = TREE_INT_CST_LOW (offset_node);
}
/* If the offset is known to be out of bounds, warn, and call strlen at /* If the offset is known to be out of bounds, warn, and call strlen at
runtime. */ runtime. */
...@@ -299,7 +295,8 @@ c_getstr (src) ...@@ -299,7 +295,8 @@ c_getstr (src)
tree src; tree src;
{ {
tree offset_node; tree offset_node;
int offset, max; HOST_WIDE_INT offset;
int max;
const char *ptr; const char *ptr;
src = string_constant (src, &offset_node); src = string_constant (src, &offset_node);
...@@ -309,19 +306,12 @@ c_getstr (src) ...@@ -309,19 +306,12 @@ c_getstr (src)
max = TREE_STRING_LENGTH (src) - 1; max = TREE_STRING_LENGTH (src) - 1;
ptr = TREE_STRING_POINTER (src); ptr = TREE_STRING_POINTER (src);
if (!offset_node) if (offset_node == 0 || !host_integerp (offset_node, 0))
offset = 0; return ptr;
else if (TREE_CODE (offset_node) != INTEGER_CST)
offset = tree_low_cst (offset_node, 0);
if (offset < 0 || offset > max)
return 0; return 0;
else
{
/* Did we get a long long offset? If so, punt. */
if (TREE_INT_CST_HIGH (offset_node) != 0)
return 0;
offset = TREE_INT_CST_LOW (offset_node);
if (offset < 0 || offset > max)
return 0;
}
return ptr + offset; return ptr + offset;
} }
...@@ -373,11 +363,11 @@ target_char_cast (cst, p) ...@@ -373,11 +363,11 @@ target_char_cast (cst, p)
{ {
unsigned HOST_WIDE_INT val, hostval; unsigned HOST_WIDE_INT val, hostval;
if (TREE_CODE (cst) != INTEGER_CST if (!host_integerp (cst, 1)
|| CHAR_TYPE_SIZE > HOST_BITS_PER_WIDE_INT) || CHAR_TYPE_SIZE > HOST_BITS_PER_WIDE_INT)
return 1; return 1;
val = TREE_INT_CST_LOW (cst); val = tree_low_cst (cst, 1);
if (CHAR_TYPE_SIZE < HOST_BITS_PER_WIDE_INT) if (CHAR_TYPE_SIZE < HOST_BITS_PER_WIDE_INT)
val &= (((unsigned HOST_WIDE_INT) 1) << CHAR_TYPE_SIZE) - 1; val &= (((unsigned HOST_WIDE_INT) 1) << CHAR_TYPE_SIZE) - 1;
...@@ -1014,6 +1004,7 @@ expand_builtin_apply_args_1 () ...@@ -1014,6 +1004,7 @@ expand_builtin_apply_args_1 ()
possibly be used in performing a function call. The code is possibly be used in performing a function call. The code is
moved to the start of the function so the incoming values are moved to the start of the function so the incoming values are
saved. */ saved. */
static rtx static rtx
expand_builtin_apply_args () expand_builtin_apply_args ()
{ {
...@@ -1265,6 +1256,7 @@ expand_builtin_return (result) ...@@ -1265,6 +1256,7 @@ expand_builtin_return (result)
} }
/* Used by expand_builtin_classify_type and fold_builtin_classify_type. */ /* Used by expand_builtin_classify_type and fold_builtin_classify_type. */
static enum type_class static enum type_class
type_to_class (type) type_to_class (type)
tree type; tree type;
...@@ -1297,6 +1289,7 @@ type_to_class (type) ...@@ -1297,6 +1289,7 @@ type_to_class (type)
/* Expand a call to __builtin_classify_type with arguments found in /* Expand a call to __builtin_classify_type with arguments found in
ARGLIST. */ ARGLIST. */
static rtx static rtx
expand_builtin_classify_type (arglist) expand_builtin_classify_type (arglist)
tree arglist; tree arglist;
...@@ -1307,6 +1300,7 @@ expand_builtin_classify_type (arglist) ...@@ -1307,6 +1300,7 @@ expand_builtin_classify_type (arglist)
} }
/* Expand expression EXP, which is a call to __builtin_constant_p. */ /* Expand expression EXP, which is a call to __builtin_constant_p. */
static rtx static rtx
expand_builtin_constant_p (exp) expand_builtin_constant_p (exp)
tree exp; tree exp;
...@@ -1333,6 +1327,7 @@ expand_builtin_constant_p (exp) ...@@ -1333,6 +1327,7 @@ expand_builtin_constant_p (exp)
function in-line. EXP is the expression that is a call to the builtin function in-line. EXP is the expression that is a call to the builtin
function; if convenient, the result should be placed in TARGET. function; if convenient, the result should be placed in TARGET.
SUBTARGET may be used as the target for computing one of EXP's operands. */ SUBTARGET may be used as the target for computing one of EXP's operands. */
static rtx static rtx
expand_builtin_mathfn (exp, target, subtarget) expand_builtin_mathfn (exp, target, subtarget)
tree exp; tree exp;
...@@ -1789,13 +1784,16 @@ builtin_memcpy_read_str (data, offset, mode) ...@@ -1789,13 +1784,16 @@ builtin_memcpy_read_str (data, offset, mode)
{ {
const char *str = (const char *) data; const char *str = (const char *) data;
if (offset + GET_MODE_SIZE (mode) > strlen (str) + 1) if (offset < 0
|| ((unsigned HOST_WIDE_INT) offset + GET_MODE_SIZE (mode)
> strlen (str) + 1))
abort (); /* Attempt to read past the end of constant string. */ abort (); /* Attempt to read past the end of constant string. */
return c_readstr (str + offset, mode); return c_readstr (str + offset, mode);
} }
/* Expand a call to the memcpy builtin, with arguments in ARGLIST. */ /* Expand a call to the memcpy builtin, with arguments in ARGLIST. */
static rtx static rtx
expand_builtin_memcpy (arglist) expand_builtin_memcpy (arglist)
tree arglist; tree arglist;
...@@ -1810,8 +1808,9 @@ expand_builtin_memcpy (arglist) ...@@ -1810,8 +1808,9 @@ expand_builtin_memcpy (arglist)
tree len = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); tree len = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist)));
const char *src_str; const char *src_str;
int src_align = get_pointer_alignment (src, BIGGEST_ALIGNMENT); unsigned int src_align = get_pointer_alignment (src, BIGGEST_ALIGNMENT);
int dest_align = get_pointer_alignment (dest, BIGGEST_ALIGNMENT); unsigned int dest_align
= get_pointer_alignment (dest, BIGGEST_ALIGNMENT);
rtx dest_mem, src_mem, dest_addr, len_rtx; rtx dest_mem, src_mem, dest_addr, len_rtx;
/* If either SRC or DEST is not a pointer type, don't do /* If either SRC or DEST is not a pointer type, don't do
...@@ -1953,18 +1952,19 @@ expand_builtin_strncpy (arglist, target, mode) ...@@ -1953,18 +1952,19 @@ expand_builtin_strncpy (arglist, target, mode)
if (tree_int_cst_lt (slen, len)) if (tree_int_cst_lt (slen, len))
{ {
tree dest = TREE_VALUE (arglist); tree dest = TREE_VALUE (arglist);
int dest_align = get_pointer_alignment (dest, BIGGEST_ALIGNMENT); unsigned int dest_align
= get_pointer_alignment (dest, BIGGEST_ALIGNMENT);
const char *p = c_getstr (TREE_VALUE (TREE_CHAIN (arglist))); const char *p = c_getstr (TREE_VALUE (TREE_CHAIN (arglist)));
rtx dest_mem; rtx dest_mem;
if (!p || !dest_align || TREE_INT_CST_HIGH (len) if (!p || dest_align == 0 || !host_integerp (len, 1)
|| !can_store_by_pieces (TREE_INT_CST_LOW (len), || !can_store_by_pieces (tree_low_cst (len, 1),
builtin_strncpy_read_str, builtin_strncpy_read_str,
(PTR) p, dest_align)) (PTR) p, dest_align))
return 0; return 0;
dest_mem = get_memory_rtx (dest); dest_mem = get_memory_rtx (dest);
store_by_pieces (dest_mem, TREE_INT_CST_LOW (len), store_by_pieces (dest_mem, tree_low_cst (len, 1),
builtin_strncpy_read_str, builtin_strncpy_read_str,
(PTR) p, dest_align); (PTR) p, dest_align);
return force_operand (XEXP (dest_mem, 0), NULL_RTX); return force_operand (XEXP (dest_mem, 0), NULL_RTX);
...@@ -2012,7 +2012,8 @@ expand_builtin_memset (exp) ...@@ -2012,7 +2012,8 @@ expand_builtin_memset (exp)
tree len = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); tree len = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist)));
char c; char c;
int dest_align = get_pointer_alignment (dest, BIGGEST_ALIGNMENT); unsigned int dest_align
= get_pointer_alignment (dest, BIGGEST_ALIGNMENT);
rtx dest_mem, dest_addr, len_rtx; rtx dest_mem, dest_addr, len_rtx;
/* If DEST is not a pointer type, don't do this /* If DEST is not a pointer type, don't do this
...@@ -2028,16 +2029,16 @@ expand_builtin_memset (exp) ...@@ -2028,16 +2029,16 @@ expand_builtin_memset (exp)
if (c) if (c)
{ {
if (TREE_CODE (len) != INTEGER_CST || TREE_INT_CST_HIGH (len)) if (!host_integerp (len, 1))
return 0; return 0;
if (current_function_check_memory_usage if (current_function_check_memory_usage
|| !can_store_by_pieces (TREE_INT_CST_LOW (len), || !can_store_by_pieces (tree_low_cst (len, 1),
builtin_memset_read_str, builtin_memset_read_str,
(PTR) &c, dest_align)) (PTR) &c, dest_align))
return 0; return 0;
dest_mem = get_memory_rtx (dest); dest_mem = get_memory_rtx (dest);
store_by_pieces (dest_mem, TREE_INT_CST_LOW (len), store_by_pieces (dest_mem, tree_low_cst (len, 1),
builtin_memset_read_str, builtin_memset_read_str,
(PTR) &c, dest_align); (PTR) &c, dest_align);
return force_operand (XEXP (dest_mem, 0), NULL_RTX); return force_operand (XEXP (dest_mem, 0), NULL_RTX);
...@@ -2067,6 +2068,7 @@ expand_builtin_memset (exp) ...@@ -2067,6 +2068,7 @@ expand_builtin_memset (exp)
/* Expand expression EXP, which is a call to the bzero builtin. Return 0 /* Expand expression EXP, which is a call to the bzero builtin. Return 0
if we failed the caller should emit a normal call. */ if we failed the caller should emit a normal call. */
static rtx static rtx
expand_builtin_bzero (exp) expand_builtin_bzero (exp)
tree exp; tree exp;
...@@ -2098,10 +2100,12 @@ expand_builtin_bzero (exp) ...@@ -2098,10 +2100,12 @@ expand_builtin_bzero (exp)
} }
#ifdef HAVE_cmpstrsi #ifdef HAVE_cmpstrsi
/* Expand expression EXP, which is a call to the memcmp or the strcmp builtin. /* Expand expression EXP, which is a call to the memcmp or the strcmp builtin.
ARGLIST is the argument list for this call. Return 0 if we failed and the ARGLIST is the argument list for this call. Return 0 if we failed and the
caller should emit a normal call, otherwise try to get the result in caller should emit a normal call, otherwise try to get the result in
TARGET, if convenient. */ TARGET, if convenient. */
static rtx static rtx
expand_builtin_memcmp (exp, arglist, target) expand_builtin_memcmp (exp, arglist, target)
tree exp; tree exp;
...@@ -2286,6 +2290,7 @@ expand_builtin_strcmp (exp, target, mode) ...@@ -2286,6 +2290,7 @@ expand_builtin_strcmp (exp, target, mode)
/* Expand expression EXP, which is a call to the strncmp builtin. Return 0 /* Expand expression EXP, which is a call to the strncmp builtin. Return 0
if we failed the caller should emit a normal call, otherwise try to get if we failed the caller should emit a normal call, otherwise try to get
the result in TARGET, if convenient. */ the result in TARGET, if convenient. */
static rtx static rtx
expand_builtin_strncmp (exp, target, mode) expand_builtin_strncmp (exp, target, mode)
tree exp; tree exp;
...@@ -2393,6 +2398,7 @@ expand_builtin_strncmp (exp, target, mode) ...@@ -2393,6 +2398,7 @@ expand_builtin_strncmp (exp, target, mode)
/* Expand expression EXP, which is a call to the strcat builtin. /* Expand expression EXP, which is a call to the strcat builtin.
Return 0 if we failed the caller should emit a normal call, Return 0 if we failed the caller should emit a normal call,
otherwise try to get the result in TARGET, if convenient. */ otherwise try to get the result in TARGET, if convenient. */
static rtx static rtx
expand_builtin_strcat (arglist, target, mode) expand_builtin_strcat (arglist, target, mode)
tree arglist; tree arglist;
...@@ -2422,6 +2428,7 @@ expand_builtin_strcat (arglist, target, mode) ...@@ -2422,6 +2428,7 @@ expand_builtin_strcat (arglist, target, mode)
/* Expand expression EXP, which is a call to the strncat builtin. /* Expand expression EXP, which is a call to the strncat builtin.
Return 0 if we failed the caller should emit a normal call, Return 0 if we failed the caller should emit a normal call,
otherwise try to get the result in TARGET, if convenient. */ otherwise try to get the result in TARGET, if convenient. */
static rtx static rtx
expand_builtin_strncat (arglist, target, mode) expand_builtin_strncat (arglist, target, mode)
tree arglist; tree arglist;
...@@ -2478,6 +2485,7 @@ expand_builtin_strncat (arglist, target, mode) ...@@ -2478,6 +2485,7 @@ expand_builtin_strncat (arglist, target, mode)
/* Expand expression EXP, which is a call to the strspn builtin. /* Expand expression EXP, which is a call to the strspn builtin.
Return 0 if we failed the caller should emit a normal call, Return 0 if we failed the caller should emit a normal call,
otherwise try to get the result in TARGET, if convenient. */ otherwise try to get the result in TARGET, if convenient. */
static rtx static rtx
expand_builtin_strspn (arglist, target, mode) expand_builtin_strspn (arglist, target, mode)
tree arglist; tree arglist;
...@@ -2518,6 +2526,7 @@ expand_builtin_strspn (arglist, target, mode) ...@@ -2518,6 +2526,7 @@ expand_builtin_strspn (arglist, target, mode)
/* Expand expression EXP, which is a call to the strcspn builtin. /* Expand expression EXP, which is a call to the strcspn builtin.
Return 0 if we failed the caller should emit a normal call, Return 0 if we failed the caller should emit a normal call,
otherwise try to get the result in TARGET, if convenient. */ otherwise try to get the result in TARGET, if convenient. */
static rtx static rtx
expand_builtin_strcspn (arglist, target, mode) expand_builtin_strcspn (arglist, target, mode)
tree arglist; tree arglist;
...@@ -2641,14 +2650,13 @@ expand_builtin_args_info (exp) ...@@ -2641,14 +2650,13 @@ expand_builtin_args_info (exp)
if (arglist != 0) if (arglist != 0)
{ {
tree arg = TREE_VALUE (arglist); if (!host_integerp (TREE_VALUE (arglist), 0))
if (TREE_CODE (arg) != INTEGER_CST)
error ("argument of `__builtin_args_info' must be constant"); error ("argument of `__builtin_args_info' must be constant");
else else
{ {
int wordnum = TREE_INT_CST_LOW (arg); HOST_WIDE_INT wordnum = tree_low_cst (TREE_VALUE (arglist), 0);
if (wordnum < 0 || wordnum >= nwords || TREE_INT_CST_HIGH (arg)) if (wordnum < 0 || wordnum >= nwords)
error ("argument of `__builtin_args_info' out of range"); error ("argument of `__builtin_args_info' out of range");
else else
return GEN_INT (word_ptr[wordnum]); return GEN_INT (word_ptr[wordnum]);
...@@ -2675,6 +2683,7 @@ expand_builtin_args_info (exp) ...@@ -2675,6 +2683,7 @@ expand_builtin_args_info (exp)
} }
/* Expand ARGLIST, from a call to __builtin_next_arg. */ /* Expand ARGLIST, from a call to __builtin_next_arg. */
static rtx static rtx
expand_builtin_next_arg (arglist) expand_builtin_next_arg (arglist)
tree arglist; tree arglist;
...@@ -2769,6 +2778,7 @@ stabilize_va_list (valist, needs_lvalue) ...@@ -2769,6 +2778,7 @@ stabilize_va_list (valist, needs_lvalue)
/* The "standard" implementation of va_start: just assign `nextarg' to /* The "standard" implementation of va_start: just assign `nextarg' to
the variable. */ the variable. */
void void
std_expand_builtin_va_start (stdarg_p, valist, nextarg) std_expand_builtin_va_start (stdarg_p, valist, nextarg)
int stdarg_p; int stdarg_p;
...@@ -2798,6 +2808,7 @@ std_expand_builtin_va_start (stdarg_p, valist, nextarg) ...@@ -2798,6 +2808,7 @@ std_expand_builtin_va_start (stdarg_p, valist, nextarg)
/* Expand ARGLIST, which from a call to __builtin_stdarg_va_start or /* Expand ARGLIST, which from a call to __builtin_stdarg_va_start or
__builtin_varargs_va_start, depending on STDARG_P. */ __builtin_varargs_va_start, depending on STDARG_P. */
static rtx static rtx
expand_builtin_va_start (stdarg_p, arglist) expand_builtin_va_start (stdarg_p, arglist)
int stdarg_p; int stdarg_p;
...@@ -2847,10 +2858,8 @@ std_expand_builtin_va_arg (valist, type) ...@@ -2847,10 +2858,8 @@ std_expand_builtin_va_arg (valist, type)
{ {
/* Small args are padded downward. */ /* Small args are padded downward. */
HOST_WIDE_INT adj; HOST_WIDE_INT adj
adj = TREE_INT_CST_LOW (TYPE_SIZE (type)) / BITS_PER_UNIT; = rounded_size > align ? rounded_size : int_size_in_bytes (type);
if (rounded_size > align)
adj = rounded_size;
addr_tree = build (PLUS_EXPR, TREE_TYPE (addr_tree), addr_tree, addr_tree = build (PLUS_EXPR, TREE_TYPE (addr_tree), addr_tree,
build_int_2 (rounded_size - adj, 0)); build_int_2 (rounded_size - adj, 0));
...@@ -3022,6 +3031,7 @@ expand_builtin_va_copy (arglist) ...@@ -3022,6 +3031,7 @@ expand_builtin_va_copy (arglist)
/* Expand a call to one of the builtin functions __builtin_frame_address or /* Expand a call to one of the builtin functions __builtin_frame_address or
__builtin_return_address. */ __builtin_return_address. */
static rtx static rtx
expand_builtin_frame_address (exp) expand_builtin_frame_address (exp)
tree exp; tree exp;
...@@ -3035,8 +3045,7 @@ expand_builtin_frame_address (exp) ...@@ -3035,8 +3045,7 @@ expand_builtin_frame_address (exp)
if (arglist == 0) if (arglist == 0)
/* Warning about missing arg was already issued. */ /* Warning about missing arg was already issued. */
return const0_rtx; return const0_rtx;
else if (TREE_CODE (TREE_VALUE (arglist)) != INTEGER_CST else if (! host_integerp (TREE_VALUE (arglist), 1))
|| tree_int_cst_sgn (TREE_VALUE (arglist)) < 0)
{ {
if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_FRAME_ADDRESS) if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_FRAME_ADDRESS)
error ("invalid arg to `__builtin_frame_address'"); error ("invalid arg to `__builtin_frame_address'");
...@@ -3046,9 +3055,10 @@ expand_builtin_frame_address (exp) ...@@ -3046,9 +3055,10 @@ expand_builtin_frame_address (exp)
} }
else else
{ {
rtx tem = expand_builtin_return_addr (DECL_FUNCTION_CODE (fndecl), rtx tem
TREE_INT_CST_LOW (TREE_VALUE (arglist)), = expand_builtin_return_addr (DECL_FUNCTION_CODE (fndecl),
hard_frame_pointer_rtx); tree_low_cst (TREE_VALUE (arglist), 1),
hard_frame_pointer_rtx);
/* Some ports cannot access arbitrary stack frames. */ /* Some ports cannot access arbitrary stack frames. */
if (tem == NULL) if (tem == NULL)
...@@ -3264,9 +3274,7 @@ expand_builtin_expect_jump (exp, if_false_label, if_true_label) ...@@ -3264,9 +3274,7 @@ expand_builtin_expect_jump (exp, if_false_label, if_true_label)
/* Only handle __builtin_expect (test, 0) and /* Only handle __builtin_expect (test, 0) and
__builtin_expect (test, 1). */ __builtin_expect (test, 1). */
if (TREE_CODE (TREE_TYPE (arg1)) == INTEGER_TYPE if (TREE_CODE (TREE_TYPE (arg1)) == INTEGER_TYPE
&& TREE_CODE (arg1) == INTEGER_CST && (integer_zerop (arg1) || integer_onep (arg1)))
&& (TREE_INT_CST_LOW (arg1) == 0 || TREE_INT_CST_LOW (arg1) == 1)
&& TREE_INT_CST_HIGH (arg1) == 0)
{ {
int j; int j;
int num_jumps = 0; int num_jumps = 0;
...@@ -3341,7 +3349,7 @@ expand_builtin_expect_jump (exp, if_false_label, if_true_label) ...@@ -3341,7 +3349,7 @@ expand_builtin_expect_jump (exp, if_false_label, if_true_label)
/* If the test is expected to fail, reverse the /* If the test is expected to fail, reverse the
probabilities. */ probabilities. */
if (TREE_INT_CST_LOW (arg1) == 0) if (integer_zerop (arg1))
taken = 1 - taken; taken = 1 - taken;
/* If we are jumping to the false label, reverse the /* If we are jumping to the false label, reverse the
...@@ -3366,7 +3374,6 @@ expand_builtin_expect_jump (exp, if_false_label, if_true_label) ...@@ -3366,7 +3374,6 @@ expand_builtin_expect_jump (exp, if_false_label, if_true_label)
return ret; return ret;
} }
/* Expand an expression EXP that calls a built-in function, /* Expand an expression EXP that calls a built-in function,
with result going to TARGET if that's convenient with result going to TARGET if that's convenient
...@@ -3791,6 +3798,7 @@ fold_builtin_constant_p (arglist) ...@@ -3791,6 +3798,7 @@ fold_builtin_constant_p (arglist)
} }
/* Fold a call to __builtin_classify_type. */ /* Fold a call to __builtin_classify_type. */
static tree static tree
fold_builtin_classify_type (arglist) fold_builtin_classify_type (arglist)
tree arglist; tree arglist;
...@@ -3856,6 +3864,7 @@ build_function_call_expr (fn, arglist) ...@@ -3856,6 +3864,7 @@ build_function_call_expr (fn, arglist)
represented as a tree chain of parameters against a specified list represented as a tree chain of parameters against a specified list
of tree_codes. If the last specifier is a 0, that represents an of tree_codes. If the last specifier is a 0, that represents an
ellipses, otherwise the last specifier must be a VOID_TYPE. */ ellipses, otherwise the last specifier must be a VOID_TYPE. */
static int static int
validate_arglist VPARAMS ((tree arglist, ...)) validate_arglist VPARAMS ((tree arglist, ...))
{ {
......
...@@ -3599,7 +3599,7 @@ alpha_expand_block_move (operands) ...@@ -3599,7 +3599,7 @@ alpha_expand_block_move (operands)
if (mode == TImode) if (mode == TImode)
{ {
data_regs[nregs] = gen_lowpart (DImode, tmp); data_regs[nregs] = gen_lowpart (DImode, tmp);
data_regs[nregs+1] = gen_highpart (DImode, tmp); data_regs[nregs + 1] = gen_highpart (DImode, tmp);
nregs += 2; nregs += 2;
} }
else else
...@@ -3620,7 +3620,7 @@ alpha_expand_block_move (operands) ...@@ -3620,7 +3620,7 @@ alpha_expand_block_move (operands)
words = bytes / 8; words = bytes / 8;
for (i = 0; i < words; ++i) for (i = 0; i < words; ++i)
data_regs[nregs + i] = gen_reg_rtx(DImode); data_regs[nregs + i] = gen_reg_rtx (DImode);
for (i = 0; i < words; ++i) for (i = 0; i < words; ++i)
emit_move_insn (data_regs[nregs + i], emit_move_insn (data_regs[nregs + i],
...@@ -3636,7 +3636,7 @@ alpha_expand_block_move (operands) ...@@ -3636,7 +3636,7 @@ alpha_expand_block_move (operands)
words = bytes / 4; words = bytes / 4;
for (i = 0; i < words; ++i) for (i = 0; i < words; ++i)
data_regs[nregs + i] = gen_reg_rtx(SImode); data_regs[nregs + i] = gen_reg_rtx (SImode);
for (i = 0; i < words; ++i) for (i = 0; i < words; ++i)
emit_move_insn (data_regs[nregs + i], emit_move_insn (data_regs[nregs + i],
...@@ -3652,7 +3652,7 @@ alpha_expand_block_move (operands) ...@@ -3652,7 +3652,7 @@ alpha_expand_block_move (operands)
words = bytes / 8; words = bytes / 8;
for (i = 0; i < words+1; ++i) for (i = 0; i < words+1; ++i)
data_regs[nregs + i] = gen_reg_rtx(DImode); data_regs[nregs + i] = gen_reg_rtx (DImode);
alpha_expand_unaligned_load_words (data_regs + nregs, orig_src, alpha_expand_unaligned_load_words (data_regs + nregs, orig_src,
words, ofs); words, ofs);
......
...@@ -793,7 +793,7 @@ expensive_function_p (threshold) ...@@ -793,7 +793,7 @@ expensive_function_p (threshold)
{ {
unsigned int sum = 0; unsigned int sum = 0;
int i; int i;
int limit; unsigned int limit;
/* We can not compute accurately for large thresholds due to scaled /* We can not compute accurately for large thresholds due to scaled
frequencies. */ frequencies. */
......
...@@ -891,7 +891,7 @@ mark_target_live_regs (insns, target, res) ...@@ -891,7 +891,7 @@ mark_target_live_regs (insns, target, res)
struct resources *res; struct resources *res;
{ {
int b = -1; int b = -1;
int i; unsigned int i;
struct target_info *tinfo = NULL; struct target_info *tinfo = NULL;
rtx insn; rtx insn;
rtx jump_insn = 0; rtx jump_insn = 0;
...@@ -949,7 +949,8 @@ mark_target_live_regs (insns, target, res) ...@@ -949,7 +949,8 @@ mark_target_live_regs (insns, target, res)
tinfo = (struct target_info *) xmalloc (sizeof (struct target_info)); tinfo = (struct target_info *) xmalloc (sizeof (struct target_info));
tinfo->uid = INSN_UID (target); tinfo->uid = INSN_UID (target);
tinfo->block = b; tinfo->block = b;
tinfo->next = target_hash_table[INSN_UID (target) % TARGET_HASH_PRIME]; tinfo->next
= target_hash_table[INSN_UID (target) % TARGET_HASH_PRIME];
target_hash_table[INSN_UID (target) % TARGET_HASH_PRIME] = tinfo; target_hash_table[INSN_UID (target) % TARGET_HASH_PRIME] = tinfo;
} }
} }
...@@ -1061,8 +1062,8 @@ mark_target_live_regs (insns, target, res) ...@@ -1061,8 +1062,8 @@ mark_target_live_regs (insns, target, res)
&& GET_CODE (XEXP (link, 0)) == REG && GET_CODE (XEXP (link, 0)) == REG
&& REGNO (XEXP (link, 0)) < FIRST_PSEUDO_REGISTER) && REGNO (XEXP (link, 0)) < FIRST_PSEUDO_REGISTER)
{ {
int first_regno = REGNO (XEXP (link, 0)); unsigned int first_regno = REGNO (XEXP (link, 0));
int last_regno unsigned int last_regno
= (first_regno = (first_regno
+ HARD_REGNO_NREGS (first_regno, + HARD_REGNO_NREGS (first_regno,
GET_MODE (XEXP (link, 0)))); GET_MODE (XEXP (link, 0))));
...@@ -1080,8 +1081,8 @@ mark_target_live_regs (insns, target, res) ...@@ -1080,8 +1081,8 @@ mark_target_live_regs (insns, target, res)
&& GET_CODE (XEXP (link, 0)) == REG && GET_CODE (XEXP (link, 0)) == REG
&& REGNO (XEXP (link, 0)) < FIRST_PSEUDO_REGISTER) && REGNO (XEXP (link, 0)) < FIRST_PSEUDO_REGISTER)
{ {
int first_regno = REGNO (XEXP (link, 0)); unsigned int first_regno = REGNO (XEXP (link, 0));
int last_regno unsigned int last_regno
= (first_regno = (first_regno
+ HARD_REGNO_NREGS (first_regno, + HARD_REGNO_NREGS (first_regno,
GET_MODE (XEXP (link, 0)))); GET_MODE (XEXP (link, 0))));
......
...@@ -94,10 +94,10 @@ extern tree current_function_decl; ...@@ -94,10 +94,10 @@ extern tree current_function_decl;
static void sdbout_init PARAMS ((const char *)); static void sdbout_init PARAMS ((const char *));
static void sdbout_finish PARAMS ((const char *)); static void sdbout_finish PARAMS ((const char *));
static void sdbout_start_source_file PARAMS ((unsigned, const char *)); static void sdbout_start_source_file PARAMS ((unsigned int, const char *));
static void sdbout_end_source_file PARAMS ((unsigned)); static void sdbout_end_source_file PARAMS ((unsigned int));
static void sdbout_begin_block PARAMS ((unsigned, unsigned)); static void sdbout_begin_block PARAMS ((unsigned int, unsigned int));
static void sdbout_end_block PARAMS ((unsigned, unsigned)); static void sdbout_end_block PARAMS ((unsigned int, unsigned int));
static void sdbout_source_line PARAMS ((unsigned int, const char *)); static void sdbout_source_line PARAMS ((unsigned int, const char *));
static void sdbout_end_epilogue PARAMS ((void)); static void sdbout_end_epilogue PARAMS ((void));
static void sdbout_global_decl PARAMS ((tree)); static void sdbout_global_decl PARAMS ((tree));
...@@ -263,7 +263,8 @@ do { fprintf (asm_out_file, "\t.tag\t"); \ ...@@ -263,7 +263,8 @@ do { fprintf (asm_out_file, "\t.tag\t"); \
/* Ensure we don't output a negative line number. */ /* Ensure we don't output a negative line number. */
#define MAKE_LINE_SAFE(line) \ #define MAKE_LINE_SAFE(line) \
if (line <= sdb_begin_function_line) line = sdb_begin_function_line + 1 if ((int) line <= sdb_begin_function_line) \
line = sdb_begin_function_line + 1
/* Perform linker optimization of merging header file definitions together /* Perform linker optimization of merging header file definitions together
for targets with MIPS_DEBUGGING_INFO defined. This won't work without a for targets with MIPS_DEBUGGING_INFO defined. This won't work without a
...@@ -439,7 +440,7 @@ static void ...@@ -439,7 +440,7 @@ static void
sdbout_record_type_name (type) sdbout_record_type_name (type)
tree type; tree type;
{ {
const char *name = 0; char *name = 0;
int no_name; int no_name;
if (KNOWN_TYPE_TAG (type)) if (KNOWN_TYPE_TAG (type))
...@@ -1606,7 +1607,7 @@ sdbout_source_line (line, filename) ...@@ -1606,7 +1607,7 @@ sdbout_source_line (line, filename)
const char *filename ATTRIBUTE_UNUSED; const char *filename ATTRIBUTE_UNUSED;
{ {
/* COFF relative line numbers must be positive. */ /* COFF relative line numbers must be positive. */
if (line > sdb_begin_function_line) if ((int) line > sdb_begin_function_line)
{ {
#ifdef ASM_OUTPUT_SOURCE_LINE #ifdef ASM_OUTPUT_SOURCE_LINE
ASM_OUTPUT_SOURCE_LINE (asm_out_file, line); ASM_OUTPUT_SOURCE_LINE (asm_out_file, line);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment