+2011-03-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/48152
+ * var-tracking.c (prepare_call_arguments): If argument needs to be
+ passed by reference, adjust argtype and mode.
+
2011-03-17 Richard Guenther <rguenther@suse.de>
PR middle-end/48134
call_arguments = gen_rtx_EXPR_LIST (VOIDmode, item, call_arguments);
if (t && t != void_list_node)
{
- enum machine_mode mode = TYPE_MODE (TREE_VALUE (t));
- rtx reg = targetm.calls.function_arg (&args_so_far, mode,
- TREE_VALUE (t), true);
- if (TREE_CODE (TREE_VALUE (t)) == REFERENCE_TYPE
- && INTEGRAL_TYPE_P (TREE_TYPE (TREE_VALUE (t)))
+ tree argtype = TREE_VALUE (t);
+ enum machine_mode mode = TYPE_MODE (argtype);
+ rtx reg;
+ if (pass_by_reference (&args_so_far, mode, argtype, true))
+ {
+ argtype = build_pointer_type (argtype);
+ mode = TYPE_MODE (argtype);
+ }
+ reg = targetm.calls.function_arg (&args_so_far, mode,
+ argtype, true);
+ if (TREE_CODE (argtype) == REFERENCE_TYPE
+ && INTEGRAL_TYPE_P (TREE_TYPE (argtype))
&& reg
&& REG_P (reg)
&& GET_MODE (reg) == mode
&& item)
{
enum machine_mode indmode
- = TYPE_MODE (TREE_TYPE (TREE_VALUE (t)));
+ = TYPE_MODE (TREE_TYPE (argtype));
rtx mem = gen_rtx_MEM (indmode, x);
cselib_val *val = cselib_lookup (mem, indmode, 0, VOIDmode);
if (val && cselib_preserved_value_p (val))
}
}
targetm.calls.function_arg_advance (&args_so_far, mode,
- TREE_VALUE (t), true);
+ argtype, true);
t = TREE_CHAIN (t);
}
}