Commit 3db8a113 by Roger Sayle Committed by Roger Sayle

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

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
parent f5f701ad
2006-04-15 Roger Sayle <roger@eyesopen.com> 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. * tree.c (integer_zerop): Ignore TREE_CONSTANT_OVERFLOW.
(integer_onep): Likewise. (integer_onep): Likewise.
(integer_all_onesp): Likewise. (integer_all_onesp): Likewise.
......
...@@ -4122,6 +4122,7 @@ ix86_va_start (tree valist, rtx nextarg) ...@@ -4122,6 +4122,7 @@ ix86_va_start (tree valist, rtx nextarg)
HOST_WIDE_INT words, n_gpr, n_fpr; HOST_WIDE_INT words, n_gpr, n_fpr;
tree f_gpr, f_fpr, f_ovf, f_sav; tree f_gpr, f_fpr, f_ovf, f_sav;
tree gpr, fpr, ovf, sav, t; tree gpr, fpr, ovf, sav, t;
tree type;
/* Only 64bit target needs something special. */ /* Only 64bit target needs something special. */
if (!TARGET_64BIT) if (!TARGET_64BIT)
...@@ -4152,26 +4153,29 @@ ix86_va_start (tree valist, rtx nextarg) ...@@ -4152,26 +4153,29 @@ ix86_va_start (tree valist, rtx nextarg)
if (cfun->va_list_gpr_size) if (cfun->va_list_gpr_size)
{ {
t = build2 (MODIFY_EXPR, TREE_TYPE (gpr), gpr, type = TREE_TYPE (gpr);
build_int_cst (NULL_TREE, n_gpr * 8)); t = build2 (MODIFY_EXPR, type, gpr,
build_int_cst (type, n_gpr * 8));
TREE_SIDE_EFFECTS (t) = 1; TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
} }
if (cfun->va_list_fpr_size) if (cfun->va_list_fpr_size)
{ {
t = build2 (MODIFY_EXPR, TREE_TYPE (fpr), fpr, type = TREE_TYPE (fpr);
build_int_cst (NULL_TREE, n_fpr * 16 + 8*REGPARM_MAX)); t = build2 (MODIFY_EXPR, type, fpr,
build_int_cst (type, n_fpr * 16 + 8*REGPARM_MAX));
TREE_SIDE_EFFECTS (t) = 1; TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
} }
/* Find the overflow area. */ /* 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) if (words != 0)
t = build2 (PLUS_EXPR, TREE_TYPE (ovf), t, t = build2 (PLUS_EXPR, type, t,
build_int_cst (NULL_TREE, words * UNITS_PER_WORD)); build_int_cst (type, words * UNITS_PER_WORD));
t = build2 (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t); t = build2 (MODIFY_EXPR, type, ovf, t);
TREE_SIDE_EFFECTS (t) = 1; TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
...@@ -4179,8 +4183,9 @@ ix86_va_start (tree valist, rtx nextarg) ...@@ -4179,8 +4183,9 @@ ix86_va_start (tree valist, rtx nextarg)
{ {
/* Find the register save area. /* Find the register save area.
Prologue of the function save it right above stack frame. */ Prologue of the function save it right above stack frame. */
t = make_tree (TREE_TYPE (sav), frame_pointer_rtx); type = TREE_TYPE (sav);
t = build2 (MODIFY_EXPR, TREE_TYPE (sav), sav, t); t = make_tree (type, frame_pointer_rtx);
t = build2 (MODIFY_EXPR, type, sav, t);
TREE_SIDE_EFFECTS (t) = 1; TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
} }
......
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