public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 8/8][GCC][AArch64] stack-clash: Add LR assert to layout_frame.
@ 2018-09-26  8:41 Tamar Christina
  2018-10-09  6:38 ` Tamar Christina
  0 siblings, 1 reply; 2+ messages in thread
From: Tamar Christina @ 2018-09-26  8:41 UTC (permalink / raw)
  To: gcc-patches; +Cc: nd, james.greenhalgh, Richard.Earnshaw, Marcus.Shawcroft

[-- Attachment #1: Type: text/plain, Size: 533 bytes --]

Hi All,

Since stack clash depends on the LR being saved for non-leaf functions this
patch adds an assert such that if this changes we would notice this.

Bootstrapped Regtested on aarch64-none-linux-gnu and no issues.

This patch has been pre-approved by AArch64 maintainer here
  https://gcc.gnu.org/ml/gcc-patches/2018-09/msg00555.html
and will be committed with the rest.

Thanks,
Tamar

gcc/ChangeLog:

2018-09-26  Tamar Christina  <tamar.christina@arm.com>

	* config/aarch64/aarch64.c (aarch64_layout_frame): Add assert.

-- 

[-- Attachment #2: rb10023.patch --]
[-- Type: text/x-diff, Size: 686 bytes --]

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 283f3372798c84ef74356128acf2a5be7b4ce1ad..d4b13d48d852a70848fc7c51fd867e776efb5e55 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -4050,6 +4050,11 @@ aarch64_layout_frame (void)
       offset = 2 * UNITS_PER_WORD;
     }
 
+  /* With stack-clash, LR must be saved in non-leaf functions.  */
+  gcc_assert (crtl->is_leaf
+	      || (cfun->machine->frame.reg_offset[R30_REGNUM]
+		  != SLOT_NOT_REQUIRED));
+
   /* Now assign stack slots for them.  */
   for (regno = R0_REGNUM; regno <= R30_REGNUM; regno++)
     if (cfun->machine->frame.reg_offset[regno] == SLOT_REQUIRED)


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [PATCH 8/8][GCC][AArch64] stack-clash: Add LR assert to layout_frame.
  2018-09-26  8:41 [PATCH 8/8][GCC][AArch64] stack-clash: Add LR assert to layout_frame Tamar Christina
@ 2018-10-09  6:38 ` Tamar Christina
  0 siblings, 0 replies; 2+ messages in thread
From: Tamar Christina @ 2018-10-09  6:38 UTC (permalink / raw)
  To: Tamar Christina, gcc-patches
  Cc: nd, James Greenhalgh, Richard Earnshaw, Marcus Shawcroft

Hi All,

I'm looking for permission to backport this patch to the GCC-8 branch
to fix PR86486.

OK for backport?

Thanks,
Tamar

> -----Original Message-----
> From: gcc-patches-owner@gcc.gnu.org <gcc-patches-owner@gcc.gnu.org>
> On Behalf Of Tamar Christina
> Sent: Wednesday, September 26, 2018 09:30
> To: gcc-patches@gcc.gnu.org
> Cc: nd <nd@arm.com>; James Greenhalgh <James.Greenhalgh@arm.com>;
> Richard Earnshaw <Richard.Earnshaw@arm.com>; Marcus Shawcroft
> <Marcus.Shawcroft@arm.com>
> Subject: [PATCH 8/8][GCC][AArch64] stack-clash: Add LR assert to
> layout_frame.
> 
> Hi All,
> 
> Since stack clash depends on the LR being saved for non-leaf functions this
> patch adds an assert such that if this changes we would notice this.
> 
> Bootstrapped Regtested on aarch64-none-linux-gnu and no issues.
> 
> This patch has been pre-approved by AArch64 maintainer here
>   https://gcc.gnu.org/ml/gcc-patches/2018-09/msg00555.html
> and will be committed with the rest.
> 
> Thanks,
> Tamar
> 
> gcc/ChangeLog:
> 
> 2018-09-26  Tamar Christina  <tamar.christina@arm.com>
> 
> 	* config/aarch64/aarch64.c (aarch64_layout_frame): Add assert.
> 
> --

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-09  6:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-26  8:41 [PATCH 8/8][GCC][AArch64] stack-clash: Add LR assert to layout_frame Tamar Christina
2018-10-09  6:38 ` Tamar Christina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).