mips.c (mips_gimplify_va_arg_expr): Use -rsize with the same type as the first operan...
authorAdam Nemet <anemet@caviumnetworks.com>
Wed, 19 Nov 2008 23:13:29 +0000 (23:13 +0000)
committerAdam Nemet <nemet@gcc.gnu.org>
Wed, 19 Nov 2008 23:13:29 +0000 (23:13 +0000)
* 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
gcc/config/mips/mips.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20081119-1.c [new file with mode: 0644]

index b21a632bcf5a447a9d84a72bf916b8d1ac8112aa..a16ad1cc7b3fa8703fa6e0779a994f245ecacd5c 100644 (file)
@@ -1,3 +1,8 @@
+2008-11-19  Adam Nemet  <anemet@caviumnetworks.com>
+
+       * 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  <vmakarov@redhat.com>
 
        PR bootstrap/37859
index 0c2836dbd65816d1ff63b58650b8d09c3762d00e..c868b10a107398613ced37d483170db57e478e82 100644 (file)
@@ -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;
index 85f9f279faf49d1a943513383eeaf0154856952d..9c4ca41bb15cf6d265b5399ee0bd18a37818e9e8 100644 (file)
@@ -1,3 +1,7 @@
+2008-11-19  Adam Nemet  <anemet@caviumnetworks.com>
+
+       * gcc.c-torture/compile/20081119-1.c: New test.
+
 2008-11-19  Dodji Seketeli  <dodji@redhat.com>
 
        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 (file)
index 0000000..7402f54
--- /dev/null
@@ -0,0 +1,5 @@
+unsigned long long
+f (__builtin_va_list  ap)
+{
+  return __builtin_va_arg (ap, unsigned long long);
+}