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
This commit is contained in:
Tamar Christina 2018-10-01 12:53:34 +00:00 committed by Tamar Christina
parent cd1bef27d2
commit db6b62a858
2 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2018-10-01 Tamar Christina <tamar.christina@arm.com>
PR target/86486
* config/aarch64/aarch64.c (aarch64_layout_frame): Add assert.
2018-10-01 Jeff Law <law@redhat.com>
Richard Sandiford <richard.sandiford@linaro.org>
Tamar Christina <tamar.christina@arm.com>

View File

@ -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)