aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2015-07-05 07:56:45 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2015-07-05 07:56:45 +0000
commitc65aa0429d688103b446a7cb2985c351b52071f3 (patch)
tree8259493253aa32f29e39453efeeca64cecadb24b /gcc/cfgexpand.c
parent9c58793af54226c898ae27c913a8f9d85bbf948c (diff)
downloadgcc-c65aa0429d688103b446a7cb2985c351b52071f3.zip
gcc-c65aa0429d688103b446a7cb2985c351b52071f3.tar.gz
gcc-c65aa0429d688103b446a7cb2985c351b52071f3.tar.bz2
target-insns.def (stack_protect_set, [...]): New targetm instruction patterns.
gcc/ * target-insns.def (stack_protect_set, stack_protect_test): New targetm instruction patterns. * cfgexpand.c (stack_protect_prologue): Use them instead of HAVE_*/gen_* interface. * function.c (stack_protect_epilogue): Likewise. From-SVN: r225428
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 05eb2ad..4f9a31d 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -5767,11 +5767,6 @@ expand_main_function (void)
/* Expand code to initialize the stack_protect_guard. This is invoked at
the beginning of a function to be protected. */
-#ifndef HAVE_stack_protect_set
-# define HAVE_stack_protect_set 0
-# define gen_stack_protect_set(x,y) (gcc_unreachable (), NULL_RTX)
-#endif
-
static void
stack_protect_prologue (void)
{
@@ -5783,15 +5778,12 @@ stack_protect_prologue (void)
/* Allow the target to copy from Y to X without leaking Y into a
register. */
- if (HAVE_stack_protect_set)
- {
- rtx insn = gen_stack_protect_set (x, y);
- if (insn)
- {
- emit_insn (insn);
- return;
- }
- }
+ if (targetm.have_stack_protect_set ())
+ if (rtx_insn *insn = targetm.gen_stack_protect_set (x, y))
+ {
+ emit_insn (insn);
+ return;
+ }
/* Otherwise do a straight move. */
emit_move_insn (x, y);