Commit 932f0847 by Jan Hubicka Committed by Jan Hubicka

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
parent cd3bb277
Fri Jun 8 21:34:54 CEST 2001 Jan Hubicka <jh@suse.cz>
* 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.
2001-06-08 Joseph S. Myers <jsm28@cam.ac.uk> 2001-06-08 Joseph S. Myers <jsm28@cam.ac.uk>
* doc/gcc.texi, doc/invoke.texi: Add index of command line * doc/gcc.texi, doc/invoke.texi: Add index of command line
......
...@@ -960,26 +960,6 @@ shorten_branches (first) ...@@ -960,26 +960,6 @@ shorten_branches (first)
int uid; int uid;
rtx align_tab[MAX_CODE_ALIGN]; rtx align_tab[MAX_CODE_ALIGN];
/* In order to make sure that all instructions have valid length info,
we must split them before we compute the address/length info. */
for (insn = NEXT_INSN (first); insn; insn = NEXT_INSN (insn))
if (INSN_P (insn))
{
rtx old = insn;
/* Don't split the insn if it has been deleted. */
if (! INSN_DELETED_P (old))
insn = try_split (PATTERN (old), old, 1);
/* When not optimizing, the old insn will be still left around
with only the 'deleted' bit set. Transform it into a note
to avoid confusion of subsequent processing. */
if (INSN_DELETED_P (old))
{
PUT_CODE (old, NOTE);
NOTE_LINE_NUMBER (old) = NOTE_INSN_DELETED;
NOTE_SOURCE_FILE (old) = 0;
}
}
#endif #endif
/* We must do some computations even when not actually shortening, in /* We must do some computations even when not actually shortening, in
......
...@@ -6542,37 +6542,10 @@ diddle_return_value (doit, arg) ...@@ -6542,37 +6542,10 @@ diddle_return_value (doit, arg)
void *arg; void *arg;
{ {
rtx outgoing = current_function_return_rtx; rtx outgoing = current_function_return_rtx;
int pcc;
if (! outgoing) if (! outgoing)
return; 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) if (GET_CODE (outgoing) == REG)
(*doit) (outgoing, arg); (*doit) (outgoing, arg);
else if (GET_CODE (outgoing) == PARALLEL) else if (GET_CODE (outgoing) == PARALLEL)
...@@ -6641,6 +6614,7 @@ expand_function_end (filename, line, end_bindings) ...@@ -6641,6 +6614,7 @@ expand_function_end (filename, line, end_bindings)
int end_bindings; int end_bindings;
{ {
tree link; tree link;
rtx clobber_after;
#ifdef TRAMPOLINE_TEMPLATE #ifdef TRAMPOLINE_TEMPLATE
static rtx initial_trampoline; static rtx initial_trampoline;
...@@ -6787,17 +6761,11 @@ expand_function_end (filename, line, end_bindings) ...@@ -6787,17 +6761,11 @@ expand_function_end (filename, line, end_bindings)
registers so that they are not propogated live to the rest of registers so that they are not propogated live to the rest of
the function. This can only happen with functions that drop the function. This can only happen with functions that drop
through; if there had been a return statement, there would through; if there had been a return statement, there would
have either been a return rtx, or a jump to the return label. */ have either been a return rtx, or a jump to the return label.
{
rtx before, after; We delay actual code generation after the current_function_value_rtx
is computed. */
before = get_last_insn (); clobber_after = get_last_insn ();
clobber_return_register ();
after = get_last_insn ();
if (before != after)
cfun->x_clobber_return_insn = after;
}
/* Output the label for the actual return from the function, /* Output the label for the actual return from the function,
if one is expected. This happens either because a function epilogue if one is expected. This happens either because a function epilogue
...@@ -6946,6 +6914,21 @@ expand_function_end (filename, line, end_bindings) ...@@ -6946,6 +6914,21 @@ expand_function_end (filename, line, end_bindings)
communicate between __builtin_eh_return and the epilogue. */ communicate between __builtin_eh_return and the epilogue. */
expand_eh_return (); 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 /* ??? 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 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 sh mach_dep_reorg) that still try and compute their own lifetime info
......
...@@ -3685,18 +3685,16 @@ rest_of_compilation (decl) ...@@ -3685,18 +3685,16 @@ rest_of_compilation (decl)
} }
#endif #endif
#ifndef STACK_REGS
/* ??? Do this before shorten branches so that we aren't creating
insns too late and fail sanity checks in final. */
convert_to_eh_region_ranges ();
#endif
/* Shorten branches.
Note this must run before reg-stack because of death note (ab)use
in the ia32 backend. */
timevar_push (TV_SHORTEN_BRANCH); timevar_push (TV_SHORTEN_BRANCH);
shorten_branches (get_insns ()); if (0
#ifdef HAVE_ATTR_length
|| 1
#endif
#ifdef STACK_REGS
|| 1
#endif
)
split_all_insns (0);
timevar_pop (TV_SHORTEN_BRANCH); timevar_pop (TV_SHORTEN_BRANCH);
#ifdef STACK_REGS #ifdef STACK_REGS
...@@ -3709,9 +3707,14 @@ rest_of_compilation (decl) ...@@ -3709,9 +3707,14 @@ rest_of_compilation (decl)
timevar_pop (TV_REG_STACK); timevar_pop (TV_REG_STACK);
ggc_collect (); ggc_collect ();
#endif
convert_to_eh_region_ranges (); convert_to_eh_region_ranges ();
#endif
/* Shorten branches. */
timevar_push (TV_SHORTEN_BRANCH);
shorten_branches (get_insns ());
timevar_pop (TV_SHORTEN_BRANCH);
current_function_nothrow = nothrow_function_p (); current_function_nothrow = nothrow_function_p ();
if (current_function_nothrow) if (current_function_nothrow)
......
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