Commit 15768583 by John David Anglin Committed by John David Anglin

PR Bug middle-end/50232

	PR Bug middle-end/50232
	* config/pa/pa.md (return): Define "return" insn pattern.
	(epilogue): Use it when no epilogue is needed.
	* config/pa/pa.c (pa_can_use_return_insn): New function.
	* config/pa/pa-protos.h (pa_can_use_return_insn): Declare.

From-SVN: r178500
parent 13868f40
2011-09-03 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR Bug middle-end/50232
* config/pa/pa.md (return): Define "return" insn pattern.
(epilogue): Use it when no epilogue is needed.
* config/pa/pa.c (pa_can_use_return_insn): New function.
* config/pa/pa-protos.h (pa_can_use_return_insn): Declare.
2011-09-03 Eric Botcazou <ebotcazou@adacore.com> 2011-09-03 Eric Botcazou <ebotcazou@adacore.com>
* cfgexpand.c (add_stack_var): Assert that the alignment is not zero. * cfgexpand.c (add_stack_var): Assert that the alignment is not zero.
...@@ -93,6 +93,7 @@ extern int and_mask_p (unsigned HOST_WIDE_INT); ...@@ -93,6 +93,7 @@ extern int and_mask_p (unsigned HOST_WIDE_INT);
extern int cint_ok_for_move (HOST_WIDE_INT); extern int cint_ok_for_move (HOST_WIDE_INT);
extern void hppa_expand_prologue (void); extern void hppa_expand_prologue (void);
extern void hppa_expand_epilogue (void); extern void hppa_expand_epilogue (void);
extern bool pa_can_use_return_insn (void);
extern int ior_mask_p (unsigned HOST_WIDE_INT); extern int ior_mask_p (unsigned HOST_WIDE_INT);
extern void compute_zdepdi_operands (unsigned HOST_WIDE_INT, extern void compute_zdepdi_operands (unsigned HOST_WIDE_INT,
unsigned *); unsigned *);
......
...@@ -4329,6 +4329,24 @@ hppa_expand_epilogue (void) ...@@ -4329,6 +4329,24 @@ hppa_expand_epilogue (void)
} }
} }
bool
pa_can_use_return_insn (void)
{
if (!reload_completed)
return false;
if (frame_pointer_needed)
return false;
if (df_regs_ever_live_p (2))
return false;
if (crtl->profile)
return false;
return compute_frame_size (get_frame_size (), 0) == 0;
}
rtx rtx
hppa_pic_save_rtx (void) hppa_pic_save_rtx (void)
{ {
......
...@@ -6671,6 +6671,20 @@ ...@@ -6671,6 +6671,20 @@
;; Unconditional and other jump instructions. ;; Unconditional and other jump instructions.
;; Trivial return used when no epilogue is needed.
(define_insn "return"
[(return)
(use (reg:SI 2))]
"pa_can_use_return_insn ()"
"*
{
if (TARGET_PA_20)
return \"bve%* (%%r2)\";
return \"bv%* %%r0(%%r2)\";
}"
[(set_attr "type" "branch")
(set_attr "length" "4")])
;; This is used for most returns. ;; This is used for most returns.
(define_insn "return_internal" (define_insn "return_internal"
[(return) [(return)
...@@ -6719,11 +6733,8 @@ ...@@ -6719,11 +6733,8 @@
rtx x; rtx x;
/* Try to use the trivial return first. Else use the full epilogue. */ /* Try to use the trivial return first. Else use the full epilogue. */
if (reload_completed if (pa_can_use_return_insn ())
&& !frame_pointer_needed x = gen_return ();
&& !df_regs_ever_live_p (2)
&& (compute_frame_size (get_frame_size (), 0) ? 0 : 1))
x = gen_return_internal ();
else else
{ {
hppa_expand_epilogue (); hppa_expand_epilogue ();
......
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