From: Tamar Christina Date: Mon, 1 Oct 2018 12:53:34 +0000 (+0000) Subject: stack-clash: Add LR assert to layout_frame. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=db6b62a858e578fdb7f9f754f2c4bf868d951fcb;p=gcc.git stack-clash: Add LR assert to layout_frame. 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. gcc/ PR target/86486 * config/aarch64/aarch64.c (aarch64_layout_frame): Add assert. From-SVN: r264748 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 332f6dc707d..0d02631f38f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-10-01 Tamar Christina + + PR target/86486 + * config/aarch64/aarch64.c (aarch64_layout_frame): Add assert. + 2018-10-01 Jeff Law Richard Sandiford Tamar Christina diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 9fd5cb20d84..9507608da9a 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -4094,6 +4094,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)