From 3179cf8cf5798dc07552ccd4e6eb38bde77672a8 Mon Sep 17 00:00:00 2001 From: Adam Nemet Date: Wed, 19 Nov 2008 23:13:29 +0000 Subject: [PATCH] mips.c (mips_gimplify_va_arg_expr): Use -rsize with the same type as the first operand of the AND expression. * config/mips/mips.c (mips_gimplify_va_arg_expr): Use -rsize with the same type as the first operand of the AND expression. testsuite/ * gcc.c-torture/compile/20081119-1.c: New test. From-SVN: r142024 --- gcc/ChangeLog | 5 +++++ gcc/config/mips/mips.c | 2 +- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.c-torture/compile/20081119-1.c | 5 +++++ 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.c-torture/compile/20081119-1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b21a632bcf5..a16ad1cc7b3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-11-19 Adam Nemet + + * config/mips/mips.c (mips_gimplify_va_arg_expr): Use -rsize + with the same type as the first operand of the AND expression. + 2008-11-19 Vladimir Makarov PR bootstrap/37859 diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 0c2836dbd65..c868b10a107 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -5332,7 +5332,7 @@ mips_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p, { /* [1] Emit code for: off &= -rsize. */ t = build2 (BIT_AND_EXPR, TREE_TYPE (off), off, - build_int_cst (NULL_TREE, -rsize)); + build_int_cst (TREE_TYPE (off), -rsize)); gimplify_assign (off, t, pre_p); } osize = rsize; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 85f9f279faf..9c4ca41bb15 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2008-11-19 Adam Nemet + + * gcc.c-torture/compile/20081119-1.c: New test. + 2008-11-19 Dodji Seketeli PR c++/35405 diff --git a/gcc/testsuite/gcc.c-torture/compile/20081119-1.c b/gcc/testsuite/gcc.c-torture/compile/20081119-1.c new file mode 100644 index 00000000000..7402f549be5 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20081119-1.c @@ -0,0 +1,5 @@ +unsigned long long +f (__builtin_va_list ap) +{ + return __builtin_va_arg (ap, unsigned long long); +} -- 2.30.2