[PATCH][tuples] Fix ia64 valist sharing problem

Top Page

Reply to this message
Author: Richard Guenther
Date:  
To: gcc-patches
Subject: [PATCH][tuples] Fix ia64 valist sharing problem

This fixes gcc.c-torture/execute/stdarg-1.c.

Applied to the branch.

Richard.

2008-07-25 Richard Guenther <rguenther@???>

    * config/ia64/ia64.c (ia64_gimplify_va_arg): Unshare valist
    before reusing it.

Index: gcc/config/ia64/ia64.c
===================================================================
*** gcc/config/ia64/ia64.c    (revision 138136)
--- gcc/config/ia64/ia64.c    (working copy)
*************** ia64_gimplify_va_arg (tree valist, tree
*** 4360,4366 ****
t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t,
         size_int (-2 * UNITS_PER_WORD));
t = fold_convert (TREE_TYPE (valist), t);
! gimplify_assign (valist, t, pre_p);
}

return std_gimplify_va_arg_expr (valist, type, pre_p, post_p);
--- 4360,4366 ----
t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t,
         size_int (-2 * UNITS_PER_WORD));
t = fold_convert (TREE_TYPE (valist), t);
! gimplify_assign (unshare_expr (valist), t, pre_p);
}

return std_gimplify_va_arg_expr (valist, type, pre_p, post_p);