aboutsummaryrefslogtreecommitdiff
path: root/gcc/emit-rtl.c
diff options
context:
space:
mode:
authorBernd Schmidt <bernds@codesourcery.com>2011-08-27 17:38:58 +0000
committerBernd Schmidt <bernds@codesourcery.com>2011-08-27 17:38:58 +0000
commitfeb137ef014784d22bc0dd5bf39fab35e7b53b8a (patch)
tree96c64ae5371e1ab349170887878b88e9fec9c9a9 /gcc/emit-rtl.c
parent74aa0352ff529c5b6aa0c33f5266ec4b57c46f8e (diff)
* doc/rtl.texi (simple_return): Document.
(parallel, PATTERN): Here too. * doc/md.texi (return): Mention it's allowed to expand to simple_return in some cases. (simple_return): Document standard pattern. * gengenrtl.c (special_rtx): SIMPLE_RETURN is special. * final.c (final_scan_insn): Use ANY_RETURN_P on body. * reorg.c (function_return_label, function_simple_return_label): New static variables, replacing... (end_of_function_label): ... this. (simplejump_or_return_p): New static function. (optimize_skip, steal_delay_list_from_fallthrough, fill_slots_from_thread): Use it. (relax_delay_slots): Likewise. Use ANY_RETURN_P on body. (rare_destination, follow_jumps): Use ANY_RETURN_P on body. (find_end_label): Take a new arg which is one of the two return rtxs. Depending on which, set either function_return_label or function_simple_return_label. All callers changed. (make_return_insns): Make both kinds. (dbr_schedule): Adjust for two kinds of end labels. * function.c (emit_return_into_block): Set JUMP_LABEL properly. * genemit.c (gen_exp): Handle SIMPLE_RETURN. (gen_expand, gen_split): Use ANY_RETURN_P. * df-scan.c (df_uses_record): Handle SIMPLE_RETURN. * rtl.def (SIMPLE_RETURN): New code. * ifcvt.c (find_if_case_1): Be more careful about redirecting jumps to the EXIT_BLOCK. * jump.c (condjump_p, condjump_in_parallel_p, any_condjump_p, returnjump_p_1): Handle SIMPLE_RETURNs. * print-rtl.c (print_rtx): Likewise. * rtl.c (copy_rtx): Likewise. * bt-load.c (compute_defs_uses_and_gen): Use ANY_RETURN_P. * combine.c (simplify_set): Likewise. * resource.c (find_dead_or_set_registers, mark_set_resources): Likewise. * emit-rtl.c (verify_rtx_sharing, classify_insn, copy_insn_1, copy_rtx_if_shared_1, mark_used_flags): Handle SIMPLE_RETURNs. (init_emit_regs): Initialize simple_return_rtx. * cfglayout.c (fixup_reorder_chain): Pass a JUMP_LABEL to force_nonfallthru_and_redirect. * rtl.h (ANY_RETURN_P): Allow SIMPLE_RETURN. (GR_SIMPLE_RETURN): New enum value. (simple_return_rtx): New macro. * basic-block.h (force_nonfallthru_and_redirect): Adjust declaration. * cfgrtl.c (force_nonfallthru_and_redirect): Take a new jump_label argument. All callers changed. Be careful about what kinds of returnjumps to generate. * config/i386/3i86.c (ix86_pad_returns, ix86_count_insn_bb, ix86_pad_short_function): Likewise. * config/arm/arm.c (arm_final_prescan_insn): Handle both kinds of return. * config/mips/mips.md (any_return): New code_iterator. (optab): Add cases for return and simple_return. (return): Expand to a simple_return. (simple_return): New pattern. (*<optab>, *<optab>_internal for any_return): New patterns. (return_internal): Remove. * config/mips/mips.c (mips_expand_epilogue): Make the last insn a simple_return_internal. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@178135 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r--gcc/emit-rtl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 25628e40bc2..b97d7c47a0b 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -2518,6 +2518,7 @@ verify_rtx_sharing (rtx orig, rtx insn)
case PC:
case CC0:
case RETURN:
+ case SIMPLE_RETURN:
case SCRATCH:
return;
/* SCRATCH must be shared because they represent distinct values. */
@@ -2725,6 +2726,7 @@ repeat:
case PC:
case CC0:
case RETURN:
+ case SIMPLE_RETURN:
case SCRATCH:
/* SCRATCH must be shared because they represent distinct values. */
return;
@@ -2845,6 +2847,7 @@ repeat:
case PC:
case CC0:
case RETURN:
+ case SIMPLE_RETURN:
return;
case DEBUG_INSN:
@@ -5008,7 +5011,7 @@ classify_insn (rtx x)
return CODE_LABEL;
if (GET_CODE (x) == CALL)
return CALL_INSN;
- if (GET_CODE (x) == RETURN)
+ if (ANY_RETURN_P (x))
return JUMP_INSN;
if (GET_CODE (x) == SET)
{
@@ -5264,6 +5267,7 @@ copy_insn_1 (rtx orig)
case PC:
case CC0:
case RETURN:
+ case SIMPLE_RETURN:
return orig;
case CLOBBER:
if (REG_P (XEXP (orig, 0)) && REGNO (XEXP (orig, 0)) < FIRST_PSEUDO_REGISTER)
@@ -5521,6 +5525,7 @@ init_emit_regs (void)
/* Assign register numbers to the globally defined register rtx. */
pc_rtx = gen_rtx_fmt_ (PC, VOIDmode);
ret_rtx = gen_rtx_fmt_ (RETURN, VOIDmode);
+ simple_return_rtx = gen_rtx_fmt_ (SIMPLE_RETURN, VOIDmode);
cc0_rtx = gen_rtx_fmt_ (CC0, VOIDmode);
stack_pointer_rtx = gen_raw_REG (Pmode, STACK_POINTER_REGNUM);
frame_pointer_rtx = gen_raw_REG (Pmode, FRAME_POINTER_REGNUM);