aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2001-12-23 05:02:18 -0800
committerRichard Henderson <rth@gcc.gnu.org>2001-12-23 05:02:18 -0800
commite4abc3d580c4fb7f63776b4653a710f30e57a265 (patch)
tree9e46f90736e54cf6b2d557a083a96a27c888a025 /gcc
parentece2d1b8245459f35afcaf72ff1f5cd1d1c859e5 (diff)
downloadgcc-e4abc3d580c4fb7f63776b4653a710f30e57a265.zip
gcc-e4abc3d580c4fb7f63776b4653a710f30e57a265.tar.gz
gcc-e4abc3d580c4fb7f63776b4653a710f30e57a265.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/calls.c111
2 files changed, 71 insertions, 46 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8f1873c..3db09bb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+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>
* config/rs6000/rs6000.h (rs6000_builtins): Add vsldoi variants.
diff --git a/gcc/calls.c b/gcc/calls.c
index 2049bd2..a6c999c 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -2937,9 +2937,6 @@ expand_call (exp, target, ignore)
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
once we have started filling any specific hard regs. */
precompute_register_parameters (num_actuals, args, &reg_parm_seen);
@@ -3071,32 +3068,45 @@ expand_call (exp, target, ignore)
we have no way to move such values into a pseudo register. */
if (pass && (flags & ECF_LIBCALL_BLOCK))
{
- rtx note = 0;
- rtx temp = gen_reg_rtx (GET_MODE (valreg));
rtx insns;
- /* Mark the return value as a pointer if needed. */
- if (TREE_CODE (TREE_TYPE (exp)) == POINTER_TYPE)
- mark_reg_pointer (temp, TYPE_ALIGN (TREE_TYPE (TREE_TYPE (exp))));
-
- /* Construct an "equal form" for the value which mentions all the
- arguments in order as well as the function name. */
- for (i = 0; i < num_actuals; i++)
- note = gen_rtx_EXPR_LIST (VOIDmode, args[i].initial_value, note);
- note = gen_rtx_EXPR_LIST (VOIDmode, funexp, note);
-
- insns = get_insns ();
- end_sequence ();
-
- if (flags & ECF_PURE)
- note = gen_rtx_EXPR_LIST (VOIDmode,
- gen_rtx_USE (VOIDmode,
- gen_rtx_MEM (BLKmode,
- gen_rtx_SCRATCH (VOIDmode))), note);
-
- emit_libcall_block (insns, temp, valreg, note);
-
- valreg = temp;
+ if (valreg == 0 || GET_CODE (valreg) == PARALLEL)
+ {
+ insns = get_insns ();
+ end_sequence ();
+ emit_insns (insns);
+ }
+ else
+ {
+ rtx note = 0;
+ rtx temp = gen_reg_rtx (GET_MODE (valreg));
+
+ /* Mark the return value as a pointer if needed. */
+ if (TREE_CODE (TREE_TYPE (exp)) == POINTER_TYPE)
+ mark_reg_pointer (temp,
+ TYPE_ALIGN (TREE_TYPE (TREE_TYPE (exp))));
+
+ /* Construct an "equal form" for the value which mentions all the
+ arguments in order as well as the function name. */
+ for (i = 0; i < num_actuals; i++)
+ note = gen_rtx_EXPR_LIST (VOIDmode,
+ args[i].initial_value, note);
+ note = gen_rtx_EXPR_LIST (VOIDmode, funexp, note);
+
+ insns = get_insns ();
+ end_sequence ();
+
+ if (flags & ECF_PURE)
+ note = gen_rtx_EXPR_LIST (VOIDmode,
+ gen_rtx_USE (VOIDmode,
+ gen_rtx_MEM (BLKmode,
+ gen_rtx_SCRATCH (VOIDmode))),
+ note);
+
+ emit_libcall_block (insns, temp, valreg, note);
+
+ valreg = temp;
+ }
}
else if (pass && (flags & ECF_MALLOC))
{
@@ -4021,8 +4031,6 @@ emit_library_call_value_1 (retval, orgfun, value, fn_type, outmode, nargs, p)
NO_DEFER_POP;
valreg = (mem_value == 0 && outmode != VOIDmode
? hard_libcall_value (outmode) : NULL_RTX);
- if (valreg == 0 || GET_CODE (valreg) == PARALLEL)
- flags &= ~ECF_LIBCALL_BLOCK;
/* Stack must be properly aligned now. */
if (stack_pointer_delta & (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT - 1))
@@ -4078,29 +4086,40 @@ 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. */
if (flags & ECF_LIBCALL_BLOCK)
{
- rtx note = 0;
- rtx temp = gen_reg_rtx (GET_MODE (valreg));
rtx insns;
- int i;
- /* Construct an "equal form" for the value which mentions all the
- arguments in order as well as the function name. */
- for (i = 0; i < nargs; i++)
- note = gen_rtx_EXPR_LIST (VOIDmode, argvec[i].value, note);
- note = gen_rtx_EXPR_LIST (VOIDmode, fun, note);
+ if (valreg == 0 || GET_CODE (valreg) == PARALLEL)
+ {
+ insns = get_insns ();
+ end_sequence ();
+ emit_insns (insns);
+ }
+ else
+ {
+ rtx note = 0;
+ rtx temp = gen_reg_rtx (GET_MODE (valreg));
+ int i;
- insns = get_insns ();
- end_sequence ();
+ /* Construct an "equal form" for the value which mentions all the
+ arguments in order as well as the function name. */
+ for (i = 0; i < nargs; i++)
+ note = gen_rtx_EXPR_LIST (VOIDmode, argvec[i].value, note);
+ note = gen_rtx_EXPR_LIST (VOIDmode, fun, note);
- if (flags & ECF_PURE)
- note = gen_rtx_EXPR_LIST (VOIDmode,
- gen_rtx_USE (VOIDmode,
- gen_rtx_MEM (BLKmode,
- gen_rtx_SCRATCH (VOIDmode))), note);
+ insns = get_insns ();
+ end_sequence ();
- emit_libcall_block (insns, temp, valreg, note);
+ if (flags & ECF_PURE)
+ note = gen_rtx_EXPR_LIST (VOIDmode,
+ gen_rtx_USE (VOIDmode,
+ gen_rtx_MEM (BLKmode,
+ gen_rtx_SCRATCH (VOIDmode))),
+ note);
+
+ emit_libcall_block (insns, temp, valreg, note);
- valreg = temp;
+ valreg = temp;
+ }
}
pop_temp_slots ();