i386.c (ix86_va_start): Ensure all integer constant trees are constructed with a suitable tree type.

* config/i386/i386.c (ix86_va_start): Ensure all integer constant
	trees are constructed with a suitable tree type.

From-SVN: r112982
This commit is contained in:
Roger Sayle 2006-04-16 04:01:25 +00:00 committed by Roger Sayle
parent f5f701ad00
commit 3db8a11346
2 changed files with 20 additions and 10 deletions

View File

@ -1,3 +1,8 @@
2006-04-15 Roger Sayle <roger@eyesopen.com>
* config/i386/i386.c (ix86_va_start): Ensure all integer constant
trees are constructed with a suitable tree type.
2006-04-15 Roger Sayle <roger@eyesopen.com>
* tree.c (integer_zerop): Ignore TREE_CONSTANT_OVERFLOW.

View File

@ -4122,6 +4122,7 @@ ix86_va_start (tree valist, rtx nextarg)
HOST_WIDE_INT words, n_gpr, n_fpr;
tree f_gpr, f_fpr, f_ovf, f_sav;
tree gpr, fpr, ovf, sav, t;
tree type;
/* Only 64bit target needs something special. */
if (!TARGET_64BIT)
@ -4152,26 +4153,29 @@ ix86_va_start (tree valist, rtx nextarg)
if (cfun->va_list_gpr_size)
{
t = build2 (MODIFY_EXPR, TREE_TYPE (gpr), gpr,
build_int_cst (NULL_TREE, n_gpr * 8));
type = TREE_TYPE (gpr);
t = build2 (MODIFY_EXPR, type, gpr,
build_int_cst (type, n_gpr * 8));
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
}
if (cfun->va_list_fpr_size)
{
t = build2 (MODIFY_EXPR, TREE_TYPE (fpr), fpr,
build_int_cst (NULL_TREE, n_fpr * 16 + 8*REGPARM_MAX));
type = TREE_TYPE (fpr);
t = build2 (MODIFY_EXPR, type, fpr,
build_int_cst (type, n_fpr * 16 + 8*REGPARM_MAX));
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
}
/* Find the overflow area. */
t = make_tree (TREE_TYPE (ovf), virtual_incoming_args_rtx);
type = TREE_TYPE (ovf);
t = make_tree (type, virtual_incoming_args_rtx);
if (words != 0)
t = build2 (PLUS_EXPR, TREE_TYPE (ovf), t,
build_int_cst (NULL_TREE, words * UNITS_PER_WORD));
t = build2 (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t);
t = build2 (PLUS_EXPR, type, t,
build_int_cst (type, words * UNITS_PER_WORD));
t = build2 (MODIFY_EXPR, type, ovf, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@ -4179,8 +4183,9 @@ ix86_va_start (tree valist, rtx nextarg)
{
/* Find the register save area.
Prologue of the function save it right above stack frame. */
t = make_tree (TREE_TYPE (sav), frame_pointer_rtx);
t = build2 (MODIFY_EXPR, TREE_TYPE (sav), sav, t);
type = TREE_TYPE (sav);
t = make_tree (type, frame_pointer_rtx);
t = build2 (MODIFY_EXPR, type, sav, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
}