As Bernd reported last week, mipsisa32-elf builds are broken in trunk.
The problem was a type error in the EABI part of mips_gimplify_va_arg_expr.

Tested on mipsisa32-elf and applied.  There are still some lto
builtins failures that I need to look at, but I ran out of time.

Richard


gcc/
        * config/mips/mips.c (mips_gimplify_va_arg_expr): Unshare off.
        Fix the type of the BIT_AND_EXPR.

Index: gcc/config/mips/mips.c
===================================================================
--- gcc/config/mips/mips.c      2011-09-03 11:05:52.000000000 +0100
+++ gcc/config/mips/mips.c      2011-09-04 12:41:38.000000000 +0100
@@ -5601,7 +5601,7 @@ mips_gimplify_va_arg_expr (tree valist,
        }
 
       /* [2] Emit code to branch if off == 0.  */
-      t = build2 (NE_EXPR, boolean_type_node, off,
+      t = build2 (NE_EXPR, boolean_type_node, unshare_expr (off),
                  build_int_cst (TREE_TYPE (off), 0));
       addr = build3 (COND_EXPR, ptr_type_node, t, NULL_TREE, NULL_TREE);
 
@@ -5624,7 +5624,7 @@ mips_gimplify_va_arg_expr (tree valist,
          /* [9] Emit: ovfl = ((intptr_t) ovfl + osize - 1) & -osize.  */
          t = fold_build_pointer_plus_hwi (unshare_expr (ovfl), osize - 1);
          u = build_int_cst (TREE_TYPE (t), -osize);
-         t = build2 (BIT_AND_EXPR, sizetype, t, u);
+         t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t, u);
          align = build2 (MODIFY_EXPR, TREE_TYPE (ovfl),
                          unshare_expr (ovfl), t);
        }

Reply via email to