diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2015-06-25 17:18:12 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2015-06-25 17:18:12 +0000 |
commit | 4bccb39ebaecc3c91ea8aee58dc0c71d5a7e3b95 (patch) | |
tree | d4c2043c4d2fe1765f3dec6cc791fa7b0f3a1899 /gcc/function.c | |
parent | d58627a0c75748b24e1c182d0c4cc1d5136cb42c (diff) | |
download | gcc-4bccb39ebaecc3c91ea8aee58dc0c71d5a7e3b95.zip gcc-4bccb39ebaecc3c91ea8aee58dc0c71d5a7e3b95.tar.gz gcc-4bccb39ebaecc3c91ea8aee58dc0c71d5a7e3b95.tar.bz2 |
Makefile.in (TARGET_DEF): Add target-insns.def.
gcc/
* Makefile.in (TARGET_DEF): Add target-insns.def.
(.PRECIOUS, simple_rtl_generated_h): Add insn-target-def.h.
(build/gentarget-def.o): New rule.
(genprogrtl): Add target-def.
* target-insns.def, gentarget-def.c: New files.
* target.def: Add targetm.have_* and targetm.gen_* hooks,
based on the contents of target-insns.def.
* defaults.h (HAVE_simple_return, gen_simple_return): Delete.
(HAVE_return, gen_return): Delete.
* target-def.h: Include insn-target-def.h.
* cfgrtl.c (force_nonfallthru_and_redirect): Use targetm interface
instead of direct calls. Rely on them to do the appropriate assertions.
* function.c (gen_return_pattern): Likewise. Return an rtx_insn *.
(convert_jumps_to_returns): Use targetm interface instead of
direct calls.
(thread_prologue_and_epilogue_insns): Likewise.
* reorg.c (find_end_label, dbr_schedule): Likewise.
* shrink-wrap.h (SHRINK_WRAPPING_ENABLED): Likewise.
* shrink-wrap.c (convert_to_simple_return): Likewise.
(try_shrink_wrapping): Use SHRINK_WRAPPING_ENABLED.
From-SVN: r224979
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/gcc/function.c b/gcc/function.c index cb3e9bb..cffe323 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -5614,13 +5614,12 @@ emit_use_return_register_into_block (basic_block bb) /* Create a return pattern, either simple_return or return, depending on simple_p. */ -static rtx +static rtx_insn * gen_return_pattern (bool simple_p) { - if (!HAVE_simple_return) - gcc_assert (!simple_p); - - return simple_p ? gen_simple_return () : gen_return (); + return (simple_p + ? targetm.gen_simple_return () + : targetm.gen_return ()); } /* Insert an appropriate return pattern at the end of block BB. This @@ -5726,7 +5725,7 @@ convert_jumps_to_returns (basic_block last_bb, bool simple_p, dest = ret_rtx; if (!redirect_jump (as_a <rtx_jump_insn *> (jump), dest, 0)) { - if (HAVE_simple_return && simple_p) + if (targetm.have_simple_return () && simple_p) { if (dump_file) fprintf (dump_file, @@ -5747,7 +5746,7 @@ convert_jumps_to_returns (basic_block last_bb, bool simple_p, } else { - if (HAVE_simple_return && simple_p) + if (targetm.have_simple_return () && simple_p) { if (dump_file) fprintf (dump_file, @@ -5938,12 +5937,12 @@ thread_prologue_and_epilogue_insns (void) exit_fallthru_edge = find_fallthru_edge (EXIT_BLOCK_PTR_FOR_FN (cfun)->preds); - if (HAVE_simple_return && entry_edge != orig_entry_edge) + if (targetm.have_simple_return () && entry_edge != orig_entry_edge) exit_fallthru_edge = get_unconverted_simple_return (exit_fallthru_edge, bb_flags, &unconverted_simple_returns, &returnjump); - if (HAVE_return) + if (targetm.have_return ()) { if (exit_fallthru_edge == NULL) goto epilogue_done; @@ -5964,7 +5963,8 @@ thread_prologue_and_epilogue_insns (void) /* Emitting the return may add a basic block. Fix bb_flags for the added block. */ - if (HAVE_simple_return && last_bb != exit_fallthru_edge->src) + if (targetm.have_simple_return () + && last_bb != exit_fallthru_edge->src) bitmap_set_bit (&bb_flags, last_bb->index); goto epilogue_done; @@ -6080,7 +6080,7 @@ epilogue_done: } } - if (HAVE_simple_return) + if (targetm.have_simple_return ()) convert_to_simple_return (entry_edge, orig_entry_edge, bb_flags, returnjump, unconverted_simple_returns); @@ -6096,8 +6096,9 @@ epilogue_done: if (!CALL_P (insn) || ! SIBLING_CALL_P (insn) - || (HAVE_simple_return && (entry_edge != orig_entry_edge - && !bitmap_bit_p (&bb_flags, bb->index)))) + || (targetm.have_simple_return () + && entry_edge != orig_entry_edge + && !bitmap_bit_p (&bb_flags, bb->index))) { ei_next (&ei); continue; |