Commit db3ed0b3 by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/48152 (Bootstrap failure for x86_64-w64-mingw32 due ICE)

	PR middle-end/48152
	* var-tracking.c (prepare_call_arguments): If argument needs to be
	passed by reference, adjust argtype and mode.

From-SVN: r171101
parent 1bce4ff3
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> 2011-03-17 Richard Guenther <rguenther@suse.de>
PR middle-end/48134 PR middle-end/48134
......
...@@ -5732,11 +5732,18 @@ prepare_call_arguments (basic_block bb, rtx insn) ...@@ -5732,11 +5732,18 @@ prepare_call_arguments (basic_block bb, rtx insn)
call_arguments = gen_rtx_EXPR_LIST (VOIDmode, item, call_arguments); call_arguments = gen_rtx_EXPR_LIST (VOIDmode, item, call_arguments);
if (t && t != void_list_node) if (t && t != void_list_node)
{ {
enum machine_mode mode = TYPE_MODE (TREE_VALUE (t)); tree argtype = TREE_VALUE (t);
rtx reg = targetm.calls.function_arg (&args_so_far, mode, enum machine_mode mode = TYPE_MODE (argtype);
TREE_VALUE (t), true); rtx reg;
if (TREE_CODE (TREE_VALUE (t)) == REFERENCE_TYPE if (pass_by_reference (&args_so_far, mode, argtype, true))
&& INTEGRAL_TYPE_P (TREE_TYPE (TREE_VALUE (t))) {
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
&& REG_P (reg) && REG_P (reg)
&& GET_MODE (reg) == mode && GET_MODE (reg) == mode
...@@ -5747,7 +5754,7 @@ prepare_call_arguments (basic_block bb, rtx insn) ...@@ -5747,7 +5754,7 @@ prepare_call_arguments (basic_block bb, rtx insn)
&& item) && item)
{ {
enum machine_mode indmode enum machine_mode indmode
= TYPE_MODE (TREE_TYPE (TREE_VALUE (t))); = TYPE_MODE (TREE_TYPE (argtype));
rtx mem = gen_rtx_MEM (indmode, x); rtx mem = gen_rtx_MEM (indmode, x);
cselib_val *val = cselib_lookup (mem, indmode, 0, VOIDmode); cselib_val *val = cselib_lookup (mem, indmode, 0, VOIDmode);
if (val && cselib_preserved_value_p (val)) if (val && cselib_preserved_value_p (val))
...@@ -5784,7 +5791,7 @@ prepare_call_arguments (basic_block bb, rtx insn) ...@@ -5784,7 +5791,7 @@ prepare_call_arguments (basic_block bb, rtx insn)
} }
} }
targetm.calls.function_arg_advance (&args_so_far, mode, targetm.calls.function_arg_advance (&args_so_far, mode,
TREE_VALUE (t), true); argtype, true);
t = TREE_CHAIN (t); t = TREE_CHAIN (t);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment