aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-07-10 00:23:17 -0700
committerRichard Henderson <rth@gcc.gnu.org>2004-07-10 00:23:17 -0700
commit76aa57137c694f75b7b33409b49a5063685fe241 (patch)
treebc564e88496d0493d9d7f329bdc8ef2d117d2ee3 /gcc
parent45cc478337efd4f1f5f62bfd70857ab5679aae7a (diff)
downloadgcc-76aa57137c694f75b7b33409b49a5063685fe241.zip
gcc-76aa57137c694f75b7b33409b49a5063685fe241.tar.gz
gcc-76aa57137c694f75b7b33409b49a5063685fe241.tar.bz2
* builtins.c (std_gimplify_va_arg_expr): Fix borked BIT_AND_EXPR.
From-SVN: r84446
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/builtins.c11
2 files changed, 9 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 12ee0ae..0187db96 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2004-07-10 Richard Henderson <rth@redhat.com>
+
+ * builtins.c (std_gimplify_va_arg_expr): Fix borked BIT_AND_EXPR.
+
2004-07-09 Mike Stump <mrs@apple.com>
* config/darwin.c (no_dead_strip): Add.
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 91d3c87..7d86ddc 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -4483,29 +4483,28 @@ std_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p)
abort ();
#endif
- /* Compute the rounded size of the type. */
align = PARM_BOUNDARY / BITS_PER_UNIT;
- boundary = FUNCTION_ARG_BOUNDARY (TYPE_MODE (type), type);
+ boundary = FUNCTION_ARG_BOUNDARY (TYPE_MODE (type), type) / BITS_PER_UNIT;
/* Hoist the valist value into a temporary for the moment. */
valist_tmp = get_initialized_tmp_var (valist, pre_p, NULL);
/* va_list pointer is aligned to PARM_BOUNDARY. If argument actually
requires greater alignment, we must perform dynamic alignment. */
- if (boundary > PARM_BOUNDARY)
+ if (boundary > align)
{
- unsigned byte_bound = boundary / BITS_PER_UNIT;
-
- t = fold_convert (TREE_TYPE (valist), size_int (byte_bound - 1));
+ t = fold_convert (TREE_TYPE (valist), size_int (boundary - 1));
t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist_tmp,
build2 (PLUS_EXPR, TREE_TYPE (valist), valist_tmp, t));
gimplify_and_add (t, pre_p);
+ t = fold_convert (TREE_TYPE (valist), size_int (-boundary));
t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist_tmp,
build2 (BIT_AND_EXPR, TREE_TYPE (valist), valist_tmp, t));
gimplify_and_add (t, pre_p);
}
+ /* Compute the rounded size of the type. */
type_size = size_in_bytes (type);
rounded_size = round_up (type_size, align);