This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: gimple va_arg for hppa
On Sat, Jul 10, 2004 at 02:31:41PM -0400, John David Anglin wrote:
> No. I think boundary and align need to be unsigned HOST_WIDE_INT.
Like so.
r~
* builtins.c (std_gimplify_va_arg_expr): Widen align/boundary
to HOST_WIDE_INT. Fold pad-args-down arithmetic.
Index: builtins.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/builtins.c,v
retrieving revision 1.359
diff -c -p -d -u -r1.359 builtins.c
--- builtins.c 10 Jul 2004 08:04:56 -0000 1.359
+++ builtins.c 10 Jul 2004 18:45:33 -0000
@@ -4474,7 +4474,7 @@ tree
std_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p)
{
tree addr, t, type_size, rounded_size, valist_tmp;
- unsigned int align, boundary;
+ unsigned HOST_WIDE_INT align, boundary;
#ifdef ARGS_GROW_DOWNWARD
/* All of the alignment and movement below is for args-grow-up machines.
@@ -4520,7 +4520,7 @@ std_gimplify_va_arg_expr (tree valist, t
t = fold (build3 (COND_EXPR, sizetype, t, size_zero_node,
size_binop (MINUS_EXPR, rounded_size, type_size)));
t = fold_convert (TREE_TYPE (addr), t);
- addr = build2 (PLUS_EXPR, TREE_TYPE (addr), addr, t);
+ addr = fold (build2 (PLUS_EXPR, TREE_TYPE (addr), addr, t));
}
/* Compute new value for AP. */