[PATCH][pointer-plus] Make x86_64 work

Andrew Pinski pinskia@gmail.com
Tue May 15 22:04:00 GMT 2007


On 5/15/07, Richard Guenther <rguenther@suse.de> wrote:
> 2007-05-15  Richard Guenther  <rguenther@suse.de>
>
>         * config/i386/i386.c (ix86_gimplify_va_arg): Use POINTER_PLUS_EXPR,
>         perform BIT_AND_EXPR on sizetype arguments.


And this is what I applied.  I had applied the fortran patch part of
my patch to fix powerpc64-linux-gnu (I came up with the same patch my
self).  The same changelog too.

Thanks,
Andrew Pinski
-------------- next part --------------
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c	(revision 124746)
+++ config/i386/i386.c	(working copy)
@@ -4939,10 +4939,12 @@ ix86_gimplify_va_arg (tree valist, tree 
  else
     {
       HOST_WIDE_INT align = FUNCTION_ARG_BOUNDARY (VOIDmode, type) / 8;
-      t = build2 (PLUS_EXPR, TREE_TYPE (ovf), ovf,
-		  build_int_cst (TREE_TYPE (ovf), align - 1));
+      t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (ovf), ovf,
+		  size_int (align - 1));
+      t = fold_convert (sizetype, t);
       t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t,
-		  build_int_cst (TREE_TYPE (t), -align));
+		  size_int (-align));
+      t = fold_convert (TREE_TYPE (ovf), t);
     }
   gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue);
 


More information about the Gcc-patches mailing list