i386.c (ix86_gimplify_va_arg): Fix type mismatch errors across operations.
authorRichard Henderson <rth@redhat.com>
Mon, 13 Dec 2004 01:11:41 +0000 (17:11 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Mon, 13 Dec 2004 01:11:41 +0000 (17:11 -0800)
        * config/i386/i386.c (ix86_gimplify_va_arg): Fix type mismatch
        errors across operations.

From-SVN: r92072

gcc/ChangeLog
gcc/config/i386/i386.c

index 51be0c8349f8a5af160d00b5a73bd74f0343c053..97437861d556c015be4940c552860d89be5aeccc 100644 (file)
@@ -1,3 +1,8 @@
+2004-12-12  Richard Henderson  <rth@redhat.com>
+
+       * config/i386/i386.c (ix86_gimplify_va_arg): Fix type mismatch
+       errors across operations.
+
 2004-12-12  Di-an Jan  <dianj@freeshell.org>  
 
        * doc/passes.texi (Pass Manager): Correct list of source files.
index 31be4d163b998973e707dcae56cd55802c608338..e255617e5d9cee3499b346e7dda576a8d3c9145e 100644 (file)
@@ -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);