From 56d76b697d2cf1a0197742400edd8f6dda63308a Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sun, 12 Dec 2004 17:11:41 -0800 Subject: [PATCH] i386.c (ix86_gimplify_va_arg): Fix type mismatch errors across operations. * config/i386/i386.c (ix86_gimplify_va_arg): Fix type mismatch errors across operations. From-SVN: r92072 --- gcc/ChangeLog | 5 +++++ gcc/config/i386/i386.c | 17 ++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 51be0c8349f..97437861d55 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-12-12 Richard Henderson + + * config/i386/i386.c (ix86_gimplify_va_arg): Fix type mismatch + errors across operations. + 2004-12-12 Di-an Jan * doc/passes.texi (Pass Manager): Correct list of source files. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 31be4d163b9..e255617e5d9 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -3368,6 +3368,7 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p) sse_addr = create_tmp_var (ptr_type_node, "sse_addr"); DECL_POINTER_ALIAS_SET (sse_addr) = get_varargs_alias_set (); } + /* First ensure that we fit completely in registers. */ if (needed_intregs) { @@ -3393,14 +3394,16 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p) if (needed_intregs) { /* int_addr = gpr + sav; */ - t = build2 (PLUS_EXPR, ptr_type_node, sav, gpr); + t = fold_convert (ptr_type_node, gpr); + t = build2 (PLUS_EXPR, ptr_type_node, sav, t); t = build2 (MODIFY_EXPR, void_type_node, int_addr, t); gimplify_and_add (t, pre_p); } if (needed_sseregs) { /* sse_addr = fpr + sav; */ - t = build2 (PLUS_EXPR, ptr_type_node, sav, fpr); + t = fold_convert (ptr_type_node, fpr); + t = build2 (PLUS_EXPR, ptr_type_node, sav, t); t = build2 (MODIFY_EXPR, void_type_node, sse_addr, t); gimplify_and_add (t, pre_p); } @@ -3453,14 +3456,14 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p) if (needed_intregs) { t = build2 (PLUS_EXPR, TREE_TYPE (gpr), gpr, - build_int_cst (NULL_TREE, needed_intregs * 8)); + build_int_cst (TREE_TYPE (gpr), needed_intregs * 8)); t = build2 (MODIFY_EXPR, TREE_TYPE (gpr), gpr, t); gimplify_and_add (t, pre_p); } if (needed_sseregs) { t = build2 (PLUS_EXPR, TREE_TYPE (fpr), fpr, - build_int_cst (NULL_TREE, needed_sseregs * 16)); + build_int_cst (TREE_TYPE (fpr), needed_sseregs * 16)); t = build2 (MODIFY_EXPR, TREE_TYPE (fpr), fpr, t); gimplify_and_add (t, pre_p); } @@ -3481,9 +3484,9 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p) { HOST_WIDE_INT align = FUNCTION_ARG_BOUNDARY (VOIDmode, type) / 8; t = build (PLUS_EXPR, TREE_TYPE (ovf), ovf, - build_int_cst (NULL_TREE, align - 1)); + build_int_cst (TREE_TYPE (ovf), align - 1)); t = build (BIT_AND_EXPR, TREE_TYPE (t), t, - build_int_cst (NULL_TREE, -align)); + build_int_cst (TREE_TYPE (t), -align)); } gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue); @@ -3491,7 +3494,7 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p) gimplify_and_add (t2, pre_p); t = build2 (PLUS_EXPR, TREE_TYPE (t), t, - build_int_cst (NULL_TREE, rsize * UNITS_PER_WORD)); + build_int_cst (TREE_TYPE (t), rsize * UNITS_PER_WORD)); t = build2 (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t); gimplify_and_add (t, pre_p);