aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/explow.c13
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/arm/pr85173.c20
4 files changed, 42 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0f5a8b2..805b4b4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2018-04-10 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/85173
+ * explow.c (emit_stack_probe): Call validize_mem on memory location
+ before passing it to gen_probe_stack. Create address operand and
+ legitimize it for the probe_stack_address case.
+
2018-04-09 Jan Hubicka <jh@suse.cz>
PR lto/85078
diff --git a/gcc/explow.c b/gcc/explow.c
index 042e719..fb2b7ff 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -1626,18 +1626,25 @@ void
emit_stack_probe (rtx address)
{
if (targetm.have_probe_stack_address ())
- emit_insn (targetm.gen_probe_stack_address (address));
+ {
+ struct expand_operand ops[1];
+ insn_code icode = targetm.code_for_probe_stack_address;
+ create_address_operand (ops, address);
+ maybe_legitimize_operands (icode, 0, 1, ops);
+ expand_insn (icode, 1, ops);
+ }
else
{
rtx memref = gen_rtx_MEM (word_mode, address);
MEM_VOLATILE_P (memref) = 1;
+ memref = validize_mem (memref);
/* See if we have an insn to probe the stack. */
if (targetm.have_probe_stack ())
- emit_insn (targetm.gen_probe_stack (memref));
+ emit_insn (targetm.gen_probe_stack (memref));
else
- emit_move_insn (memref, const0_rtx);
+ emit_move_insn (memref, const0_rtx);
}
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index de04c8b..f7ca834 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2018-04-10 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/85173
+ * gcc.target/arm/pr85173.c: New test.
+
2018-04-10 Jakub Jelinek <jakub@redhat.com>
PR lto/85248
diff --git a/gcc/testsuite/gcc.target/arm/pr85173.c b/gcc/testsuite/gcc.target/arm/pr85173.c
new file mode 100644
index 0000000..36105c9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr85173.c
@@ -0,0 +1,20 @@
+/* PR target/85173. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-probe-interval=14" } */
+/* { dg-require-effective-target arm_thumb2_ok } */
+
+__attribute__((noinline, noclone)) void
+foo (char *p)
+{
+ asm volatile ("" : : "r" (p) : "memory");
+}
+
+/* Nonconstant alloca, small local frame. */
+__attribute__((noinline, noclone)) void
+f5 (int x)
+{
+ char locals[128];
+ char *vla = __builtin_alloca (x);
+ foo (vla);
+}