aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2001-06-08 21:52:06 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2001-06-08 19:52:06 +0000
commit932f084749dd624f549cddd5e07eb38727c59faf (patch)
treeb07fd69ba2ffb8acd24dffe5735fd98425a31181 /gcc/function.c
parentcd3bb27790771150d4ab39e5b3b0094bafe0cd19 (diff)
downloadgcc-932f084749dd624f549cddd5e07eb38727c59faf.zip
gcc-932f084749dd624f549cddd5e07eb38727c59faf.tar.gz
gcc-932f084749dd624f549cddd5e07eb38727c59faf.tar.bz2
function.c (diddle_return_value): Kill code to determine return value before expand_function_end.
* function.c (diddle_return_value): Kill code to determine return value before expand_function_end. (expand_function_end): Delay call to clobber_return_register after fucntion return value is computed. Re-install temporary reverted patch: * toplev.c (rest_of_compilation): Call split_all_insns before reg-stack and shorten-branches. Do shorten-branches after reg-stack. * final.c (shorten_branches): Remove insn splitting code. From-SVN: r43044
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c59
1 files changed, 21 insertions, 38 deletions
diff --git a/gcc/function.c b/gcc/function.c
index cef6697..cdfe697b 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -6542,37 +6542,10 @@ diddle_return_value (doit, arg)
void *arg;
{
rtx outgoing = current_function_return_rtx;
- int pcc;
if (! outgoing)
return;
- pcc = (current_function_returns_struct
- || current_function_returns_pcc_struct);
-
- if ((GET_CODE (outgoing) == REG
- && REGNO (outgoing) >= FIRST_PSEUDO_REGISTER)
- || pcc)
- {
- tree type = TREE_TYPE (DECL_RESULT (current_function_decl));
-
- /* A PCC-style return returns a pointer to the memory in which
- the structure is stored. */
- if (pcc)
- type = build_pointer_type (type);
-
-#ifdef FUNCTION_OUTGOING_VALUE
- outgoing = FUNCTION_OUTGOING_VALUE (type, current_function_decl);
-#else
- outgoing = FUNCTION_VALUE (type, current_function_decl);
-#endif
- /* If this is a BLKmode structure being returned in registers, then use
- the mode computed in expand_return. */
- if (GET_MODE (outgoing) == BLKmode)
- PUT_MODE (outgoing, GET_MODE (current_function_return_rtx));
- REG_FUNCTION_VALUE_P (outgoing) = 1;
- }
-
if (GET_CODE (outgoing) == REG)
(*doit) (outgoing, arg);
else if (GET_CODE (outgoing) == PARALLEL)
@@ -6641,6 +6614,7 @@ expand_function_end (filename, line, end_bindings)
int end_bindings;
{
tree link;
+ rtx clobber_after;
#ifdef TRAMPOLINE_TEMPLATE
static rtx initial_trampoline;
@@ -6787,17 +6761,11 @@ expand_function_end (filename, line, end_bindings)
registers so that they are not propogated live to the rest of
the function. This can only happen with functions that drop
through; if there had been a return statement, there would
- have either been a return rtx, or a jump to the return label. */
- {
- rtx before, after;
-
- before = get_last_insn ();
- clobber_return_register ();
- after = get_last_insn ();
-
- if (before != after)
- cfun->x_clobber_return_insn = after;
- }
+ have either been a return rtx, or a jump to the return label.
+
+ We delay actual code generation after the current_function_value_rtx
+ is computed. */
+ clobber_after = get_last_insn ();
/* Output the label for the actual return from the function,
if one is expected. This happens either because a function epilogue
@@ -6946,6 +6914,21 @@ expand_function_end (filename, line, end_bindings)
communicate between __builtin_eh_return and the epilogue. */
expand_eh_return ();
+ /* Emit the actual code to clobber return register. */
+ {
+ rtx seq, after;
+
+ start_sequence ();
+ clobber_return_register ();
+ seq = gen_sequence ();
+ end_sequence ();
+
+ after = emit_insn_after (seq, clobber_after);
+
+ if (clobber_after != after)
+ cfun->x_clobber_return_insn = after;
+ }
+
/* ??? This should no longer be necessary since stupid is no longer with
us, but there are some parts of the compiler (eg reload_combine, and
sh mach_dep_reorg) that still try and compute their own lifetime info