Commit c134da6b by Hans-Peter Nilsson Committed by Hans-Peter Nilsson

re PR target/7042 (cris-elf miscompiles line_hints in ghostscript - "return" delay slot bug)

	PR target/7042
	* reorg.c (make_return_insns) [DELAY_SLOTS_FOR_EPILOGUE]: Exit
	early if current_function_epilogue_delay_list is non-empty.
	* config/cris/cris.md ("return"): Add sanity check asserting that
	current_function_epilogue_delay_list is empty.

From-SVN: r54668
parent 038c7976
2002-06-16 Hans-Peter Nilsson <hp@axis.com>
PR target/7042
* reorg.c (make_return_insns) [DELAY_SLOTS_FOR_EPILOGUE]: Exit
early if current_function_epilogue_delay_list is non-empty.
* config/cris/cris.md ("return"): Add sanity check asserting that
current_function_epilogue_delay_list is empty.
2002-06-16 Jeff Law <law@redhat.com> 2002-06-16 Jeff Law <law@redhat.com>
* toplev.c (rest_of_compilation): Perform a simpler, less costly * toplev.c (rest_of_compilation): Perform a simpler, less costly
......
...@@ -3394,6 +3394,11 @@ ...@@ -3394,6 +3394,11 @@
/* Just needs to hold a 'movem [sp+],rN'. */ /* Just needs to hold a 'movem [sp+],rN'. */
char rd[sizeof (\"movem [$sp+],$r99\")]; char rd[sizeof (\"movem [$sp+],$r99\")];
/* Try to avoid reorg.c surprises; avoid emitting invalid code, prefer
crashing. This test would have avoided invalid code for target/7042. */
if (current_function_epilogue_delay_list != NULL)
abort ();
*rd = 0; *rd = 0;
/* Start from the last call-saved register. We know that we have a /* Start from the last call-saved register. We know that we have a
......
...@@ -3485,6 +3485,17 @@ make_return_insns (first) ...@@ -3485,6 +3485,17 @@ make_return_insns (first)
rtx real_return_label = end_of_function_label; rtx real_return_label = end_of_function_label;
int slots, i; int slots, i;
#ifdef DELAY_SLOTS_FOR_EPILOGUE
/* If a previous pass filled delay slots in the epilogue, things get a
bit more complicated, as those filler insns would generally (without
data flow analysis) have to be executed after any existing branch
delay slot filler insns. It is also unknown whether such a
transformation would actually be profitable. Note that the existing
code only cares for branches with (some) filled delay slots. */
if (current_function_epilogue_delay_list != NULL)
return;
#endif
/* See if there is a RETURN insn in the function other than the one we /* See if there is a RETURN insn in the function other than the one we
made for END_OF_FUNCTION_LABEL. If so, set up anything we can't change made for END_OF_FUNCTION_LABEL. If so, set up anything we can't change
into a RETURN to jump to it. */ into a RETURN to jump to it. */
......
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