Commit eb6f47fb by Richard Sandiford Committed by Richard Sandiford

target-insns.def (trap): New targetm instruction pattern.

gcc/
	* target-insns.def (trap): New targetm instruction pattern.
	* builtins.c (expand_builtin_trap): Use it instead of HAVE_*/gen_*
	interface.
	* explow.c (allocate_dynamic_stack_space): Likewise.
	* ifcvt.c (find_if_header): Likewise.

From-SVN: r225425
parent 134b044d
2015-07-05 Richard Sandiford <richard.sandiford@arm.com> 2015-07-05 Richard Sandiford <richard.sandiford@arm.com>
* target-insns.def (trap): New targetm instruction pattern.
* builtins.c (expand_builtin_trap): Use it instead of HAVE_*/gen_*
interface.
* explow.c (allocate_dynamic_stack_space): Likewise.
* ifcvt.c (find_if_header): Likewise.
2015-07-05 Richard Sandiford <richard.sandiford@arm.com>
* target-insns.def (prefetch): New targetm instruction pattern. * target-insns.def (prefetch): New targetm instruction pattern.
* tree-ssa-loop-prefetch.c: Include targeth. * tree-ssa-loop-prefetch.c: Include targeth.
(tree_ssa_prefetch_arrays): Use prefetch targetm pattern instead (tree_ssa_prefetch_arrays): Use prefetch targetm pattern instead
......
...@@ -4737,10 +4737,9 @@ expand_builtin_assume_aligned (tree exp, rtx target) ...@@ -4737,10 +4737,9 @@ expand_builtin_assume_aligned (tree exp, rtx target)
void void
expand_builtin_trap (void) expand_builtin_trap (void)
{ {
#ifdef HAVE_trap if (targetm.have_trap ())
if (HAVE_trap)
{ {
rtx_insn *insn = emit_insn (gen_trap ()); rtx_insn *insn = emit_insn (targetm.gen_trap ());
/* For trap insns when not accumulating outgoing args force /* For trap insns when not accumulating outgoing args force
REG_ARGS_SIZE note to prevent crossjumping of calls with REG_ARGS_SIZE note to prevent crossjumping of calls with
different args sizes. */ different args sizes. */
...@@ -4748,7 +4747,6 @@ expand_builtin_trap (void) ...@@ -4748,7 +4747,6 @@ expand_builtin_trap (void)
add_reg_note (insn, REG_ARGS_SIZE, GEN_INT (stack_pointer_delta)); add_reg_note (insn, REG_ARGS_SIZE, GEN_INT (stack_pointer_delta));
} }
else else
#endif
emit_library_call (abort_libfunc, LCT_NORETURN, VOIDmode, 0); emit_library_call (abort_libfunc, LCT_NORETURN, VOIDmode, 0);
emit_barrier (); emit_barrier ();
} }
......
...@@ -1422,11 +1422,9 @@ allocate_dynamic_stack_space (rtx size, unsigned size_align, ...@@ -1422,11 +1422,9 @@ allocate_dynamic_stack_space (rtx size, unsigned size_align,
emit_cmp_and_jump_insns (available, size, GEU, NULL_RTX, Pmode, 1, emit_cmp_and_jump_insns (available, size, GEU, NULL_RTX, Pmode, 1,
space_available); space_available);
#ifdef HAVE_trap if (targetm.have_trap ())
if (HAVE_trap) emit_insn (targetm.gen_trap ());
emit_insn (gen_trap ());
else else
#endif
error ("stack limits not supported on this target"); error ("stack limits not supported on this target");
emit_barrier (); emit_barrier ();
emit_label (space_available); emit_label (space_available);
......
...@@ -67,9 +67,6 @@ ...@@ -67,9 +67,6 @@
#ifndef HAVE_decscc #ifndef HAVE_decscc
#define HAVE_decscc 0 #define HAVE_decscc 0
#endif #endif
#ifndef HAVE_trap
#define HAVE_trap 0
#endif
#ifndef MAX_CONDITIONAL_EXECUTE #ifndef MAX_CONDITIONAL_EXECUTE
#define MAX_CONDITIONAL_EXECUTE \ #define MAX_CONDITIONAL_EXECUTE \
...@@ -3414,7 +3411,7 @@ find_if_header (basic_block test_bb, int pass) ...@@ -3414,7 +3411,7 @@ find_if_header (basic_block test_bb, int pass)
&& cond_exec_find_if_block (&ce_info)) && cond_exec_find_if_block (&ce_info))
goto success; goto success;
if (HAVE_trap if (targetm.have_trap ()
&& optab_handler (ctrap_optab, word_mode) != CODE_FOR_nothing && optab_handler (ctrap_optab, word_mode) != CODE_FOR_nothing
&& find_cond_trap (test_bb, then_edge, else_edge)) && find_cond_trap (test_bb, then_edge, else_edge))
goto success; goto success;
......
...@@ -51,5 +51,6 @@ DEF_TARGET_INSN (sibcall_epilogue, (void)) ...@@ -51,5 +51,6 @@ DEF_TARGET_INSN (sibcall_epilogue, (void))
DEF_TARGET_INSN (simple_return, (void)) DEF_TARGET_INSN (simple_return, (void))
DEF_TARGET_INSN (store_multiple, (rtx x0, rtx x1, rtx x2)) DEF_TARGET_INSN (store_multiple, (rtx x0, rtx x1, rtx x2))
DEF_TARGET_INSN (tablejump, (rtx x0, rtx x1)) DEF_TARGET_INSN (tablejump, (rtx x0, rtx x1))
DEF_TARGET_INSN (trap, (void))
DEF_TARGET_INSN (untyped_call, (rtx x0, rtx x1, rtx x2)) DEF_TARGET_INSN (untyped_call, (rtx x0, rtx x1, rtx x2))
DEF_TARGET_INSN (untyped_return, (rtx x0, rtx x1)) DEF_TARGET_INSN (untyped_return, (rtx x0, rtx x1))
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