Commit e4abc3d5 by Richard Henderson Committed by Richard Henderson

calls.c (expand_call): Don't turn off ECF_LIBCALL_BLOCK for an invalid result register...

        * calls.c (expand_call): Don't turn off ECF_LIBCALL_BLOCK for
        an invalid result register; do end the sequence properly.
        (emit_library_call_value_1): Likewise.

From-SVN: r48287
parent ece2d1b8
2001-12-23 Richard Henderson <rth@redhat.com>
* calls.c (expand_call): Don't turn off ECF_LIBCALL_BLOCK for
an invalid result register; do end the sequence properly.
(emit_library_call_value_1): Likewise.
2001-12-22 Aldy Hernandez <aldyh@redhat.com> 2001-12-22 Aldy Hernandez <aldyh@redhat.com>
* config/rs6000/rs6000.h (rs6000_builtins): Add vsldoi variants. * config/rs6000/rs6000.h (rs6000_builtins): Add vsldoi variants.
......
...@@ -2937,9 +2937,6 @@ expand_call (exp, target, ignore) ...@@ -2937,9 +2937,6 @@ expand_call (exp, target, ignore)
valreg = hard_function_value (TREE_TYPE (exp), fndecl, (pass == 0)); valreg = hard_function_value (TREE_TYPE (exp), fndecl, (pass == 0));
} }
if (valreg == 0 || GET_CODE (valreg) == PARALLEL)
flags &= ~ECF_LIBCALL_BLOCK;
/* Precompute all register parameters. It isn't safe to compute anything /* Precompute all register parameters. It isn't safe to compute anything
once we have started filling any specific hard regs. */ once we have started filling any specific hard regs. */
precompute_register_parameters (num_actuals, args, &reg_parm_seen); precompute_register_parameters (num_actuals, args, &reg_parm_seen);
...@@ -3071,18 +3068,29 @@ expand_call (exp, target, ignore) ...@@ -3071,18 +3068,29 @@ expand_call (exp, target, ignore)
we have no way to move such values into a pseudo register. */ we have no way to move such values into a pseudo register. */
if (pass && (flags & ECF_LIBCALL_BLOCK)) if (pass && (flags & ECF_LIBCALL_BLOCK))
{ {
rtx insns;
if (valreg == 0 || GET_CODE (valreg) == PARALLEL)
{
insns = get_insns ();
end_sequence ();
emit_insns (insns);
}
else
{
rtx note = 0; rtx note = 0;
rtx temp = gen_reg_rtx (GET_MODE (valreg)); rtx temp = gen_reg_rtx (GET_MODE (valreg));
rtx insns;
/* Mark the return value as a pointer if needed. */ /* Mark the return value as a pointer if needed. */
if (TREE_CODE (TREE_TYPE (exp)) == POINTER_TYPE) if (TREE_CODE (TREE_TYPE (exp)) == POINTER_TYPE)
mark_reg_pointer (temp, TYPE_ALIGN (TREE_TYPE (TREE_TYPE (exp)))); mark_reg_pointer (temp,
TYPE_ALIGN (TREE_TYPE (TREE_TYPE (exp))));
/* Construct an "equal form" for the value which mentions all the /* Construct an "equal form" for the value which mentions all the
arguments in order as well as the function name. */ arguments in order as well as the function name. */
for (i = 0; i < num_actuals; i++) for (i = 0; i < num_actuals; i++)
note = gen_rtx_EXPR_LIST (VOIDmode, args[i].initial_value, note); note = gen_rtx_EXPR_LIST (VOIDmode,
args[i].initial_value, note);
note = gen_rtx_EXPR_LIST (VOIDmode, funexp, note); note = gen_rtx_EXPR_LIST (VOIDmode, funexp, note);
insns = get_insns (); insns = get_insns ();
...@@ -3092,12 +3100,14 @@ expand_call (exp, target, ignore) ...@@ -3092,12 +3100,14 @@ expand_call (exp, target, ignore)
note = gen_rtx_EXPR_LIST (VOIDmode, note = gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_USE (VOIDmode, gen_rtx_USE (VOIDmode,
gen_rtx_MEM (BLKmode, gen_rtx_MEM (BLKmode,
gen_rtx_SCRATCH (VOIDmode))), note); gen_rtx_SCRATCH (VOIDmode))),
note);
emit_libcall_block (insns, temp, valreg, note); emit_libcall_block (insns, temp, valreg, note);
valreg = temp; valreg = temp;
} }
}
else if (pass && (flags & ECF_MALLOC)) else if (pass && (flags & ECF_MALLOC))
{ {
rtx temp = gen_reg_rtx (GET_MODE (valreg)); rtx temp = gen_reg_rtx (GET_MODE (valreg));
...@@ -4021,8 +4031,6 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p) ...@@ -4021,8 +4031,6 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
NO_DEFER_POP; NO_DEFER_POP;
valreg = (mem_value == 0 && outmode != VOIDmode valreg = (mem_value == 0 && outmode != VOIDmode
? hard_libcall_value (outmode) : NULL_RTX); ? hard_libcall_value (outmode) : NULL_RTX);
if (valreg == 0 || GET_CODE (valreg) == PARALLEL)
flags &= ~ECF_LIBCALL_BLOCK;
/* Stack must be properly aligned now. */ /* Stack must be properly aligned now. */
if (stack_pointer_delta & (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT - 1)) if (stack_pointer_delta & (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT - 1))
...@@ -4078,9 +4086,18 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p) ...@@ -4078,9 +4086,18 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
we have no way to move such values into a pseudo register. */ we have no way to move such values into a pseudo register. */
if (flags & ECF_LIBCALL_BLOCK) if (flags & ECF_LIBCALL_BLOCK)
{ {
rtx insns;
if (valreg == 0 || GET_CODE (valreg) == PARALLEL)
{
insns = get_insns ();
end_sequence ();
emit_insns (insns);
}
else
{
rtx note = 0; rtx note = 0;
rtx temp = gen_reg_rtx (GET_MODE (valreg)); rtx temp = gen_reg_rtx (GET_MODE (valreg));
rtx insns;
int i; int i;
/* Construct an "equal form" for the value which mentions all the /* Construct an "equal form" for the value which mentions all the
...@@ -4096,12 +4113,14 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p) ...@@ -4096,12 +4113,14 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
note = gen_rtx_EXPR_LIST (VOIDmode, note = gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_USE (VOIDmode, gen_rtx_USE (VOIDmode,
gen_rtx_MEM (BLKmode, gen_rtx_MEM (BLKmode,
gen_rtx_SCRATCH (VOIDmode))), note); gen_rtx_SCRATCH (VOIDmode))),
note);
emit_libcall_block (insns, temp, valreg, note); emit_libcall_block (insns, temp, valreg, note);
valreg = temp; valreg = temp;
} }
}
pop_temp_slots (); pop_temp_slots ();
/* Copy the value to the right place. */ /* Copy the value to the right place. */
......
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